3

Based on this tutorial, I tried to create a template specific language override, trying to be able to override any module or component. Basically, the idea is:

  1. Create a file called JOOMLA/templates/MYTEMPLATE/language/en-GB/en-GB.custom.ini
  2. Add this to the template index.php file:

    $language = JFactory::getLanguage();
    $language->load('custom' , dirname(__FILE__), $language->getTag(), true);
    

This works, and the language file is loaded, BUT it seems to be loaded before any extension-specific language file, making it impossible to override e.g. mod_login.

Is there any other way to do this, or some way to force the language file to be loaded last?

2

You can create general Language Overrides in Joomla backend, Extensions/Language Manager: Language Overrides.

You can search for a string to be translated and define a new value. Even, if it is not found (but you know the label), then you can just create a new Override.

This tool is a simple way to create general language files in language/overrides.

TIP: You can even create overrides for default language labels. For example: language/overrides/en-GB.override.ini

COM_CONTACT_EMAIL_FORM="<i class="_QQ_"fa fa-envelope"_QQ_"></i>"
COM_USERS_LOGIN_USERNAME_LABEL="Email"
  • Thank you, I'm aware of that option, and it's very effective. But I was rather looking for a way to include a language override in my template, similar to layout overrides, so that when a user installs the template the string is overridden. – johanpw Apr 17 '15 at 14:25
  • In opinion, you have to create a System Plugin to load the language file in a different moment. Most templates implement a System Plugin to have full control. – Anibal Apr 17 '15 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.