ruby - Rails: translation file not working -
i have translate majority of application working on dutch. created du.yml file , formatting in same way en.yml file formatted (to sure):
en: hello: "hello world"
when outputting en.yml application populates text properly. when load du.yml gives me translation not found span wrap around desired translated material.
the steps have taken set follows -
added application_controller.rb
:
before_filter :set_locale def set_locale i18n.locale = params[:lang] if params[:lang].present? end
this allows me pass param in query-string determine language use.
i did shown top , added values translated on both en.yml , du.yml files
i call values respective files (for example) <%= t :hello %>
. when set english param (?lang=en
), works great. however, when put ?lang=du
, mentioned before - dreaded span tag of missing translation.
any ideas on may have done wrong? thanks!
oh yeah..and both files in same directory (config/locales)
learned that, although rails development allows make changes on fly, file additions require server re-load. house9 clarification.
Comments
Post a Comment