This repository has been archived by the owner. It is now read-only.
chore(tests): make sure unit tests pass with different locales #4535
Conversation
|
What if instead of calling a let translator = new Translator({ lang: 'en_US' });But that'd imply we could force any language. Maybe something like: And in the constructor, if Would that be cleaner? |
| * @private | ||
| */ | ||
| _clearTranslationValues () { | ||
| Object.keys(this.__translations__).forEach((translationKey) => { |
shane-tomlinson
Dec 21, 2016
Member
I think you should be able to just do a this.__translations__ = {}. get will see no translation exists for the key and use the key as the translation.
I think you should be able to just do a this.__translations__ = {}. get will see no translation exists for the key and use the key as the translation.
| * | ||
| * Useful in tests to avoid failures when | ||
| * running tests with a non-EN-US locale. | ||
| * @private |
shane-tomlinson
Dec 21, 2016
Member
This function is called outside of this module so isn't really private.
This function is called outside of this module so isn't really private.
Yeah, sorry I tried that earlier but translator exploded. works now |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Fixes #4437
@shane-tomlinson r?