markocupic / contao-php2xliff
Create XLIFF files from contao php language files
Installs: 150
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:contao-bundle
Requires
- php: ^8.1
- codefog/contao-haste: ^5.0
- contao/core-bundle: ^4.12 || ^5.0
Requires (Dev)
- contao/easy-coding-standard: ^5.0
- contao/manager-plugin: ^2.3.1
- contao/test-case: ^4.6 || ^5.0
- phpunit/phpunit: ^9.3
- symfony/phpunit-bridge: ^5.4
README
Generate "XLIFF translation files" from "PHP array translation files"
This little handy Contao backend extension simply converts contao php translation files into their xliff (*.xlf) pendants. The newly generated files will be stored side by side to the already existing php files. Already existing *.xlf files will be overwritten.
Changing the source language
The source language for all Contao Core XLIFF files is English (en).
If you like to change this setting you have to do this in your project config in config/config.yml
.
# config/config.yml markocupic_contao_php2xliff: sourceLanguage: it # Switch the source language to Italian
Transifex hints
Install
Navigate to your project root. Then run:
git clone http://code.transifex.com/transifex-client
Navigate to newly created transifex-client directory and install transifex-client.
cd transifex-client
py setup.py install
Initialize and config
Navigate to the repository root e.g. cd vendor/vendorname/bundlename
Init transifex tx init
. Transifex will create a basic config file in vendor/vendorname/bundlename/.tx
Edit the config file and add entries for each translation file.
Use markocupic/contao-php2xliff
to generate xliff translation files from Contao PHP array translation files.
Push
Upload/Update source files (force overriding): tx push -s -f
Upload/Update translations files (force overriding): tx push -t -f
Or upload/update both (force overriding): tx push -s -t -f
Pull
Pull source and translation files (force overriding): tx pull -s -f
Pull translation files only (force overriding): tx pull -t -f