Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Ben Hartouz Mohamed
    any one there
    i have one question ?
    can some one help me pleas ?
            resGetPath: 'themes/defaultfrontendtheme/js/__ns__-__lng__.json',
            fallbackLng: '{{app.request.getLocale()}}',
            lng: '{{app.request.getLocale()}}',
            useCookie: false, 
    }, function(t){
    i wanna use i18n to translate my website
    but whene i use i18n.t() function outside of init i didn't got anyting
    What version are you using?
    Emilio Morilla Nieto
    Hello there! Is anyone here who can help me out with an error ?
    Emilio Morilla Nieto

    I'm using Chain class: I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n::Backend::Simple.new),
    so when I try to rake i18n:js:export it returns me the error:
    NoMethodError: undefined method `initialized?' for #<I18n::Backend::Chain:0x000000030de550>

    Any idea?

    Oh sorry forgot to check Gitter :S
    I remember i18n-js only support Simple backend :(
    I have an issue with I18n-js last version
    on old browser version Chrome 38 for instance, I get this error:
    Uncaught SyntaxError: Duplicate data property in object literal not allowed in strict mode
    I would not mind if I did not get this error when google bot is crawling my content
    breaks the page and blocking indexing
    If I use i18-js 2.1.2 I dont have the issue BUT
    the fallback mechanisme does not work
    so I get missing translations everywhere!
    if the locale is not in my managed list
    Do you have any clue?

    I only know i18n-js starting 3.0.0.rc5
    so I am not able to help you with 2.1.2

    3.0.0 will be released soon though (next week)

    Ok tks
    but what about the bug with Google Bot?
    I'd like to use i18n-js 3.0.0
    but if it breaks on the browser version used by google...
    How does it break?
    Vojtech Novak
    hi! probably a non-standard use case, but I'm using i18n-js with react native, where my intention is to have translations separately for each component that needs it, which yields many translation files. However, I found that the i18n.translations object is global - one for the entire app. Is there some built-in way of keeping the translations local to each i18n object that I import in my compoents?
    Breno Moura


    I'm using the i18n-js with multitenancy and at my rails application the translation file is defined by tenant name, so we have 4 different files, 1 is the en.yml default and the others is the tenant_name.yml. At the ApplicationController.rb, the file is selected by the Tenant, and used by the default translation en.

    Here is the code

      def set_tenant_translation
        translation_path = 'config/locales/' \
        if File.exist?(translation_path)
          i18n = YAML.load(File.read(translation_path))
          I18n.backend.store_translations :en, i18n.fetch(locale.to_s)

    On my local environment works perfectly, but on staging and production dont. Does anybody know why?

    Breno Moura
    @PikachuEXE any idea?
    Well, explain what is “not working”
    Error? Don’t get expected result? Something else?
    Sorry I don’t check gitter that often :P
    Hi, we're trying to trim our resulting translation.js file. is there an option to exclude name translations?
    Just search for except in README
    Shawn Loh
    Hello, i am using this with react native, but i am unable to change the locales using i18n.locale(‘fr’)
    I mean
    I18n.locale = "fr’
    its just giving me back my default locale
    which is ‘en’
    Shawn Loh
    I would wish to dynamically change the locale when the user is inside the application
    Sorry for really late response (forgot to setup notification)
    Open a new issue for it maybe?
    is there any ui/Gui editor for i18n json format ? or maybe a .po file converter ?

    Hi All,
    Is there a way to create a "scoped" I18n object with just the translations that I give it? I'm thinking something like new I18n({ header: 'Test', section: { header: 'Section' } }).t('section.header')

    For context, I have a situation where I'm passing a t function as a property all the way down my react tree, and at the top-level I am using https://github.com/reactjs/react-rails to inject my translations as a property into the top-level React component. This lets me inject just the translations I need for this particular tree, instead of writing my entire translation file.

    Kaitlin Jaffe
    Hi everyone. I just made a PR to add a few more supported formats to strftime. Would love some feedback! fnando/i18n-js#537