ruby on rails - How to get I18n subtree entries? -
ruby on rails - How to get I18n subtree entries? -
using rails 3.0.9 ruby 1.9.2.
i have create list of places (which contains accents , non standard letters) fill select box.
using helper doesn't work (already searched it), next error:
invalid multibyte char (us-ascii)
it apparently has ruby , not rails.
i read best solution set list in translation file, , did, can't retrieve list.
before, had:
def madrid_area_array [ "chapinería", "ciempozuelos", "cobeña", ] end
now, have in .yml:
places: spain: madrid: chapin: "chapinería" ciempo: "ciempozuelos" cobena: "cobeña"
when used helper (in case wonders, symbols í literally written in select drop boxes, don't 'í'), phone call madrid_area_array fill select menu. now, can't phone call translation file, , have create intermediate helper translations:
def madrid_area_array [ t(:chapin, :scope => "spain.madrid", :locale => "places"), t(:ciempo, :scope => "spain.madrid", :locale => "places"), t(:cobena, :scope => "spain.madrid", :locale => "places") ] end
is there way entries translation subtree? like:
t(*, :scope => "spain.madrid", :locale => "places")
ruby-on-rails internationalization
Comments
Post a Comment