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

i18n and fallbacks #6396

Closed
cyrilchapon opened this issue Sep 18, 2017 · 2 comments · Fixed by #6762
Closed

i18n and fallbacks #6396

cyrilchapon opened this issue Sep 18, 2017 · 2 comments · Fixed by #6762
Assignees

Comments

@cyrilchapon
Copy link

cyrilchapon commented Sep 18, 2017

With the following configuration :

angular.module('mymodule')
  .config(function($translateProvider) {
    //SKIPPED: Initialize loaders

    $translateProvider.registerAvailableLanguageKeys(
      ['en','fr'], {
        'en*': 'en',
        'fr*': 'fr'
      }
    );

    $translateProvider.fallbackLanguage('en');
    $translateProvider.preferredLanguage('en');
  })
  .run(function($window, $translate, i18nService){
    //get browser locale
    var lang = $window.navigator.userLanguage || $window.navigator.language;

    //configure translation language
    $translate.use(lang);

    //configure locale for angular-ui-grid
    i18nService.setCurrentLang(lang);
  });

Angular-translate filter does in this order :

  • Search for any translated string with [used locale]
  • Search for any translated string with [used locale].split('-')[0]
  • Search for any translated string with [fallback locale]
  • Display un-translated string

While ui-grid does :

  • Search for any translated string with [used locale]
  • Display nothing
@stale
Copy link

stale bot commented May 28, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 28, 2018
@mportuga
Copy link
Member

I am working on this issue this week.

@stale stale bot removed the stale label Jun 18, 2018
mportuga pushed a commit that referenced this issue Jun 19, 2018
Adding the ability to have a fallback language in order to improve
usability for languages that have not been fully translated.

BREAKING CHANGE: getSafeText() will now return [MISSING] + the path to
the missing property or the fallback value if the property is available
on the fallback language.

fix #6396
mportuga pushed a commit that referenced this issue Jun 19, 2018
Adding the ability to have a fallback language in order to improve
usability for languages that have not been fully translated.

BREAKING CHANGE: getSafeText() will now return [MISSING] + the path to
the missing property or the fallback value if the property is available
on the fallback language.

fix #6396
defields923 pushed a commit to defields923/ui-grid that referenced this issue Oct 30, 2018
Adding the ability to have a fallback language in order to improve
usability for languages that have not been fully translated.

BREAKING CHANGE: getSafeText() will now return [MISSING] + the path to
the missing property or the fallback value if the property is available
on the fallback language.

fix angular-ui#6396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants