承接 raffaelj/cockpit-babel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

raffaelj/cockpit-babel

最新稳定版本:0.3.2

Composer 安装命令:

composer require raffaelj/cockpit-babel

包简介

Manage translations of Cockpit CMS v1 and v2 modules

README 文档

README

Manage translations of Cockpit CMS v1, Cockpit CMS v2 modules and Multiplane themes with a graphical user interface.

Usage

  • Login as admin (or with manage rights for babel)
  • Go to "Settings" --> "Babel"
  • If you use Cockpit CMS v1
    • Click on "Other" tab
    • Click on "Restructure i18n files" button. Now the Babel addon is initialized and the file/folder structure is adapted to new locations.
  • Translate strings and click the "Save" button

Config

<?php
return [
    'app.name' => 'My app',

    // set entry level languages in cockpit cms v1
    // use the gui instead to change locales in cockpit cms v2
    'i18n' => 'de',
    'languages' => [
        'default' => 'Deutsch',
        'fr' => 'Francais',
    ],

    // set admin ui languages
    'babel' => [
        'languages' => [
            'de' => 'Deutsch',
            'fr' => 'Francais',
        ],
    ],
];

Requirements

  • PHP >= 7.4

Concepts

Cockpit CMS v1

File/folder structure:

  • config/cockpit/i18n/{locale}.php
    • must exist for user language selection
  • wysiwyg field (tinymce): #pstorage:assets/cockpit/i18n/tinymce/{locale}.js
.
├── config
|   ├── cockpit
|   |   └── i18n
|   |       ├── de.php (must exist)
|   |       └── fr.php (must exist)
|   └── config.php
├── storage
|   └── assets
|       └── cockpit
|           └── i18n
|               └── tinymce
|                   ├── de.js
|                   └── fr.js

Cockpit CMS v2

File/folder structure:

  • config/i18n/App/{locale}.php
    • must exist for user language selection
    • must exist to load other module i18n files
  • wysiwyg field (tinymce): should be translatable via App.on('field-wysiwyg-init', function(opts) {opts.language_url = 'path/to/tinymce/locale.js';}); (not tested)
.
├── config
|   ├── i18n
|   |   ├── App
|   |   |   ├── de.php (must exist)
|   |   |   └── fr.php (must exist)
|   |   └── {module}
|   |       ├── de.php
|   |       └── fr.php
|   └── config.php
├── path/to/tinymce/{locale}.js (not tested)

Babel addon

I like the new folder structure of Cockpit v2 and adapted it in this addon.

File/folder structure:

.
├── config
|   ├── i18n
|   |   ├── {module}
|   |   |   ├── de.php
|   |   |   └── fr.php
|   |   ├── de.php (must exist - @meta and unassigned strings)
|   |   └── fr.php (must exist - @meta and unassigned strings)
|   └── config.php
├── storage/assets/cockpit/i18n/tinymce/{locale.js} (not automated, yet)

Installation

Copy this repository into /addons and name it Babel or use the cli.

via git

cd path/to/cockpit
git clone https://github.com/raffaelj/cockpit_Babel.git addons/Babel

via cp cli (Cockpit CMS v1)

cd path/to/cockpit
./cp install/addon --name Babel --url https://github.com/raffaelj/cockpit_Babel/archive/main.zip

via composer (Cockpit CMS v1)

Make sure, that the path to cockpit addons is defined in your projects' composer.json file.

{
    "name": "my/cockpit-project",
    "extra": {
        "installer-paths": {
            "addons/{$name}": ["type:cockpit-module"]
        }
    }
}
cd path/to/cockpit-root
composer create-project --ignore-platform-reqs aheinze/cockpit .
composer config extra.installer-paths.addons/{\$name} "type:cockpit-module"

composer require --ignore-platform-reqs raffaelj/cockpit-babel

Copyright and License

Copyright 2022 Raffael Jesche under the MIT license.

See LICENSE for more information.

统计信息

  • 总下载量: 29
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: Hack

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固