Tagged: x
-
AuthorPosts
-
July 14, 2016 at 12:57 pm #1087193
RinParticipantHello,
I’m using WordPress 4.5.3 with Cornerstone version 1.2.4 and X version 4.5.2 installed.I’ve read through and followed the steps outlined in most of the similar topics (change __x__, edit PO files,etc) and the one that’s fixed my situation so far is the solution from this similar thread: https://community.theme.co/forums/topic/translation-of-cart-page-words
This is the snippet I used:
add_filter('gettext', 'x_translate_text', 20, 3); function x_translate_text ( $translated_text, $text, $domain ) { if ( get_locale() == 'zh_CN' ) { $translation = array ( 'Apply Coupon' => '输入优惠券代码', 'Flat Rate: $5.00' => '付运收费: $5.00', 'Proceed to PayPal' => '转到 PayPal', 'By proceeding with your purchase, you agree to our Product Purchase and Delivery Guidelines' => '继续进行您的购买表示用户已同意我们的产品的购买和交付条款细则。', 'Local Pickup' => '本地传递', 'Delivery Time' => '付运时间', 'Order Notes' => '订单信息', 'Any Gift Message?' => '有送礼信息吗?', 'Include salutation (Dear James) and your signature (Love Lily)' => '包括称呼(如:亲爱的小明)和签名(如:爱您的小莉)', 'Singapore & Malaysia Delivery: $5.00' => '新加坡和马来西亚付运: $5.00', 'Birth date (YYYY/MM/DD)' => '生日 (年年年年/月月/日日)', 'Do you wish to receive newsletter emails from us?' => '您希望收到最新的消息和产品优惠信息吗。', ); if( isset( $translation[$text] ) ) { return $translation[$text]; } } return $translated_text; }However some text still remained in English despite it – they are:
-Delivery Time
-Flat Rate: $5.00
-By proceeding with your purchase, you agree to our Product Purchase and Delivery Guidelines
-Birth date (YYYY/MM/DD)
-Do you wish to receive newsletter emails from us?I’ve checked that it’s the same exact string in terms of text and formatting so not sure where I’ve gone wrong.
July 14, 2016 at 12:59 pm #1087203
RinParticipantThis reply has been marked as private.July 14, 2016 at 1:55 pm #1087259
RinParticipantThis reply has been marked as private.July 14, 2016 at 9:42 pm #1087915
Rue NelModeratorHello There,
Thanks for writing in! All those keywords you have pointed out is coming from WooCommerce. You need to translate WooCommerce as well. To do that, please check out their documentation for the very detailed instruction. Visit the page here: https://docs.woothemes.com/document/woocommerce-localization/
You might also want to check out how to properly translate X and Cornerstone from our knowledge base:
https://community.theme.co/kb/translation/Hope this helps.
July 15, 2016 at 1:45 am #1088115
RinParticipantHello, I’ve translated the PO files for Woocommerce and followed the instructions to change the references for –x– as mentioned in other support threads. So while the text has been translated, it’s not showing up on the front. I’ve followed the localization workaround (see above) and it’s worked for some and not the phrases here.
-Delivery Time (from a woocommerce delivery time plugin)
-Flat Rate: $5.00
-By proceeding with your purchase, you agree to our Product Purchase and Delivery Guidelines
-Birth date (YYYY/MM/DD) (from a plugin for User Extra fields)
-Do you wish to receive newsletter emails from us? (from a plugin for User Extra fields)I’m stuck with a deadline and not sure what else I can do.
July 15, 2016 at 6:43 am #1088360
RadModeratorHi Rin,
Since you’re translating it with Woocommerce reserved strings then you may need to change the textdomain applied for custom templates.
1. Please copy /wp-content/themes/x/woocommerce/ to your child theme (eg. /wp-content/themes/x-child/woocommerce/ )
2. Edit all files on your copied /woocommerce/ folder and replace all instances of __x__ to woocommerce
3. Then check if they are translated, if not, you may need to re-apply string translation (if your localization plugin has that feature)__x__ textdomain is only available for X theme and cornerstone, Woocommerce has it’s own, hence, the plugin you’re currently using has their own set of textdomain too. You should contact the plugin author as I myself not sure if all strings on their plugin is translatable through textdomain.
Examples,
__x__-de_DE.po woocommerce-de_DE.po your_plugin_text_domain-de_DE.poThanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1087193 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
