How to override translation in Joomla 3 template?
Already followed the language installation and configuration instructions and still not reached an acceptable result? Perhaps the item that you want to overwrite is so-called language override!
I'll show you how to change it on the JM Commune Office template.
You may deal with two situations:
- You’re using a language other than English - then skip step 6.
- You’re using the default (English) language - then skip steps: 2, 3, 4, 5.
Step 1: choose item to override
This is the example of the template item name that we want to override. Let's check how to change the "night mode" inscription.
Step 2: set English language as default for testing
It's important that for testing you need to go to the backend of your site Extensions-> Languages-> Installed and set English language as default.
Step 3: get the constant name
Go to the Extensions-> Languages-> Overrides and click New.
Type in inputbox what you want to change (for example "night mode") and click search. It will appear the search results. Choose the one that you are looking for. Details of the language override constant should appear on the left. Copy the entire value of the "Language constant" field. The language constant is called: "PLG_SYSTEM_JMFRAMEWORK_CONFIG_NIGHT_VERSION_LABEL". Later we will need the copied value so don't lose it! Click cancel.
Step 4: ser Your language as default
Go to the Extensions-> Languages-> Installed and set your language as default.
Step 5: create new translation override
You may need to log off and log in again to the backend of your site. Then go to the Extensions-> Languages-> Overrides and click New (backend is in your selected language now).
Paste previously copied language contant into Language constant field "PLG_SYSTEM_JMFRAMEWORK_CONFIG_NIGHT_VERSION_LABEL". In "Text" type your translation. Click Save and close.
You made all changes. Site looks like that:
Step 6: create new language translation
Go to the backend of your site-> Extensions-> Languages-> Overrides and click New.
Type in inputbox what you want to change (for example "night mode") and click search. It will appear the search results. Choose the one that suits you. On the left should appear on the details of the language override. In “text” field type your override. Click save and close.
You made all changes. Site looks like that: