Currently, most scientific community publishing is very helpful with the existence of the OJS system that allows multiple languages in article publishing. OJS in their default installation provides language in more than 37 language packs. However, we have heard our client that comes from the region that is not using that language ask us for an article on how to add the new language or locale on OJS that is not available on the current OJS option.
Did you know that the number of languages in the world is more than 7,100 recorded as known languages in world?
How to install available language in OJS? #
Before jumping to the process of installation of the new locale language of OJS, the first step is knowing about installing the available language or showing what language packs are provided by OJS.
What languages or locales are supported by OJS? #
On the latest version of OJS 3.3 this is the list of the locales that are supported by OJS.
- Bosanski
- Català
- Čeština
- Dansk
- ελληνικά
- Euskara
- Suomi
- Français (Canada)
- Scottish Gaelic
- עברית
- Hindi
- Hrvatski
- Magyar
- Armenian
- Bahasa Indonesia
- 日本語
- 한국어
- македонскијазик
- NorskBokmål
- Nederlands
- JęzykPolski
- Português (Brasil)
- Português (Portugal)
- LimbaRomână
- Русский
- Slovenčina
- Slovenščina
- Cрпски
- Srpski
- Svenska
- Türkçe
- Українська
- TiếngViệt
- 简体中文
- العربية
- فارسی
- کوردی
The list may get updated as the OJS always update or add a new language pack or locale for their new version.
The list may also differ from the version of your OJS installation. In conclusion, the lower the version of the OJS the less locale that is available. To check what language is available on your OJS, please continue in the later section of this article.
How to install the available locale on the OJS? #
Install new locale by administrator #
To install the new locale that is supported by OJS as you can see on the above list, you can follow this guide :
1. log in as administrator of your OJS (the journal manager does not have access to install the new locale).
2. In the backend system of OJS, click the Administration menu and click the “Site Settings“
3. The page in the “Site Settings” will show a list of menus then click the “Language” menu on the left sidebar
A list of the language will pop up on your screen. For example (image is cropped) as this below image:
Activate the new locale by the Journal Manager #
After the “administrator” has installed the locale on the OJS, therefore, The Journal Manager can install it on their journal the locale. It means that activating the new locale only affects the journal that is managed by the journal manager.
Here is the step to activate the new locale on the journal manager :
1. log in to the journal as “journal manager”
2. Access this menu
Then you can click the tab “Setup” and choose the “Language” sidebar
When you check the “Primary Locale” radio input, it means that your journal will use the selected language as the default language for your site which will affect both the frontend and the backend of your journal.
For the checkbox input, you can pick which feature of OJS will use the selected language based on the user preference.
If you find some of the incorrect lines that started and end with ## characters on any of the language lines such as ##default.genres.article##, either in the front end of the journal or the backend of the journal you can make any corrections to the right translation by following this article :
How to fix translation on OJS 3? here
Showing the Sidebar menu for the language selection #
Although you have activated the new locale as the journal manager, you should continue the activity by showing a sidebar block that will show language selection for your journal. This section will explain the required step to show the language selection.
1. Activate the Language Block on your OJS
2. Refresh the page, then you can manage the order of Language Toggle Block
Again, access the Website menu and click the Appearance tab, go to Setup on the left menu
Advantages of using multiple locales #
If your journal will use multiple languages on the journal. It surely has many advantages. These what on our mind :
- Reach more audience since not all the visitors or authors use the English natively and they felt more comfortable using their mother tongue language.
- Improve searchability in the search engine for some users that use the search string on the search engine.
Disadvantages of using multiple languages in your Journal #
Adding the new locale in your OJS is very easy. However, don’t be persuaded to add more and more locales if you have limited staff for your journal since it makes take more effort to provide content based on the preferred language. These are some of the lists that you may take into consideration before adding a new locale for your journal.
- More work is required because when you decide to use multiple languages, all the menus, and custom block managers should be provided with the appropriate content in that multiple languages.
- Failed of adding the appropriate content, may affect the indexing as the indexing requirement for example from DOAJ they make the consistency of the content in multiple languages should be provided without any mixed language.
Add New Locale Language for OJS 3.4 #
In OJS 3.4 there is a change in the code structure, so that when we want to add a new language we have to edit it directly via locale.po. Please see the following tutorial.
Duplicate English (en) locale folder #
1. Please go to the directory yourOJS/locale
2. Then you will find various language folders available like this image
3. To make it easier for you to translate languages, please duplicate the “en” folder as shown in the image below. This locale folder contains English and will be translated according to the language you mean.
Rename locale folder based on language code #
1. Then rename the folder according to the language code provided. For example, if we want to change the language to Uzbek, rename the “en” folder to “uz”.
Note: to rename the folder according to the available language code, please look for the language code you mean in this link
http://fbdevwiki.com/wiki/Locales
2. Below is a folder that has been renamed to uz. Please click on the folder.
Edit the locale.po file #
1. After you click on the folder, please find and edit the locale.po file
2. In locale.po, please edit and translate each sentence in the msgstr section.
Note: you must translate all sentences contained in the msgstr section in the locale.po folder and do not change the msgid
For example, in one of the sentences I changed it to Uzbek, the change was as follows
3. After you have finished translating all the sentences in the msgstr section, please click save.
Copy and paste the folder into directory yourOJS/lib/pkp/locale #
1. Then you need to copy the uz folder and copy it to the directory yourOJS/lib/pkp/locale
Delete OJS Data Caches and Template Caches #
Once finished, please log in using OJS admin and click administration then delete cache data and delete cache template. This cache needs to be cleared to ensure that the data displayed is data based on the latest changes that have been made.
For more detailed information on how to clear the cache in OJS, please visit the article below.
How to clear the OJS cache?
Install and Activate New Locale Language #
1. Then please click Administration > Site Settings
2. Then click Language > Install Locale
3. Then check the language code that we entered earlier. Based on this experiment, I entered the Uzbek language with the code uz, then the language options that appeared were as shown in the following image
Activate the language by ticking the box and clicking save.
4. Then the language you selected appears in a menu like this.
5. To be able to display this language, please go to your journal dashboard and click on the Website Settings > Setup > Languages.
You can set the language as the main language, or only appear in certain sections, for example in the UI (User Interface), Forms, or Submissions section.
6. Then, so that visitors can choose the language options that appear on the front page of the journal, please activate the Language Toogle Block, namely in the Website Settings > Appearance > Setup menu. Then click save.
7. The following is an example of the language options that appear on the front page of the journal that we added earlier.
8. Finished.
There are other alternative ways for fixing the translation that can be found here :
How to fix translation on OJS?
Conclusion #
The article explains in detail steps on installing the new locale on the OJS. This also covers the advantage and disadvantages of using multiple locales on the OJS. We also provide an article that explains fixing some incorrect article translation by OJS since many locale files is incomplete and in many cases need intervention by the journal manager to do manual/fix the translation.