Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-4.5] Support ?pseudolocalization=true|false to enable/disable pseudolocalization; ?lang= to force language (#3225) #3244

Merged
merged 1 commit into from
Jan 30, 2023

Commits on Jan 30, 2023

  1. Support ?pseudolocalization=true|false to enable/disable pseudoloca…

    …lization; `?lang=` to force language (ansible#3225)
    
    * Support `?pseudolocalization=true|false` to enable/disable pseudolocalization
    
    Pseudlocalization (>>marking<< strings marked for translation, instead of actually translating them),
    is supported since ansible#810 by setting `localStorage.test_l10n = true` in the browser console and reloading the page.
    
    > Note: the current lingui implementation needs `npm run gettext:extract; npm run gettext:compile` for any new strings before they appear as marked. We should try to remove that limitation during the i18next switch.
    
    This PR makes it easier to enable/disable by setting a `?pseudolocalization=true/false` URL param,
    which gets used to set/unset `localStorage.test_l10n`.
    (Thus, after using `?pseudolocalization=true` once, you will see it until you explicitly set `?pseudolocalization=false`, even when visiting URLs without the param.)
    
    No-Issue
    (but really AAP-4750)
    
    * Allow ?lang=ja to override detected language, ?lang= to unset it
    
    Visiting the UI with `?pseudolocalization=true` sets `localStorage.test_l10n = true`,
    and `?pseudolocalization=false` does `delete localStorage.test_l10n`.
    
    Now, also `?lang=ja` sets `localStorage.override_l10n = 'ja'`,
    and `?lang=` does `delete localStorage.override_l10n`.
    
    This allows the user to override the language by adding an URL param,
    and the UI will remember the choice until unset.
    
    Also adding two `console.debug` messages when pseudolocalization or langugage override are enabled, with URLs to disable again.
    
    (cherry picked from commit 6ba2b97)
    himdel committed Jan 30, 2023
    Configuration menu
    Copy the full SHA
    9593513 View commit details
    Browse the repository at this point in the history