Tagged: i18n, Multilanguage, Translation
- This topic has 10 replies, 6 voices, and was last updated 2 years, 2 months ago by
Steve.
-
AuthorPosts
-
-
October 23, 2012 at 9:52 pm #340
MiguelMemberHi all.
I want to know how to manage the translation of the “title of the metabox” ( and other text in the framework) that is defined in the comments.
<?php
/*
Title: My Demo Meta Box
Post Type: post
*/
Thanks from Spain.
Miguel.
-
October 24, 2012 at 10:31 am #341
-
October 24, 2012 at 1:30 pm #342
Daniel MénardMember@Steve- I had the same question some times ago and I’m not sure that your suggestion is doable : from what I see, piklist loads the string from text-domain “piklist” and not from the text-domain of the plugin:
add_meta_box( ... __($data['name'], 'piklist') ...)
If I add a string in my PO with domain “piklist”, it seems that wordpress ignores it:
#@ piklist
msgid "test"
msgstr "translation of test"
I guess that wp don’t like PO files with multiple text-domains (plugins like “CodeStyling Localization” warn about that)…
Any clue?
Cheers,
Daniel -
October 24, 2012 at 2:34 pm #344
MiguelMemberOK, i´ll test it.
I´m using WPML in most sites” it´s a multilingual World” 😉
-
November 30, 2012 at 7:22 am #487
emzoMember@Miguel Can you translate those strings using the WPML String Translation module?
-
November 30, 2012 at 7:26 am #488
MiguelMemberplease, install a plugin like “piglatin” and you will see if all the strings are translatable.
-
November 30, 2012 at 11:12 am #490
SteveKeymaster@Miguel– Using Pig Latin and it’s very helpful! We’ll be moving forward with better localization.
-
June 10, 2015 at 11:32 am #3853
graupMemberHi, any updates on this? Is it possible to translate the text inside the comments?
-
June 10, 2015 at 1:01 pm #3854
-
November 14, 2019 at 5:41 am #9530
NabilMemberI’m satisfied with this workaround:
<?php // File: parts/meta-boxes/my-metabox.php /** * Title: {{ My Metabox }} * Post Type: my_cpt */ piklist( 'field', [ 'type' => 'file', 'field' => '_thumbnail_id', 'scope' => 'post_meta', 'options' => [ 'title' => __( 'Set featured image(s)', 'my_textdomain' ), 'button' => __( 'Set featured image(s)', 'my_textdomain' ), ], ] ); /** * Localize Title */ add_action('piklist_pre_render_meta_box', function() { ob_start(); } ); add_action('piklist_post_render_meta_box', function() { echo str_replace( '{{ My Metabox }}', __( 'My Metabox', 'my_textdomain' ), ob_get_clean() ); } ); -
November 29, 2019 at 5:51 pm #9535
SteveKeymasterPiklist v1.0.5 now does this automatically. Just add your translations to your .po file and Piklist will translate everything including the comment block titles.
-
-
AuthorPosts
- The topic ‘title translation’ is closed to new replies.