Welcome Guest, Not a member yet? Register   Sign In
loading multiple language files from different languages
#1

[eluser]stef25[/eluser]
I'm using the i18n Internationalization language library from here which does a good job providing alternate language links. Example: if the current page is domain.com/en/news it provides a link to domain.com/fr/news

But if I also wants "news" to be translated (so domain.com/fr/nouveautes), AFAIK I need another solution. I'd rather not store the translation of "news" in the DB but in a language file.

If my current page language is "en" (domain.com/en/news) then the strings_lang.php file is loaded from the "en" folder. It seems to be impossible to also load the strings_lang.php file from the "fr" folder to get the FR translation of "news".

For this particular project it's important for SEO reasons to have all segments in the URI translated. Is it possible to achieve this using language files?
#2

[eluser]tomcode[/eluser]
Yes, there is one way, You can load any language file into a variable, much like You can do it with a view :

Code:
$xxx_lang_strings_fr = $this->lang->load('xxx', 'french', true);

Now You have the strings available in the array.
#3

[eluser]Buso[/eluser]
[quote author="tomcode" date="1269309792"]Yes, there is one way, You can load any language file into a variable, much like You can do it with a view :

Code:
$xxx_lang_strings_fr = $this->lang->load('xxx', 'french', true);

Now You have the strings available in the array.[/quote]

that's amazing, how come it's not in the userguide?

thanks a lot
#4

[eluser]tomcode[/eluser]
Nobody's perfect ...




Theme © iAndrew 2016 - Forum software by © MyBB