statikbe/craft-translate
Composer 安装命令:
composer require statikbe/craft-translate
包简介
Translate static string from the Craft control panel
README 文档
README
Translate static string from the Craft control panel
Requirements
This plugin requires Craft CMS 4.0.0 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project -
Then tell Composer to load the plugin:
composer require statikbe/craft-translate -
In the Control Panel, go to Settings → Plugins and click the “Install” button for Translate.
Plugin & module translations
From version 1.3.0 onwards, translations for plugins and modules can now be saved in your site as well.
This can be done by adding the following event to your plugin file:
use statikbe\translate\elements\Translate; use statikbe\translate\events\RegisterPluginTranslationEvent; Event::on( Translate::class, Translate::EVENT_REGISTER_PLUGIN_TRANSLATION, function (RegisterPluginTranslationEvent $event) { $event->plugins['plugin-handle'] = \Craft::$app->getPlugins()->getPlugin('plugin-handle'); } );
Translations for the plugin will then be saved in site\translations\locale\plugin-handle.php
Brought to you by Statik, heavily inspired by boboldehampsink/translate.
统计信息
- 总下载量: 24.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-20