wp-transaltions / t15s-registry
允许从T15S加载翻译文件
dev-master / 2.0.x-dev
2020-05-28 20:48 UTC
Requires
- php: >=7.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-29 05:21:57 UTC
README
允许从TranslationsPress加载翻译文件。
安装
如果您使用Composer管理依赖项,可以使用以下命令将插件添加到您的站点:
composer require wp-transaltions/t15s-registry
之后,您可以在主题或插件中使用\WP_Translations\T15S_Registry\add_project( $type, $slug, $api_url )
。
参数
$type
:可以是plugin
或theme
。$slug
:必须匹配主题/插件目录的缩写名。$api_url
:TranslationsPress翻译API URL。
注意:在多站安装中,建议将其用于必需的插件中。
使用方法
以下是如何使用该函数的示例:
\WP_Translations\T15S_Registry\add_project( 'plugin', 'example-plugin', 'https://translationspress.com/translate/api/translations/acme/acme-plugin/' ); \WP_Translations\T15S_Registry\add_project( 'theme', 'example-theme', 'https://translationspress.com/translate/api/translations/acme/acme-theme/' );