Linux 软件免费装
Banner图

Key Value Localization

开发者 valioov
更新时间 2016年11月16日 17:15
PHP版本: 3.0.0 及以上
WordPress版本: 4.6.1
版权: GPLv2 or later
版权网址: 版权信息

标签

shortcode i18n l10n localization value key interpolation dispecto

下载

1.0.0

详情介绍:

Unlike other localization plugins, KVL uses shortcodes to interpolate the translations. Maintaining the translations is easier this way. The translations are added to the WP database in json-format. The json-model of the locale consists of the keys and the actual translations which are later referred to as shortcodes in the html. The plugin uses a cookie to store the language that was used in the previous session.

安装:

  1. Upload the plugin files to the /wp-content/plugins/key-value-localization directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' screen in WordPress
  3. Use the Settings->KVL Localization screen to configure the plugin
  4. Type in your default language. Example: en
  5. Type in the list of languages that your page will support separated by semicolon. Example: en;fi;de
  6. Select: Save Options
  7. More options have appeared to the options page
  8. Choose the desired flags for the locales listed in the default languages -list and give them their corresponding display names. These names will be displayed in your wordpress page in the language selector dropdown-menu.
  9. Overwrite the default CSS for the language selector dropdown-menu. By default, the dropdown-menu is fixed at the bottom right corner of the browser window.
  10. You are provided with a json-template to start working with for each of the locales.
  11. To add a test translation, you can remove the content inside the curly brackets and add a new line inside the brackets.
  12. For a English locale you would add something like: "test-translation": "This is a test translation" inside the curly brackets.
  13. And for a Finnish locale you would add something like: "test-translation": "Tämä on testikäännös" inside the curly brackets.
  14. In the WP page editor you can now add content like this: [translate key="test-translation"].
  15. Now depending on the selected language the content will be shown as "This is a test translation" OR "Tämä on testikäännös".
  16. Start localizing your content now!

屏幕截图:

  • Select the default language and the list of languages separated by a semicolon. Then choose the display texts and the flags for the corresponding languages and overwrite the CSS if you like. By default the language selector is fixed at the bottom right of the browser window.
  • This screenshot shows the localizations configurations of the 2 locales listed in the language list. The configuration is in json-format.
  • For the locale "en" we have chosen to add a key "main.innovation.short". The corresponding value of the key will be shown for the user when the locale en is chosen.
  • From left to right: (1) Actual output, (2) Shortcode referring to the json-key. (3) Chosen language.

更新日志:

1.0