Code Monkey home page Code Monkey logo

i18n_missing_keys's People

Contributors

agordillo avatar davidw avatar koppen avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

i18n_missing_keys's Issues

Task not working when i18n fallbacks are enabled

I fixed it by replacing this line 'I18n.translate(key, :raise => true)' for 'I18n.translate(key, :raise => true, :fallback => 'false')'.

It seems that we can pass :fallback => 'false' on the I18n.translate calls, but this is not part of the public API.

I think this is an easier solution that the one proposed on #4

Hope it helps

Missing Translation Categories

We have a locale file that looks somewhat like the following. Notice that the attributes section is empty since we don't need translations for the attribute names for this model.

en:
  activerecord:
    attributes:
      answer:
    models:
      answer:
        one: "Answer"
        other: "Answers"

The rake task will always complain of a missing key 'activerecord.attributes.answer'. I believe it should not complain.

My proposed fix is below.

--- a/lib/tasks/missing_keys.rake
+++ b/lib/tasks/missing_keys.rake
@@ -77,6 +77,7 @@ class MissingKeysFinder
   def collect_keys(scope, translations)
     full_keys = []
     translations.to_a.each do |key, translations|
+      next if translations.nil?
       new_scope = scope.dup << key
       if translations.is_a?(Hash)
         full_keys += collect_keys(new_scope, translations)

No results for non default locale if fallbacks are configured

I did configure fallback for languages like de for de_AT, no fallback for en. When runing the rake task it does only show results for de, not for en. Deactivating the fallbacks in application.rb means that I get results for all languages. Is there any possibility to deactivate fallbacks temporary inside this rake task?

thx, Leuchteuer

Gem

That’s great, exactly what I was looking for! Could you maybe make it a gem? This way it would be easy to load it only in development mode.

Thanks for your efforts!

License missing

If the license is e.g. GPL, the project cannot be used as freely as MIT ones, so the licensing should be explicitly presented in all projects.

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.