Code Monkey home page Code Monkey logo

Comments (5)

MichaelHoste avatar MichaelHoste commented on September 13, 2024 1

Hi @noon-ng,

As you mentioned, underscores are certainly the issue here. GetText doesn't manage them correctly and we should have mentioned that in the README and blog post (we will!).

You can't create the custom languages in the UI, but if you add them into your config file, these custom target languages will be created for you.

Were you able to initialize your project correctly?

from rails.

noon-ng avatar noon-ng commented on September 13, 2024 1

Hi @MichaelHoste, thanks for getting back to me. Yup -- it works as intended.

Now to figure out how multiple locales can be combined at the I18n level :)

from rails.

MichaelHoste avatar MichaelHoste commented on September 13, 2024 1

I'm glad it worked!

I'm not sure what you mean by "combined locales" but maybe this page on i18n fallbacks will help: https://github.com/ruby-i18n/i18n/wiki/Fallbacks

I'll leave this ticket open until we update the docs 😄

from rails.

noon-ng avatar noon-ng commented on September 13, 2024 1

Ace @MichaelHoste!

from rails.

noon-ng avatar noon-ng commented on September 13, 2024

Some progress -- I think the issue was that the custom locale I was trying to use had underscores in it. Here's my breaking config/initializers/translation.rb

TranslationIO.configure do |config|
  config.api_key        = '...'
  config.source_locale  = 'en'
  config.target_locales = ['en-not_ready_on']
end

This raises a GetText::Tools::MsgInit::ValidationError: Locale 'en-not_ready_on' is invalid. Please check if your specified locale is usable. when running rake translation:init.

If I remove the underscores from the target locale name (to en-notreadyon), it works fine.

from rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.