Adding new translations or modifying existing ones.
4SEO is already available in 22 languages but that large list may not include your very own language. In addition, you may want to change a few or many language strings used by 4SEO to better fit your needs.
To that effect, adding new, or overriding existing translations is possible in several ways.
Types of translations
4SEO uses 2 types of translations files:
- Joomla standard
*.ini
files are used for a few strings, mostly when 4SEO is displayed in the Joomla extensions list or similar - Our own
*.json
language strings format, which is better suited for use in pure javacript application such as 4SEO and contains anything you see displayed in the 4SEO user interface
As overriding 4SEO language strings found in *.ini
is standard Joomla procedure, we won't talk about it anymore here. Please refer to Joomla own documentation for this.
The remaining of this page talks about modifying strings found in *.json
files only.
Here is an example of a *.json
(partial) content, from the common.json
file:
{
"base": {
"yes": "Yes",
"no": "No",
"ok": "OK",
"auto": "Auto",
"enabled": "Enabled",
"disabled": "Disabled",
"none": "None",
"details": "Details",
"required": "required",
"from": "From",
"to": "To",
"done": "Done!",
"reset": "Reset!",
"doNotChange": "Do not change",
"default": "Default",
"custom": "Custom"
},
"operators": {
"equals": "=",
"different": "Different",
"greater": "Greater",
"greaterEq": "Greater or =",
....
Source file location
All the JSON files released with 4SEO are found in this directory:
/plugins/system/forseo/vendor/weeblr/forseo/locales
Below this root directory, you'll see a series of subfolders, named with the corresponding language code:
/plugins/system/forseo/vendor/weeblr/forseo/locales/ar
/plugins/system/forseo/vendor/weeblr/forseo/locales/cs
/plugins/system/forseo/vendor/weeblr/forseo/locales/da
/plugins/system/forseo/vendor/weeblr/forseo/locales/de
/plugins/system/forseo/vendor/weeblr/forseo/locales/en
/plugins/system/forseo/vendor/weeblr/forseo/locales/es
....
In each folder, you'll see one or more json files such as:
admin.json
common.json
Source language
The source, official, strings are always the en
directory.
Do not modify any of the files directly
If you want to change translations found in these files, or add a new language, do not do that directly in the /plugins/system/forseo/vendor/weeblr/forseo/locales
directory.
Any change you make here will be deleted at next update.
Please read on to learn how to safely add your own translations.
Overriding existing translations
To make the process easier, 4SEO lets you change translations using 2 different methods:
Override translations with files
Very similar to how you can create template or layout overrides in your template, you can change existing translations by copying the source file in a given specific directory and modifying it there.
Let's look at 2 scenariis:
Change one or more strings
Assuming you want to change the French translation for base.yes
, the steps are:
- create a directory:
/libraries/weeblr/forseo/locales/fr/
- create a file called:
admin.json
- enter this content:
{
"base": {
"yes": "my french translation for Yes",
}
}
- save the file, that's all.
Pay attention to matching {
and }
characters exactly, else your override won't be taken into account.
Instead of creating the content of that file and adding a single override, you could also copy the entire source file and modify one or a few lines in that copy.
This works, but it not the best approach because it will prevent future improvement in our translation that we could do to work, as your overrides have priority. It's also slightly slower.
Add translation for a new language
This works exactly as the previous example except you put your translations in a new dedicated folder:
Assumning you want to add a translation for the Greek language, from Greece, which full language tag is: el-GR
, do the following:
- create one of these 2 directories:
/libraries/weeblr/forseo/locales/el-GR/
or
/libraries/weeblr/forseo/locales/el/
- copy the source file you want to translate from:
/plugins/system/forseo/vendor/weeblr/forseo/locales/en
- start translating this copy content
That's all!
You can have both el-GR
and el
directories, with different translations and content. If the Joomla site language is set exactly to el-GR
, the translations in that directory will have precedence.
If the site language is set to something else, for instance el-CY
, then your el-GR
translation won't be used but if you have one in el
, it will be used the same for el-GR
and el-CY
, as el
is the language "family" code.
The standard Joomla language strings override mechanism
You access it through System | Language Overrides in Joomla 4+, and it lets you define a new translation for a given string key.
- Using to override 4SEO language strings found in
*.ini
is standard Joomla procedure so, again, please refer to Joomla own documentation for this. - Using it to override 4SEO strings in
*.json
works nearly the same, except when building the string key.
Looking back at the example of a *.json
file, we can see a difference in how the keys are organized compared to Joomla *.ini
keys: 4SEO keys have 2 levels, whereas Joomla keys are always one level:
PLG_SYSTEM_FORSEO = "System - 4SEO"
PLG_SYSTEM_FORSEO_XML_DESCRIPTION = ""
PLG_SYSTEM_FORSEO_PRIVACY_CAPABILITIES = "4SEO does not store private personal information."
Keys used by Weeblr's applications are 2 levels, for instance:
base.yes
Therefore, to build the language strings to use on Joomla text override page, the key for our example must be built as follows:
COM_FORSEO_BASE__YES
Note there are 2 _
characters between "BASE" and "YES", this is what represents the secondary level.
Aside from this quirk in selecting the key, the rest of the process is the same as usual when overriding Joomla language strings.
4SEO translators credits
4SEO was translated in part by a group of Joomla! enthousiasts:
Danish
Ronny Buelund
I have been working with Joomla since version 1.x - I am maintaining the danish Joomla core translation, and translations for several small and big extensions. I have also developed several extensions for Joomla, eg a system for small schools to creta timetables for the students.
Dutch
Davy Renckens
Webdesigner / offiRent verhuur van maatschappelijke zetels en virtuele kantoren in België en Nederland.
- https://www.offirent.be
- https://twitter.com/offirent
- https://www.facebook.com/offiRentBE/
- https://www.instagram.com/Offirent/
- https://www.linkedin.com/company/offirent
French
Yannick Gaultier
German
Elisa Sophia Foltyn
Web Designer · Joomla Specialist
Italian
Guido Tedaldi
Lithuanian
Andrius Balsevičius
Surveyor with some IT background, loving my native Lithuanian language – one of the oldest spoken languages in the world.
- https://www.facebook.com/andrius.balsevicius
Russian
Алексей Хорошевский (Aleksej Khoroshevskij)
Since about 2008 to the present day, I have been developing websites on Joomla and WebSite X5. I have a blog about Joomla extensions and other software since 2010. I write blog posts myself. In addition, I post my own interfaces translations of various Joomla extensions in Russian and Ukrainian.
Spanish
Carlos Cámara
Web developer always interested in new projects
Polish
Marcin Równicki
I teach about JOOMLA, create websites and optimizes. I am familiar with topics such as SEO, social media and marketing.
- https://joomlaguru.pl
- https://www.youtube.com/channel/UCq-xEYXJlhi1j3xLSizkEHg
- https://www.facebook.com/joomlagurupl
- https://www.facebook.com/groups/345518026198456/
- https://www.linkedin.com/in/marcinrownicki/
Slovak
Lubos
Turkish
Mehmet Taş
Matematik Öğretmeni, Web Tasarımcısı