Skip to content

Symfony Bundle that provides utility commands for the OneSky Api

License

Notifications You must be signed in to change notification settings

OpenClassrooms/OneSkyBundle

Repository files navigation

OneSkyBundle

Build Status SensioLabsInsight Coverage Status

The OneSkyBundle offers integration of OneSky Client for common tasks like pulling and pushing translations.
OneSky is a plateform that provides translations management.

Installation

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(),
    // ...
);

Configuration

# 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
    

Usage

Pull

Pull the translations from the OneSky API using the default configuration.

php app/console openclassrooms:one-sky:pull

Options

filePath

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

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

Push the translations from the OneSky API using the default configuration.

php app/console openclassrooms:one-sky:push

Options

filePath

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

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

Update

Pull then push translations from the OneSky API using the default configuration.

php app/console openclassrooms:one-sky:update

Check translation progress

Check the translation progress from the OneSky API using the default configuration.

php app/console openclassrooms:one-sky:check-translation-progress

Options

locale

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

About

Symfony Bundle that provides utility commands for the OneSky Api

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages