I have as usual my translation files in locales.
Now I have an invitation mail in various languages.
I want the user to select in what language the mail should be sent, because it's not about the language of the operating user, it's about the language the mail receiver should read.
Is there a way to tell rails explicitly what language to pick, like t(:my_string, :en)
?
The goal is, to have it temporary translated for only one single call of t
.
This is what I need, to tell within the t()
command, what language is to be used.
Things which are understood by the speaker and hearers (or writer and readers), and are part of the meaning of the text, but which are not actually stated in words in the communication are implicit.
Translation is the process of reworking text from one language into another to maintain the original message and communication.
Definition of target language 1 : a language into which another language is to be translated — compare source language. 2 : a language other than one's native language that is being learned.
It's possible to pass :locale
option to t
method:
t :my_string, locale: :de
I think you will explicitly need to set proper language to I18n.
You can use: I18n.locale = :en
to set language you need.
Also look here: I18n
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With