Get the Silo (static translations) of another language?

Let’s say I would like to use the l::get()-function on a language that is not active at the moment.

Is it possible to get the string value?

Maybe there should be a kind of wrapper to accept a language code as optional third parameter?

The l class works basically in the exact same way as the c class. It won’t load the languages by itself, so you only have access to the current language.

1 Like

Thank you for your response.

Maybe I should mention a useful case for this as a suggestion. When building a language switcher, such function could be used to add translated information to the link, like: “this page is (not) available in your language” in the target language.

I am going to create my own helper class to handle it now. But this will result in two “translation pools” which I find a bit ugly.

Just an idea: Instead of adding this piece of information, you could either hide the link for non-available languages or deactivate it.

Hi texnixe,

Thanks for your response.

The users would then have to find a translated page before switching to their language. I would prefer to offer a link to a search page combined with the information that the current page is not available in their language.

I could send them directly to the search page though. But this is not what users expect when switching languages.