markocupic/contao-php2xliff

Create XLIFF files from contao php language files

Installs: 137

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 1

Open Issues: 0

Type:contao-bundle

1.1.2 2023-04-08 09:13 UTC

This package is auto-updated.

Last update: 2024-04-08 11:05:43 UTC


README

logo.png

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.

Backend Backend

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

Transifex Push Documentation

Pull

Pull source and translation files (force overriding): tx pull -s -f

Pull translation files only (force overriding): tx pull -t -f

Transifex Pull Documentation