Code Monkey home page Code Monkey logo

i18n_lazy_scope's Introduction

Mohamad El-Husseini

A senior technology leader, tenacious problem-solver, building digital products since web 1.0. Enthusiastic and passionate about learning and helping others learn.

Currently in charge of Technology at Kovi, helping transform ubran mobility in LATAM. Previously in charge of consumer and enterprise commerce products at Obramax, Adeo, where I helped millions of customers build their dream projects.

i18n_lazy_scope's People

Stargazers

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

Watchers

 avatar  avatar  avatar

i18n_lazy_scope's Issues

Best practice for using i18n with strings in Rails 4 model?

I really like your gem.

I am running into a little problem with moving some of the strings from my model validators into en.yml. If I use the typical t approach (I18n.t('models.band.band_name_validation') I get the following in my view:

<span class="translation_missing" title="translation missing: en.views.bands.index.title">Title</span>:

Since I am calling this from my model I am wondering why t is looking in views.bands.index.title when I have this in my en.yml. It seems like maybe some of your gem's magic might be tripping things up?

en:
  models:
    band:
      band_name_validation: "Dude, you gotta have a band name!"

I tried calling I18nLazyScope.t_scoped from my model and that was undefined method 't_scoped'. I also tried using t_scoped("band_name_validation"), and that was also undefined method 't_scoped'. Is there a reason why I am not able to use t in my model with your gem installed? I also tried using model: instead of models: in my .yml, but no luck.

Can you tell me how to get this done using your gem or t? Thanks in advance.

I also wish there was a way I could use aliases over multiple .yml files so I could divide up my massive single file into folders. Can't find any way to do this now, maybe it's not even possible, but I would love to see a gem for that.

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.