purjus/loco-importer-bundle

从localise.biz(loco)导入翻译

安装次数3,404

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 5

分支: 0

开放问题: 0

类型:symfony-bundle

1.0.8 2020-02-04 06:40 UTC

This package is auto-updated.

Last update: 2024-09-04 17:20:47 UTC


README

步骤 1:下载 Bundle

打开命令行,进入您的项目目录并执行以下命令以下载此 Bundle 的最新稳定版本

$ composer require purjus/loco-importer-bundle

此命令要求您全局安装 Composer,如 Composer 文档的 安装章节 中所述。

步骤 2:启用 Bundle

然后,通过将其添加到项目 app/AppKernel.php 文件中注册的 Bundle 列表中来启用此 Bundle

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new Purjus\LocoImporterBundle\PurjusLocoImporterBundle(),
        ];

        // ...
    }

    // ...
}

步骤 3:配置 Bundle

然后,通过将以下配置添加到非 flex 应用程序的 app/config/config.yml 或 flex 应用的 config/packages/purjus_loco_importer.yaml 中来配置此 Bundle

purjus_loco_importer:
    projects:
        my_project_name:
            key: '<localise.biz API Key>'
            file: 'translations/messages' # path to the file, relative to project root, without locale nor extension. Here, the imported files will go to "translations/messages.<locale>.yaml"
            format: 'symfony' # default. Can be : symfony | zend | codeigniter | constants | chrome | nested | rails | java | tizen | jed | gettext | ng-gettext | xcode | script | yml (see https://localise.biz/api/docs/export/exportlocale)

使用

要导入项目的翻译,请使用以下命令: bin/console purjus:loco:import