Comments (5)
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.
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.
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.
Ace @MichaelHoste!
from rails.
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)
- Special characters in translation HOT 2
- Isn't it possible to only use gettext? HOT 2
- Deprecation warning for #has_rdoc (Rubygems) HOT 2
- Do not add methods on Object HOT 3
- Empty hash in localization.en.yml
- Strings not get synced
- Crash on "rake translation:init" HOT 3
- getText method not translating text as supposed to after install and intialization HOT 7
- Deprecation warning on Rails 6 HOT 4
- Need a suggestion on how to keep the source pluralization clean HOT 2
- Error while running `translations:sync`: ArgumentError: comparison of Pathname with String failed HOT 3
- When disabling gettext in the initialiser gettext directory and files are still created HOT 3
- gettext strings missing after use of case statement in erb HOT 20
- A way to exclude translation keys HOT 3
- Ruby 3.1 compatibility (Psych 4 breaking change) HOT 7
- Match I18n fallbacks in GetText HOT 2
- ignore specific files HOT 4
- Error when starting Pushion Passenger HOT 2
- Technical Demo video from readme not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails.