You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although I have no idea to do it yet, it would be nice to be able to get translations for a document without having to call TAPi18n.setLanguage().
A use case for this is the admin panel, where users will input the translations. I currently do this with tabs, switching the language on click, but as a result the whole interface switches language as well. This is not necessarily unwanted, but there’s no way to prevent it if it is. Moreover, if say you wanted to present an <input> fields for each language all in the same form, there’s no way to get the current values AFAIK besides going into the i18n property yourself.
Possible solutions (that I can think of):
Add a way to pass a language parameter when fetching the document
Have a setLanguage() method on each collection, which’ll override the global current language value
Add a getTranslations() method to the collection, to get a key in a defined language (I could then wrap that in a minimongoid method)
I think the last option would be the best, as it’s the only one which’ll also support the use case of displaying multiple languages at the same time.
The text was updated successfully, but these errors were encountered:
I would be very interested in a way to get a translation of a document without changing the language. My use case is the same: A translation interface where you can view the original text next to the fields to input the translated text.
I will try doing what @rijk did with the tabs in the meantime.
Although I have no idea to do it yet, it would be nice to be able to get translations for a document without having to call
TAPi18n.setLanguage()
.A use case for this is the admin panel, where users will input the translations. I currently do this with tabs, switching the language on click, but as a result the whole interface switches language as well. This is not necessarily unwanted, but there’s no way to prevent it if it is. Moreover, if say you wanted to present an
<input>
fields for each language all in the same form, there’s no way to get the current values AFAIK besides going into thei18n
property yourself.Possible solutions (that I can think of):
setLanguage()
method on each collection, which’ll override the global current language valuegetTranslations()
method to the collection, to get a key in a defined language (I could then wrap that in aminimongoid
method)I think the last option would be the best, as it’s the only one which’ll also support the use case of displaying multiple languages at the same time.
The text was updated successfully, but these errors were encountered: