Where communities thrive


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

    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?

    PikachuEXE
    @PikachuEXE
    Oh sorry forgot to check Gitter :S
    I remember i18n-js only support Simple backend :(
    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
    @ahshawn
    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
    @ahshawn
    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