Open DavidPetit opened 5 years ago
Thank you for reporting this!
The current code incorrectly matches same-language locales (e.g. fr
vs. fr_FR
vs. fr_CA
, or en_US
(which is the default) vs. en_GB
).
Furthermore, the underscore syntax _
is specific to the now-defunct Chrome app / extension (see https://developer.chrome.com/apps/i18n ), this should now really be a dash / hyphen -
, as per BCP47 https://tools.ietf.org/rfc/bcp/bcp47 (as reported by navigator.language
in all modern web browsers)
Code references:
Until a proper fix, a possible workaround would have been to set navigator.userLanguage
via the "web inspector" (debugging tools, console), but unfortunately to no avail because navigator
properties are reset at each page refresh (at least, in my Firefox and Chrome tests). For example: navigator.userLanguage="fr"
or Object.defineProperty(navigator, 'userLanguage', { get: function() { return "fr" } });
Hi, I am using the cloud reader lite.
I see there are i18n locale files with stings translations, but I do not understand how to use them. I would like to use the french translation. How to achieve this?
I also believe there is some kind of language detection as I read this line in Strings.js:
var language = navigator.userLanguage || navigator.language;
But even if this return fr_FR in my browser, the interface of Readium is still in english.
Thanks for your help!