Most languages are available in Crowdin for translation, but not all are available in PrestaShop (International > Translations > Add a language). Indeed, because of a low completion level on Crowdin, we do not send the translations to PrestaShop. However, it can be smart to add a language if its translators are very active and want to see the results of their Crowdin translations quickly in their own shop. If the language is not available in Crowdin, you have to contact Louise Bonnard on Crowdin for opening a project in the concerned language. For that, it needs to be added as a new supported language in PrestaShop, and it takes two steps:
In PrestaShop, two JSON control the processing of languages:
The first one is used for listing languages supported by PrestaShop in back office. The second one is used for migrating locales from old versions to 1.7.
In this file, you need to add a new item in the JSON.
The key is the ISO Code, based on the ISO-639-1 standard (see an unofficial list here). The item is filled with key/values relative to the localization :
name
: Nameiso_code
: ISO code (2 characters)date_format_lite
: Date format (only date)date_format_full
: Date format (with hours & minutes)is_rtl
: Right to Left Languagelanguage_code
: Language codelocale
: ISO code (5 characters) : two-letter language code (ISO 639-1) and the two-letter country code (ISO 3166-1 alpha-2)This is a sample :
"da": {
"name": "Dansk (Danish)",
"iso_code": "da",
"date_format_lite": "Y-m-d",
"date_format_full": "Y-m-d H:i:s",
"is_rtl": "0",
"language_code": "da-dk",
"locale": "da-DK"
},
In this file, you need to add a key/value.
The key is the ISO code, based on the ISO-639-1 standard (see an unofficial list here). The value is the locale.
This is a sample :
"da": "da-DK",
Finally, we need to update i18n.prestashop.com. Why? Because this domain stores the translations files that are used on the International > Translations page of the back office, when adding or updating languages.
This web service update is controlled by the PrestaShop/TranslationFiles repository.
The list of available languages is controlled by the file available_languages.json
of the current version.
You must submit a PR in which you add a key/value:
This is a sample :
"da-DK": "Danish (Denmark)",
After the PR was merged, a nightly cron will fetch translations from Crowdin, update the repository with new updates, and deploy translations to i18n.prestashop.com.