Translation module for PrestaShop.
This command allows you to export theme translations in XLIFF format and automatically copy them to the theme's translations/ directory.
It performs the same operations as the administration interface:
- Generates XLIFF files from templates, existing translations, and the database
- Creates a ZIP archive
- Extracts the archive
- Copies XLIFF files to the theme's
translations/directory - Cleans up temporary files
php bin/console prestashop:translations:export-theme <theme> <iso_code>theme: Theme name (directory name inthemes/)iso_code: Language ISO code (e.g., fr, en, es)
# Export French translations for the yourtheme theme
php bin/console prestashop:translations:export-theme yourtheme fr
# Export English translations
php bin/console prestashop:translations:export-theme yourtheme enXLIFF files will be copied to themes/<theme>/translations/<locale>/:
themes/yourtheme/translations/fr-FR/ShopThemeYourtheme.fr-FR.xlfthemes/yourtheme/translations/fr-FR/ShopThemeActions.fr-FR.xlfthemes/yourtheme/translations/fr-FR/ShopThemeCheckout.fr-FR.xlf- etc.
Note: This command uses exactly the same process as the administration interface (route /prestashop/improve/international/translations/export), ensuring full compatibility with manual exports.
These files can then be versioned with the theme to distribute translations.
This command allows you to import theme translations from XLIFF files to the database.
It performs the same operations as the administration interface:
- Finds and parses XLIFF files in the theme's
translations/directory - Parses each XLIFF file using Symfony's XliffFileLoader
- Extracts the domain from the filename (e.g., ShopThemeGlobal.fr-FR.xlf → ShopThemeGlobal)
- Saves each translation to the database with the theme name
- Updates existing translations or creates new ones as needed
php bin/console prestashop:translations:import-theme <theme> <iso_code>theme: Theme name (directory name inthemes/)iso_code: Language ISO code (e.g., fr, en, es)
# Import French translations for the yourtheme theme
php bin/console prestashop:translations:import-theme yourtheme fr
# Import English translations
php bin/console prestashop:translations:import-theme yourtheme enTranslations will be imported into the database with the theme name.