Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    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
    Dumitru Saftiuc
    Is it works with vuejs + rails 6 + webpacker?
    excuse me, is this gitter also ok for i18n-react ?
    Aksh gaur
    Hi All,
    I am facing lots of issues while using i18n-js with webpacker in ruby on rails. :(
    can somebody suggest how can we use i18n-js with webpacker.
    Simon Garnier
    Hi everyone, a little question: is there a way to check if a translation exists or not?
    My fallback mechanism doesnt work :/
    missing fr-us translation
    ok it was my bad :/
    Andrey Danil
    I am having an issue with the /tmp/cache
    No such file or directory @ rb_sysopen - /rails-root/tmp/cache/i18n-js.yml
    The tmp/cache/i18n-js.yml file gets deleted and recreated multiple times per minute. Is there a way I can disable the tmp/cache?
    I have many users calling my service and occasionally the cache will get invalidated, thus causing a 500 error
    Andrey Danil
    Any ideas? I'm using Ruby 2.7 and Rails 5.2
    Andrey Danil

    I see the tmp/cache/i18n-js.yml file gets updated if

    Check if translations should be regenerated.

    ONLY REGENERATE when these conditions are met:


    # Cache file doesn't exist

    # Translations and cache size are different (files were removed/added)

    # Translation file has been updated


    Is it possible to disable this?

    Atinder Singh

    I have added i18n-js in my react / webpacker project.
    import i18n from "i18n-js"

    gives me i18n as undefined.

    I can see i18n-js in my package.json but module is not loading.

    hi all
    I wanna ask you is there a way to make real time localization without restarting the app?