Hi,
I’m new in RoR and I need to write an if in a view to show a different
video based in the current language.
How can I get the current chosen locale?
Thanks
Hi,
I’m new in RoR and I need to write an if in a view to show a different
video based in the current language.
How can I get the current chosen locale?
Thanks
Hi,
I18n.locale holds the current locale.
I guess all you want to do is have different url:s to the videos, based
on
locale, so alternatively you can put the url in the translations with a
translation key such as “video_url”. Then you won’t need the conditional
in
your view. Translation strings don’t have to be text shown to the user.
Thanks for the reply
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs