Giter VIP home page Giter VIP logo

motion-i18n's People

Contributors

augustosamame avatar markrickert avatar mixflame avatar semanticart avatar tkadauke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

motion-i18n's Issues

Does not escape double quotes

My locale yml file contains something similar to this:

en:
  hello_world: say "hello"

As far as I know, this is valid YAML. However, when the Localizable.strings file gets created, it looks like this:

"hello_world" = "say "hello"";

...resulting in a syntax error. I think this gem needs to escape double quotes.

Don't crash when translated string doesn't exist

Thoughts on outputting a debug message in the REPL when a translated string doesn't exist?

something like

> I18n.t(:some_key_that_doesnt_exist)
> WARNING! I18n key doesn't exist for: :some_key_that_doesnt_exist.
> Please add it to your translation file.

and then do some symbol to string conversion for the time being so that the app doesn't crash? Maybe something like:

# Convert using: key.to_s.gsub(/_/, ' ')
I18n.t(:some_key_that_doesnt_exist) # some key that doesn't exist

i18n_tools not working properly

Followed the instructions and it's telling me that all my translations are not used when they, in fact, are.

rake translations:unused

Shows all strings :(

Error when the translate task is run

When I run my app after incorporating this gem, I get the following:

$ rake --trace                                                                                                                        ** Invoke default (first_time)
** Execute default
******************************************
 Build for development environment...
******************************************
** Invoke default (first_time)
** Invoke simulator (first_time)
** Execute simulator
** Invoke build:simulator (first_time)
** Invoke translate (first_time)
** Execute translate
rake aborted!
NoMethodError: undefined method `each' for nil:NilClass
/Users/ernesto/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/motion-i18n-0.0.2/lib/tasks/translate.rb:26:in `block (3 levels) in <top (required)>'
/Users/ernesto/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/motion-i18n-0.0.2/lib/tasks/translate.rb:25:in `open'
/Users/ernesto/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/motion-i18n-0.0.2/lib/tasks/translate.rb:25:in `block (2 levels) in <top (required)>'
/Users/ernesto/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/motion-i18n-0.0.2/lib/tasks/translate.rb:20:in `each'
/Users/ernesto/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/motion-i18n-0.0.2/lib/tasks/translate.rb:20:in `block in <top (required)>'
...
/Users/ernesto/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Users/ernesto/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/Users/ernesto/.rbenv/versions/2.1.1/bin/rake:23:in `load'
/Users/ernesto/.rbenv/versions/2.1.1/bin/rake:23:in `<main>'
Tasks: TOP => build:simulator => translate

It seems to me that the all_translations variable assigned here is nil. But I have no idea why.

Adding gem leads to error

Hi, as the docs suggest, I've added the gem to my gemfile (this is the only thing I did). When I rake, I get the following error. Did I miss something? Thanks!

rake aborted!
NoMethodError: undefined method `each' for nil:NilClass
/Users/nandersen/Documents/RubyMotion/lactase2/vendor/bundle/gems/motion-i18n-0.0.6/lib/motion-i18n-ios/translate.rb:25:in `block (2 levels) in ios_translate'
/Users/nandersen/Documents/RubyMotion/lactase2/vendor/bundle/gems/motion-i18n-0.0.6/lib/motion-i18n-ios/translate.rb:24:in `open'
/Users/nandersen/Documents/RubyMotion/lactase2/vendor/bundle/gems/motion-i18n-0.0.6/lib/motion-i18n-ios/translate.rb:24:in `block in ios_translate'
/Users/nandersen/Documents/RubyMotion/lactase2/vendor/bundle/gems/motion-i18n-0.0.6/lib/motion-i18n-ios/translate.rb:19:in `each'
/Users/nandersen/Documents/RubyMotion/lactase2/vendor/bundle/gems/motion-i18n-0.0.6/lib/motion-i18n-ios/translate.rb:19:in `ios_translate'
/Users/nandersen/Documents/RubyMotion/lactase2/vendor/bundle/gems/motion-i18n-0.0.6/lib/motion-i18n-ios/translate.rb:34:in `block in <top (required)>'
/Library/RubyMotion/lib/motion/project/template/ios.rb:186:in `block in <top (required)>'

New Gem Release

Can we get one soon? Last release was in 2013 and there are a few new things that i'd like to use without having to reference git in my Gemfile... notably multiple substitution of variables.

Thanks!

How to set the local?

Hello,

How can I set a locale? There seems to be only a way to get the locale
but that isn´t very helpful.

Thanks!

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.