c975l / xliff-bundle
This bundle exports the content of a database table in xlf files
Fund package maintenance!
Patreon
Open Collective
buymeacoff.ee/laurentmarquet
Installs: 200
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
Requires (Dev)
- dev-master
- v3.0
- 2.x-dev
- v2.4.2
- v2.4.1
- v2.4
- v2.3.1.1
- v2.3.1
- v2.3
- v2.2.1
- v2.2
- v2.1.1
- v2.1
- v2.0
- 1.x-dev
- v1.5.1.1
- v1.5.1
- v1.5
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4.1
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4
- v1.3.1
- v1.3
- v1.2.1
- v1.2
- v1.1
- v1.0
- v0.7.2
- v0.7.1.1
- v0.7.1
- v0.7
- v0.6.2
- v0.6.1
- v0.6
- v0.5
- v0.4.2
- v0.4.1
- v0.4
- v0.3.2
- v0.3.1
- v0.3
- v0.2.1
- v0.2
- v0.1.3
- dev-dev
This package is auto-updated.
Last update: 2024-10-22 18:20:45 UTC
README
XliffBundle does the following:
- exports xlf files from a database, where columns are languages, to be used as translation files in Symfony (or other).
XliffBundle dedicated web page.
XliffBundle API documentation.
Bundle installation
Step 1: Download the Bundle
Use Composer to install the library
composer require-dev c975l/xliff-bundle
We strongly recommend to use this only on the dev part
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php
file of your project:
<?php class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... ]; if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { // ... $bundles[] = new c975L\XliffBundle\c975LXliffBundle(); } } }
Step 3: Enable the Routes
Then, enable the routes by adding them to the app/config/routing_dev.yml
file of your project:
// app/config/routing_dev.yml c975_l_xliff: resource: "@c975LXliffBundle/Controller/" type: annotation prefix: /
Step 5: Create MySql table
You can use php bin/console make:migration
to create the migration file as documented in Symfony's Doctrine docs OR use /Resources/sql/translations.sql
to create the table translations
. The DROP TABLE
is commented to avoid dropping by mistake.
Step 4: Define languages to be exported
v2.0+ of c975LXliffBundle uses c975L/ConfigBundle to manage configuration parameters. Use the Route "/xliff/config" with the proper user role to modify them.
Upgrading from v1.x? Check UPGRADE.md.
How to use
Call your localhost with /xliff/create
, this will run the bundle and create the xlf files.
Please note that the missing translations in a language will be replaced by the source language between brackets. This will break the ability to see from Symfony's toolbar the missing translations, but as we rely on the database, we'll still be able to know what are the missing texts.
If this project help you to reduce time to develop, you can sponsor me via the "Sponsor" button at the top :)