Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/975l/xliffbundle
Generates the xlf files from database extraction
https://github.com/975l/xliffbundle
symfony symfony-bundle translation xliff
Last synced: 3 months ago
JSON representation
Generates the xlf files from database extraction
- Host: GitHub
- URL: https://github.com/975l/xliffbundle
- Owner: 975L
- License: mit
- Created: 2016-03-19T13:40:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-01-22T16:43:16.000Z (about 1 year ago)
- Last Synced: 2024-09-14T23:52:28.880Z (5 months ago)
- Topics: symfony, symfony-bundle, translation, xliff
- Language: PHP
- Homepage: https://975l.com/en/pages/xliff-bundle
- Size: 118 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# XliffBundle
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](https://975l.com/en/pages/xliff-bundle).
[XliffBundle API documentation](https://975l.com/apidoc/c975L/XliffBundle.html).
## Bundle installation
### Step 1: Download the Bundle
Use [Composer](https://getcomposer.org) to install the library
```bash
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
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:
```yml
// app/config/routing_dev.ymlc975_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](https://symfony.com/doc/current/doctrine.html) 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](https://github.com/975L/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](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 :)