PPLR Data Maps: the fullscreen button is named in the page's language
rega's L15 (e7f343d4c, ar + zh): every PPLR map view's fullscreen button read "Toggle fullscreen" in English, title and aria-label. It is PPLR's own control (FullscreenToggleControl in src/utils/pplrMap.js, not MapLibre's), and it wrote the English itself. It now takes the shared buttons.toggleFullscreen, already translated in all 11 locales, when the map is built.
This commit is contained in:
parent
9d12e59b60
commit
53ed778d71
1 changed files with 5 additions and 2 deletions
|
|
@ -441,8 +441,11 @@ export class FullscreenToggleControl {
|
|||
this._btn = document.createElement('button')
|
||||
this._btn.type = 'button'
|
||||
this._btn.className = 'mapboxgl-ctrl-fullscreen'
|
||||
this._btn.setAttribute('aria-label', 'Toggle fullscreen')
|
||||
this._btn.title = 'Toggle fullscreen'
|
||||
// The shared, translated name (buttons.toggleFullscreen), in the page's language when the map is
|
||||
// built. rega saw the English "Toggle fullscreen" in ar and zh on every PPLR map view.
|
||||
const label = tStatic('buttons.toggleFullscreen') || 'Toggle fullscreen'
|
||||
this._btn.setAttribute('aria-label', label)
|
||||
this._btn.title = label
|
||||
this._btn.innerHTML = '<span class="mapboxgl-ctrl-icon" aria-hidden="true"></span>'
|
||||
this._btn.addEventListener('click', () => this._toggle())
|
||||
this._sync = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue