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

Language problem on FakeI18n #606

Open
Nuxor3000 opened this issue Jan 25, 2022 · 9 comments
Open

Language problem on FakeI18n #606

Nuxor3000 opened this issue Jan 25, 2022 · 9 comments

Comments

@Nuxor3000
Copy link
Contributor

In the line i18n.locale = document.documentElement.lang || 'en' in app/javascript/src/shared/FakeI18n.ts

document.documentElement.lang is empty

I replaced it by :

const currentLang = navigator.language || navigator['userLanguage'];
i18n.locale = currentLang || 'en';

which set the correct language but when connecting or failing, language is back to english

Do you have a clue why ?

@michelson
Copy link
Member

Hi @Nuxor3000, what user language do you have in your browser?

@Nuxor3000
Copy link
Contributor Author

italian
I modified the connect page to use the locales I added in it.yml
Seems like the language is set somewhere else also but I don't find where

@Nuxor3000
Copy link
Contributor Author

Nuxor3000 commented Jan 25, 2022

Oh and that's occuring both in firefox and chrome in the same way (I didn't try others)

@Nuxor3000
Copy link
Contributor Author

And I also can't manage to find how to set a language different from english for the created user when app is created

@michelson
Copy link
Member

michelson commented Jan 25, 2022 via email

@michelson
Copy link
Member

@Nuxor3000 look at the langs: key on the lang file. there is a list of the allowed langs that will be displayed on the lang chooser in the agent panel. Since the "IT" lang is not yet complete it is not enabled on the list. Langs with at least 90% completion will be added to that list.

Are you trying to display the lang on the agent panel or the webchat?

@Nuxor3000
Copy link
Contributor Author

Yes I added it to the langs to use it even if with a not completely translated version.
I'm displaying the lang on both and it's not that bad.

To detail a bit the problem to help in finding the source of the problem :

In "login form" or in "accept invitation form",
once "import I18n from '../../shared/FakeI18n';" added at the top of the file,
I can use localized text but when an error occur
(or as soon as I type something for the "accept invitation form"),
the locale gets back to english.

@michelson
Copy link
Member

Uhm... could you provide a screen recording?

@Nuxor3000
Copy link
Contributor Author

I18n-bug-login-chaskiq.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants