
內容目錄
內容簡介
新增 wpml__ 和 wpml_e 函式到您的主題,以及 wpml__ 短碼到您的 WordPress 網站。使您的 WordPress 完全支援 WPML 翻譯外掛。
<?php wpml__($text, $context); ?>
<?php wpml_e($text, $context); ?>
類似 __、_e 函式的行為,您必須提供一個要翻譯的字串和上下文。
這樣就可以了,只需要在 WPML > 串連翻譯 管理面板提供翻譯即可。
請參閱下面的短碼用法。
用法(透過代碼)
<h1><?php echo wpml__('標題', 'wpmlshortcodes'); ?></h1>
<h2><?php wpml_e('副標題', 'wpmlshortcodes'); ?></h2>
用法(透過短碼)
<h1>[wpml__ context=wpmlshortcodes]標題[/wpml__]</h1>
<h2>[wpml__ context=wpmlshortcodes]副標題[/wpml__]</h2>
最新消息!WPML Translate (+ 短碼)
將 wpml_if (舊名 wpml_translate) 短碼新增到 WPML 套件中。您還可以在您的 PHP 代碼中使用 wpml_e__if_language( $content, $lang ) 函式。
用法(透過代碼)
<p><?php
wpml_e__if_language( '文字', 'en' );
wpml_e__if_language( '測試', 'it' );
?></p>
用法(透過短碼)
[wpml_if lang='en']文字[/wpml_if][wpml_if lang='it']測試[/wpml_if]
它還支援 WPML Translate Shortcode(已棄用的外掛)的 wpml_translate 和 wpml_language 往後兼容性。
WPML Translate Shortcode > WPML Shortcodes
歡迎來到新的 WPML Shortcodes。這個外掛是新的 WPML Translate Shortcode,成為完整的翻譯套件。
當然,我們仍然支援 WPML Translate Shortcode,透過新的短碼(1.2.4+):wpml_if(請參閱上面的用法)。
此外,我們在 1.2.6+ 版本提供完整的往後相容性(是的,您仍然可以使用 wpml_translate 或 wpml_language 短碼)。
貢獻
GitHub 上的拉取請求:github.com。
作者:Mirco Babini,網站開發人員和行動應用程式開發者;WordPress 顧問。
外掛標籤
開發者團隊
原文外掛簡介
Adds the wpml__ and wpml_e functions to your theme and the wpml__ shortcode to your WordPress website. Make your WordPress full WPML ready
Similarly to the behaviour of the __, _e functions, you must provide a string to make translateable and a context.
That’s it; just provide translations from the WPML > String Translations admin panel.
Check how to use the shortcode below.
Usage (via code)
Usage (via shortcode)
[wpml__ context=wpmlshortcodes]Title[/wpml__]
[wpml__ context=wpmlshortcodes]Subtitle[/wpml__]
NEWS! WPML Translate (+ shortcode)
Adds the wpml_if (ex wpml_translate) shortcode to your WPML suite. You can also use the wpml_e__if_language( $content, $lang ) in your php code.
Usage (via code)
Usage (via shortcode)
[wpml_if lang='en']Text[/wpml_if][wpml_if lang='it']Testo[/wpml_if]
It also supports backward compatibility for wpml_translate and wpml_language from WPML Translate Shortcode (deprecated plugin);
WPML Translate Shortcode > WPML Shortcodes
Welcome to the new WPML Shortcodes. This plugin is the new WPML Translate Shortcode, became a full-translation suite.
Of course we still support WPML Translate Shortcode, with a new shortcode (1.2.4+): wpml_if (see usage above).
Also, we provide full backward compatibility (yes, you can still use wpml_translate or wpml_language shortcodes) on 1.2.6+.
Contribute
Pull requests on github.com.
Author: Mirco Babini, Web Developer and Mobile App Developer; WordPress Consultant.
