The OneSkyBundle offers integration of OneSky Client for common tasks like pulling and pushing translations.
OneSky is a plateform that provides translations management.
This bundle can be installed using composer:
composer require openclassrooms/onesky-bundle
or by adding the package to the composer.json file directly:
{
"require": {
"openclassrooms/onesky-bundle": "*"
}
}
After the package has been installed, add the bundle to the AppKernel.php file:
// in AppKernel::registerBundles()
$bundles = array(
// ...
new OpenClassrooms\Bundle\OneSkyBundle\OpenClassroomsOneSkyBundle(),
// ...
);
# app/config/config.yml
openclassrooms_onesky:
api_key: %onesky.api_key%
api_secret: %onesky.api_secret%
project_id: %onesky.project_id%
source_locale: %source_locale% #optional, default en
locales:
- fr
- es
file_format: %onesky.file_format% #optional, default xliff
file_paths:
- %path.to.translations.files.directory%
keep_all_strings: false # default true
Pull the translations from the OneSky API using the default configuration.
php app/console openclassrooms:one-sky:pull
filePath source can be set as an option.
php app/console openclassrooms:one-sky:pull --filePath=/path/to/source/files
php app/console openclassrooms:one-sky:pull --filePath=/path/to/source/files --filePath=/path/to/another/source/file
Locale can be set as an option.
php app/console openclassrooms:one-sky:pull --locale=fr
php app/console openclassrooms:one-sky:pull --locale=fr --locale=es
Push the translations from the OneSky API using the default configuration.
php app/console openclassrooms:one-sky:push
filePath source can be set as an option.
php app/console openclassrooms:one-sky:push --filePath=/path/to/source/files
php app/console openclassrooms:one-sky:push --filePath=/path/to/source/files --filePath=/path/to/another/source/file
Locale can be set as an option.
php app/console openclassrooms:one-sky:push --locale=en
php app/console openclassrooms:one-sky:push --locale=en --locale=fr
Pull then push translations from the OneSky API using the default configuration.
php app/console openclassrooms:one-sky:update
Check the translation progress from the OneSky API using the default configuration.
php app/console openclassrooms:one-sky:check-translation-progress
Locale can be set as an option.
php app/console openclassrooms:one-sky:check-translation-progress --locale=en
php app/console openclassrooms:one-sky:check-translation-progress --locale=en --locale=fr