wcm/wcm-lang-switch
Composer 安装命令:
composer require wcm/wcm-lang-switch
包简介
Adds a button to the admin toolbar. This buttons allows users to seamlessly switch between available languages..
README 文档
README
Contributors: Stephen Harris, Franz Josef Kaiser Tags: Language, switcher, localisation Tested up to: 4.1 Stable tag: 1.8.1 Requires at least: 3.6.1 License: GPL3 License URI: http://www.gnu.org/licenses/gpl-3.0.html
Adds a button to the admin toolbar. This buttons allows users to seamlessly switch between available languages.
Description
WCM Language Switcher adds a button to the admin toolbar that allows users to seamlessly switch between available languages.
WeCodeMore (WCM) is your label for high quality WordPress code from renowned authors.
If you want to get updates, just follow us on…
Installation
Extract the zip file and just drop the contents in the ~/wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
It scans the language directory to build the list of available languages. To add a language, simple download the appropriate mo file and add to your WordPress languages folder.
This plugin was originally built as a means of plugin and theme developers to test translations of their plugins or themes.
Frequently Asked Questions
Filters
If you want to extend the list of available languages, then please use the provided filter. Here's an example (mu)plugin:
<?php /* Plugin Name:** (WCM) Add additional languages */ add_filter( 'wcm_get_langs', 'wcm_add_languages' ); function wcm_add_languages( $languages ) { return array_merge( $languages, array( 'de_DE', // German 'es_ES', // Spanish 'ja', // Japanese ) ); }
Screenshots
Changelog
1.8.1
- Add github action to deploy plugin
1.8.0
- Fix hook for additional item inside the Admin Bar, #37
- Update screenshot, #25
- Test in Multisite, Network activation, #27
- Set code style in each line for PSR1-2
- See also on front-end, if Admin Bar is active fir the user, #32
1.7.6
- Fixes admin bar menu item on mobile
- Adds dashicon to admin bar
- Fixes some styling issues
1.7.5
- Removed legacy method.
- Removed empty lines to shorten file.
1.7.4
- Fixed wrong assumption about default language.
1.7.3
- Added support for composer.
1.7.2
- Removed deprecated
wcm_get_user_locale()from public API.
1.7.1
- PHP 5.2 work-around for json_last_error()
1.7
- Changes to feat. request/enhancement #18: Now shows the native string in the toolbar menu
- Removes the current language as menu item
- Adds the international/English language string + ISEO 639-2 code as HTML title attr. to the items.
- Switched from
$wp_admin_bar->add_menu()to the newer API methodadd_node().
1.6.6
- Improved dev tools. Now also counts the number of available ISO 639-2 language codes.
1.6.5
- Deprecated
wcm_get_user_locale()(replaced withwcm_get_user_lang()and tell users about it. - Improved code readability on
format_code_lang()
1.6.4
- Consistent naming according to GitHub issue #21
- Devlopers: The filter names changed as well as the public API function.
1.6.3
- Start earlier on
plugins_loadedhook to let other plugins jump in with the default priority.
1.6.2
- phpDocBlock fixes
- fixed references to static values so PhpStorm can handle them
- Slightly faster checks against NULL
- fixes
E_STRICTerror inreset()insideformat_lang_code(). Props toscho.
1.6
- Dev Tools extended and running stable. Now updating from the remote source works perfectly.
- Better file organisation. Moved JSON files to separate folder.
- Fixed (due to refactoring) broken JSON compress dev tools.
1.5
- Added local/native JSON strings data file.
- Extended the dev tools parser to include the native data for the JSON files that are used for the UI.
1.4
- Added remote location to fetch a complete list of ISO 639-x strings from.
- Added a parser to the dev tools.
1.3
- Added dev tools
1.2
- Bug fix: Now has right language string.
1.1
- Initial Version in the official repo.
- Now works with the ISO 639-2, which adds support for nearly every language.
1.0
- Bug fixes
- Speed improvements. Props Thomas "toscho" Scholz
0.9
- Moved to JSON file. Works with compressed file. Has an uncompressed version for live sites.
0.9
- Moved to JSON file. Works with compressed file. Has an uncompressed version for live sites.
0.9
- Moved to JSON file. Works with compressed file. Has an uncompressed version for live sites.
- Switched license to GPL3
0.8
- Reworked plugin code to a more readable code styling and maximum line length (GitHub page width).
0.7
- Bug fixes
0.6.
- Moved from a GitHub Gist to a GitHub.
wcm/wcm-lang-switch 适用场景与选型建议
wcm/wcm-lang-switch 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.05k 次下载、GitHub Stars 达 20, 最近一次更新时间为 2015 年 04 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「translation」 「wordpress」 「language」 「l10n」 「l18n」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wcm/wcm-lang-switch 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wcm/wcm-lang-switch 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wcm/wcm-lang-switch 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Easy to use i18n translation PHP class for multi-language websites
Package for convenient work with Laravel's localization features
Store your language lines in the database, yaml or other sources
A custom URL rule class for Yii 2 which allows to create translated URL rules
Set Links with a specific language parameter
统计信息
- 总下载量: 2.05k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-06
