openclassrooms/onesky-bundle

One Sky Bundle

安装次数: 110,724

依赖项: 0

建议者: 0

安全: 0

星标: 7

关注者: 25

分支: 12

开放问题: 8

类型:symfony-bundle

v1.0.0 2016-06-29 12:49 UTC

This package is auto-updated.

Last update: 2024-09-06 23:07:27 UTC


README

Build Status SensioLabsInsight Coverage Status

OneSkyBundle 提供了 OneSky 客户端(OneSky Client)的集成,用于常见的任务,如拉取和推送翻译。
OneSky 是一个提供翻译管理的平台。

安装

可以使用 composer 安装此包

composer require openclassrooms/onesky-bundle

或者直接在 composer.json 文件中添加包

{
    "require": {
        "openclassrooms/onesky-bundle": "*"
    }
}

安装包后,将包添加到 AppKernel.php 文件中

// 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
    

使用方法

拉取

使用默认配置从 OneSky API 拉取翻译。

php app/console openclassrooms:one-sky:pull

选项

filePath

filePath 源可以设置为选项。

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

地区可以设置为选项。

php app/console openclassrooms:one-sky:pull --locale=fr
php app/console openclassrooms:one-sky:pull --locale=fr --locale=es

推送

使用默认配置从 OneSky API 推送翻译。

php app/console openclassrooms:one-sky:push

选项

filePath

filePath 源可以设置为选项。

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

地区可以设置为选项。

php app/console openclassrooms:one-sky:push --locale=en
php app/console openclassrooms:one-sky:push --locale=en --locale=fr

更新

使用默认配置从 OneSky API 拉取然后推送翻译。

php app/console openclassrooms:one-sky:update

检查翻译进度

使用默认配置从 OneSky API 检查翻译进度。

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

选项

locale

地区可以设置为选项。

php app/console openclassrooms:one-sky:check-translation-progress --locale=en
php app/console openclassrooms:one-sky:check-translation-progress --locale=en --locale=fr