Fallback language translations failing to be processed.
See original GitHub issueI have angular translate configured using the following code.
$translateProvider.useStaticFilesLoader({
files: [{
prefix: 'i18n/sys-captions.',
suffix: '.json'
}]
}).fallbackLanguage('en_US')
.determinePreferredLanguage();
In this instance determinePreferredLanguage correctly sets my preferred language as en_GB (I’m currently experimenting with how reliable it is). I only have the US translation file available and the fallbackLanguage file is correctly loaded from the server.
However, when I try and translate an item via the $translate service, it will fail to find the item. The problem seems to reside inside the determineTranslation function.
if ($uses && $fallbackLanguage && $fallbackLanguage.length) {
fallbackTranslation(translationId, interpolateParams, Interpolator, defaultTranslationText)
In my cases the $uses variable appears as undefined and so it does not make an attempt to process the fallback translation. Removing the $uses variable from the if statement corrects the issue for me.
Issue Analytics
- State:
- Created 8 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Sort out and fix language fallback inconsistencies - Drupal
This makes "Entity does not have a fallback" indistinguishable from "Entity fallback is the passed-in entity translation. Also: In the absence ...
Read more >Fallback language | EY
Fallback language refers to the contractual provisions that lay out the process through which a replacement rate can be identified if a benchmark...
Read more >Translation and Fallback Language Options for SAP Enable ...
The default fallback language is English (US): en-US. It is also used after searching the fallback language chain. For example, if no content...
Read more >Fallback Contract Language - Alternative Reference Rates ...
These consultations outline draft language to be voluntarily incorporated in new contracts that reference USD LIBOR to ensure these contracts will continue to ......
Read more >Double Language Fallback Behavior in Episerver
In cases when you assume that translations provider in code are ... translation is not being found, and built-in fallback also failed -...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sure do @tspaeth – I have now verified this fix worked for me, thanks a lot! Fallback language’s translation string is now loaded if target language doesn’t have it translated.
#1433 is landed in canary. @envision Thank you for verifying.
Available in the next 2.11