aeyoll/ps_translation
Composer 安装命令:
composer require aeyoll/ps_translation
包简介
Translation module for PrestaShop
README 文档
README
Translation module for PrestaShop.
CLI Commands
Export Theme Translations
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
Usage
php bin/console prestashop:translations:export-theme <theme> <iso_code>
Arguments
theme: Theme name (directory name inthemes/)iso_code: Language ISO code (e.g., fr, en, es)
Examples
# 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 en
Result
XLIFF 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.
Import Theme 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
Usage
php bin/console prestashop:translations:import-theme <theme> <iso_code>
Arguments
theme: Theme name (directory name inthemes/)iso_code: Language ISO code (e.g., fr, en, es)
Examples
# 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 en
Result
Translations will be imported into the database with the theme name.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AFL-3.0
- 更新时间: 2026-02-11