Page 1 of 1

Language library not switching on multi-language site

Posted: Sun Sep 14, 2014 11:30 pm
by ImageMagician1
I've created a multi-language site and the language switcher seems to be working. The only problem is that the language library isn't switching. I'm trying to have the Russian library show up, but the English translations still show up.

My Russian pages with Russian content do come through, it's just the library translations that don't.

Re: Language library not switching on multi-language site

Posted: Mon Sep 15, 2014 2:51 am
by imanickam
Could you please explain what you mean by library translation?

What is your site's URL so that others can see the behavior and offer suggestions?

Make sure that the objects such as menu items, articles, and categories are assigned to respective languages. Also, make sure that the objects are associated with other languages.

Re: Language library not switching on multi-language site

Posted: Mon Sep 15, 2014 3:19 am
by ImageMagician1
What I mean is the definitions in the language libraries, such as en-GB vs ru-RU. The constants and definitions such as MOD_LOGIN="Login".

I have verified all the things you mention in your reply except I am unsure of what you mean by "objects are associated with other languages". I have identical constants in the each language in the exact same file. Is that what you mean?

The site in question can be viewed here: http://72.32.35.129/joomla/

Re: Language library not switching on multi-language site

Posted: Mon Sep 15, 2014 3:28 am
by ImageMagician1
Oh, actually I do know what you mean by associating with the other language. Yes, I've done all that. Again, my pages and menus operate exactly how I want them to. It's the constants that don't change between the languages.

Re: Language library not switching on multi-language site

Posted: Mon Sep 15, 2014 4:08 am
by ImageMagician1
For instance, if I switch from English to Russian, the English translations are still the ones that show up.

Re: Language library not switching on multi-language site

Posted: Mon Sep 15, 2014 5:03 am
by imanickam
If you are referring to the login module that shows up when you click on the link "Sign up or Log in", it could be because the corresponding module does not have the Russian language strings. As the module seems to be not the core module, mod_login, you have to track down the code of this module. If the text strings in the module are driven by language strings then you could create the overriding language strings in the Language Manager.

Try the following:
- Go to the Global Configuration
- In the tab System, for the options "Debug System" and "Debug Language" choose the value Yes.

With the above settings you could see the list of untranslated strings when you view the site.

Re: Language library not switching on multi-language site

Posted: Mon Sep 15, 2014 5:16 am
by ImageMagician1
I'm not talking about the login module specifically. That was just an example so you understood I was talking about the constants and definitions.

NONE of the constants in any of the Russian language files are coming through with the Russian translation. This includes core and non-core files. They ALL show up with the English definition regardless of whether I choose English or Russian.

Re: Language library not switching on multi-language site

Posted: Mon Sep 15, 2014 5:42 am
by ImageMagician1
I've done what you've suggested. There are no errors.

Also, to reiterate, I'm not seeing the constants that haven't been parsed or defined. I always see the English definition even if Russian is selected. It's strange.

I've left debugging on so you can see the output. When I switch to Russian, I can tell that some of the Russian .ini files are not loading and their counterpart English .ini file IS being loaded. I don't understand why the English file would load if I've selected Russian. Would it do that if there is a problem with the Russian file?

Re: Language library not switching on multi-language site

Posted: Tue Sep 16, 2014 2:13 am
by ImageMagician1
Any other thoughts on this? Why wouldn't the constants/definitions change with the multilanguage switch?

Re: Language library not switching on multi-language site

Posted: Tue Sep 23, 2014 1:34 am
by iextensions
- enable plugin language in plugin manager
- create content for all languages

Re: Language library not switching on multi-language site

Posted: Tue Sep 23, 2014 2:23 pm
by ImageMagician1
Thank you, however as I explained at the beginning, this wasn't my problem. All of that was setup correctly and was running fine. It was the constants in the language libraries that were not loading, specifically my custom language files for my component.

I was able to add language support to my index.php file by using getLanguage(). Then I switched the prefix based on the language loaded. Here is the code I used:

Code: Select all

	$lang = JFactory::getLanguage();
	if ($lang->getName() == 'Russian') {
		$lang_type = 'ru-RU';
	} else {
		$lang_type = 'en-GB';
	}
	$lang->load('<filename>', JPATH_SITE, $lang_type, true);
It works fine, but I don't know if this is the most elegant way of doing it. If someone has a better suggestion, please let me know.

Re: Language library not switching on multi-language site

Posted: Wed Sep 24, 2014 6:34 am
by infograf768
As you said above: "Some" of the Russian files are loading and not others.
This means, if the files concerned are those of your custom component, that the error comes from the component itself.
(I could not see the debug as you took it off)