-
Notifications
You must be signed in to change notification settings - Fork 27
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
invalid messages should be skipped #25
Comments
Oh, translators... :) Your approach sounds sane to me, which is: let I'm still trying to reason "who" should be held responsible for this issue: webpack plugin, the compiler, or Globalize itself. At the compiler, Considering we are going to handle that at the compiler (as suggested), I think having the fallback as the defaultLocale is a good first step. I'm wondering if the chosen solution could later be extended to be made more generic. For example, it should cover the following scenario: let's suppose an application has several translations; a missing locale could be better replaced as fallback of another available translation instead of the default locale; for example, another Cyrillic script locale for a missing Russian, where the fallback logic could come from http://www.unicode.org/reports/tr35/#LanguageMatching. Let's use Should we have that concept of fallbackLocales at Globalize itself? |
This might need changes to
globalize-compiler
as well, but I wanted to get your thoughts on a possible approach.For certain locales, we've been getting invalid ICU message strings back from our translators. For instance.
When we do a production build, because
{{name} et Vous
is an invalid string, messageformat.js throws an error, which is propagated up to the top of the tree, and no bundle is created for the locale. We would much rather catch this error and show the default language's message to our users for this message than show the entire app in the default language.compileExtracts
in globalize-compiler doesn't have a reference to the project's default Globalize locale (only the current one, which is calleddefaultLocale
in that file), so it would need some changes. We would want to change the generated formatters from (e.g):to something like:
or a more compact version of the same.
@rxaviers any ideas?
The text was updated successfully, but these errors were encountered: