I have a question about the Rails engine, which is not mentioned in the Rails manual on the Rails engine. I hope to get it here.
I have one engine, for example, my_engine and one application called my_app.
for development purposes, in my_app Gemfile, I simply include my_engine with the following line using: file key.
#my_app/Gemfile ... gem "my_engine", :path => "./../my_engine" ...
and my_engine structure is as follows:
. βββ Gemfile βββ Gemfile.lock βββ app β βββ ... | |... | βββ config β βββ locales β β βββ models β β βββ products β β βββ en.yml β β βββ zh-TW.yml β βββ routes.rb βββ lib β βββ my_engine β β βββ engine.rb β β βββ version.rb β βββ my_engine.rb β βββ tasks β βββ my_engine_tasks.rake
And I found that although I am trying to check the I18n.load_path in my_app, there is no waypoint to my_engine, which means that my_app is not loading my_engine locale transactions.
>>rails console Loading development environment (Rails 4.0.2) 2.1.0 :001 >I18n.load_path.each { |x| puts x }
Are you missing any configuration or some important steps for loading locales in my_engine?
ruby ruby-on-rails-4 rails-engines
Simon iong
source share