Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    kgeoir
    @kgeoir
    Hello
    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
    @PikachuEXE
    Do you have any clue?
    PikachuEXE
    @PikachuEXE

    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)

    kgeoir
    @kgeoir
    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...
    PikachuEXE
    @PikachuEXE
    How does it break?
    Vojtech Novak
    @vonovak
    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?
    thanks!
    Breno Moura
    @basmoura

    Hi!

    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/' \
                           "#{Tenant.current.prefix}/#{locale}.yml"
    
        if File.exist?(translation_path)
          i18n = YAML.load(File.read(translation_path))
          I18n.backend.store_translations :en, i18n.fetch(locale.to_s)
        end
        yield
      end

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

    Breno Moura
    @basmoura
    @PikachuEXE any idea?
    PikachuEXE
    @PikachuEXE
    Well, explain what is “not working”
    Error? Don’t get expected result? Something else?
    Sorry I don’t check gitter that often :P
    Phil
    @Phil72206840_twitter
    Hi, we're trying to trim our resulting translation.js file. is there an option to exclude name translations?
    PikachuEXE
    @PikachuEXE
    Just search for except in README
    https://github.com/fnando/i18n-js
    Shawn Loh
    @shawnloh
    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
    @shawnloh
    I would wish to dynamically change the locale when the user is inside the application
    PikachuEXE
    @PikachuEXE
    Sorry for really late response (forgot to setup notification)
    Open a new issue for it maybe?
    @as
    @ahshawn
    Younes
    @younes200
    hi
    is there any ui/Gui editor for i18n json format ? or maybe a .po file converter ?
    Gordon
    @gburgett

    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
    @dancingshell
    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
    @habrauser
    Is it works with vuejs + rails 6 + webpacker?
    popoleeMaster
    @popoleeMaster
    excuse me, is this gitter also ok for i18n-react ?
    Aksh gaur
    @aksh_gaur_twitter
    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
    @ticketapp
    Hi everyone, a little question: is there a way to check if a translation exists or not?
    chichke
    @chichke
    My fallback mechanism doesnt work :/
    missing fr-us translation
    chichke
    @chichke
    ok it was my bad :/
    Andrey Danil
    @andreydanil
    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
    @andreydanil
    Any ideas? I'm using Ruby 2.7 and Rails 5.2
    Andrey Danil
    @andreydanil

    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

    https://github.com/fnando/i18n-js/blob/main/lib/i18n/js/middleware.rb

    Is it possible to disable this?

    Atinder Singh
    @atinder

    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.