How to create a language package in Magento?

How to create a language package in Magento?

To create a language package, you must perform the tasks discussed in the following sections: Collect and translate words and phrases. (The –magento parameter is required.) Run the language package command. Create directories and files. (Optional.) Configure multiple packages for a language.

How to package dictionaries in a language package?

You can package the translation dictionaries into a language package and provide the package to the Magento store administrator. In the Magento Admin, the store administrator configures the translations. The following table explains this command’s parameters and values: Required?

How to create a dictionary in Magento 2?

To begin translating, use a command to generate a dictionary .csv file with a collected list of all existing phrases and words. Generate the dictionary and translate: Extract translatable words and phrases from enabled components using the translation collection command. Content extracts into a .csv file.

Can You translate a PHP file in Magento?

Path to a directory that has translatable code; in other words, PHP, PHTML, or XML files that have phrases to translate. The tool starts searching at the path you enter and searches all files and subdirectories it contains. Do not use this parameter if you use -m –magento. Yes (dictionaries), no (packages).

How to merge multiple translations in Magento 2?

Merging overrides any phrases that existed and adds new ones. Values: merge or replace (default). Include this option to allow duplicates in the language pack. Otherwise, the command fails with an error if it encounters the same phrase in multiple entries with different translations.

How does language inheritance work in Magento 2?

Language inheritance enables you to create a new translation called a child based on an existing translation called a parent. The child translations override the parent. However, if the child translation fails to upload or display or is missing a phrase or word, Magento uses the parent locale.

How to create a translation dictionary in Magento?

Join us and other contributors around the globe working to localize Magento! You can generate a translation dictionary to customize existing strings, translate words and phrases in a custom module, localize a theme, or create language packages.

How to create a.csv file in Magento?

Use bin/magento i18n:collect-phrases to create the .csv file then create the language package as discussed in Create directories and files. ISO 639-1 (language) and ISO 3166 (country) identifier of language used as file name for all resulting .csv files.