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

Cannot switch back to English after chose another language #1098

Closed
jyyi1 opened this issue Nov 12, 2021 · 7 comments · Fixed by #1126
Closed

Cannot switch back to English after chose another language #1098

jyyi1 opened this issue Nov 12, 2021 · 7 comments · Fixed by #1126
Assignees
Labels
bug Something is broken, we are tracking it good first issue Issues that are good for a beginner or new contributor to tackle

Comments

@jyyi1
Copy link
Contributor

jyyi1 commented Nov 12, 2021

Describe the bug
In the web-app, after I chose a language other than English and refresh the page, I can not switch back to English.

To Reproduce

  1. "Navigation Button" -> "Change Language" -> "Español"
  2. Refresh the page
  3. The language is in Spanish (which is expected)
  4. "Navigation Button" -> "Cambiar idioma" -> "English"
  5. Nothing happens, refreshing does not help either

There are at least three problems:

  1. The "Change Language" title is "language-page-title"
  2. After choose "English", nothing happens, and the language is still in Spanish
  3. Fake Server for local development are gone
  4. This applies to all languages other than English

Workaround
Delete "overrideLanguage" field in the local storage.

Expected behavior
I should be able to switch back to English and all features should be normal.

Screenshots
N/A

Client System (please complete the following information):

  • Outline Client Version: local development
  • Your Operating System: MacOS

Additional context

Uncaught (in promise) Error: The intl string context variable 'mediumUrl' was not provided to the string 'Outline es un proyecto de código abierto que <a href={jigsawUrl}>Jigsaw</a> creó para que los periodistas y las organizaciones de noticias tengan una forma más segura de acceder a Internet.<br><br> Outline es un producto que cuenta con la tecnología de <a href={shadowsocksUrl}>Shadowsocks</a> y que aún se encuentra en una etapa inicial. Puedes colaborar con el código en <a href={gitHubUrl}>GitHub</a> y seguirnos en <a href={redditUrl}>Reddit</a> y <a href={mediumUrl}>Medium</a> para estar al tanto cuando nos expandamos a más plataformas y agreguemos nuevas funciones.'
    at MessageFormat.format (core.js:48)
    at HTMLElement.<anonymous> (app-localize-behavior.js:291)
    at runMethodEffect (property-effects.js:1038)
    at Function._evaluateBinding (property-effects.js:3161)
    at Object.runBindingEffect [as fn] (property-effects.js:785)
    at runEffects (property-effects.js:140)
    at baseRunEffects (property-effects.js:1958)
    at HTMLElement._runEffectsForTemplate (property-effects.js:1967)
    at HTMLElement._propagatePropertyChanges (property-effects.js:1952)
    at HTMLElement._propertiesChanged (property-effects.js:1916)
@jyyi1 jyyi1 added the bug Something is broken, we are tracking it label Nov 12, 2021
@fortuna
Copy link
Collaborator

fortuna commented Nov 16, 2021

@jyyi1 What command did you use to run the client?

Also, what browser and version did you use?

@fortuna
Copy link
Collaborator

fortuna commented Nov 16, 2021

Oh, oh, this PR is the culprit: #1061

We are no longer passing the mediumUrl. However, we need to generate new translations. We only updated English.

THIS WILL BREAK THE CLIENT! We can't release in the current state. I'm pretty sure if you build and run the app from master it will be broken. The released client in production was not affected by that change. You can confirm by looking at the about message.

@bemasc can you show @jyyi1 (and @daniellacosse) how to update the translations?

@fortuna
Copy link
Collaborator

fortuna commented Nov 16, 2021

/cc @cjhenck

@fortuna
Copy link
Collaborator

fortuna commented Nov 16, 2021

On a side note, this is a really hard bug to catch. It could easily make it to production.

@daniellacosse @jyyi1 we need a way to type-check the messages. Perhaps convert the messages into actual TS code like we do at Google.

@daniellacosse
Copy link
Contributor

daniellacosse commented Nov 16, 2021 via email

@jyyi1
Copy link
Contributor Author

jyyi1 commented Nov 16, 2021

@fortuna @daniellacosse One solution I could think of is to compare resource string keys among all the languages, but I need to first make sure how the translation works.

@bemasc
Copy link
Contributor

bemasc commented Nov 16, 2021

Unfortunately, we can't really require parity between languages as part of our compilation or presubmit CI, because we need to be able to update the UI before we have translations for new strings. However, we might be able to add a pre-release CI step that catches these issues.

@jyyi1 jyyi1 self-assigned this Nov 19, 2021
@jyyi1 jyyi1 added the good first issue Issues that are good for a beginner or new contributor to tackle label Nov 25, 2021
jyyi1 added a commit that referenced this issue Dec 7, 2021
Previously we updated the `about-outline` text in #1061. In this change set, we translated the updated text into all 45 languages.

Fixes #1098.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken, we are tracking it good first issue Issues that are good for a beginner or new contributor to tackle
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants