Tagged: labels, Multilanguage
- This topic has 13 replies, 4 voices, and was last updated 9 years, 2 months ago by
Steve.
-
AuthorPosts
-
-
November 24, 2012 at 10:46 am #448
RolandMemberHi,
Question about Multilanguage Options:
Piklist automatic sets the singular and plural forms for the labels and the Menu-Title (custom post type name in the menu). This works fine in english, but i have a translation for my custom theme in german and in the future for some other languages, and then it looks worth… ;o)Is there an option to disable the automatic settings for the singular and plural forms, and maybe like the core functions from WordPress to define all labels (like ‘Add New …’, ‘Edit …’, and so on)?
When i register a new taxonomy with the core functions, i have the possibility to set each label via the $labels-varaible and prepare it for translation.
Cheers, Roland
-
November 24, 2012 at 10:49 am #449
RolandMemberOne more: when i register a new Meta-Box, in the head i define the name of the Meta-Box with “Title:”, is there also an option to prepare it for translation? With the textdomain it doesn’t work…
Thnx
-
November 27, 2012 at 10:19 am #454
-
November 28, 2012 at 10:54 am #462
emzoMemberThe WPML guys have a lot of knowledge about WordPress multilingual support. With their Go-Global Program, they’ll even help with making themes and plugins compatible with WPML, and give developers a free subscription to their members-only forum. Maybe it would be worth getting in touch with them?
-
November 28, 2012 at 10:59 am #463
-
November 28, 2012 at 11:06 am #465
emzoMember@Steve That’s awesome! Piklist looks absolutely fantastic – I love that it’s “built for developers”, and it looks like it’s going to be a huge time-saver for me. I only wish I’d known about it earlier. The only reservation I have are with multilingual support. I live in Wales, and a large percentage of my clients require multilingual sites. Knowing that you’re now talking to the WPML guys has really made my day. I’ll be happy to help out where I can.
-
November 28, 2012 at 12:10 pm #468
emzoMemberCan I suggest that where possible, if any WPML specific code is required, it would be better placed in a separate “bridge” plugin, rather than in Piklist core. This way, it keeps Piklist clean and minimal if multilingual capability is not required.
Jason Bobich followed this approach with his Theme Blvd WPML bridge plugin. Also Gravity Forms has a separate WPML bridge plugin, as do many of the leading WordPress eCommerce plugins.
-
November 28, 2012 at 12:40 pm #469
-
November 28, 2012 at 12:43 pm #470
RolandMember@Steve: Many thanks for the quick answer.
@all: Sure, WPML is a great plugin for multilingual websites. But there are two ways you can develop a multilingual site (or even more): with a plugin like WPML or with WordPress Multisite. Every project is different and so the solutions are different. I try to keep independent from plugins as most as i can. Because with every new WordPress Version you must trust, that the plugin-developers update the plugin as well. So Piklist is great, because it saves me a lot of time developing and it’s extreme flexible in use.
At the moment i built a portal for a great company. The basic site is in german and the international site in english. But they go to other countries all over the world with their services, and in future they need own sites for every new country. Also with some different contents and features for each country. I decide for the multisite solution, it keeps the system more flexible. The Theme i wrote is multilingual-ready and i made the translations with the plugin Codestyling Localization. Works fine! The only plugin i use for the multilingual management is Multilingual Press. It’s a small plugin and also very flexible.
So i think for the future will be good to keep the decision by the developer, if he wants to use a plugin like WPML (which is good for a site in different languages) or WordPress Multisite with the language support inside of Piklist. Like Piklist himself, it’s free to make everything what’s in your mind!
-
November 30, 2012 at 7:11 am #485
emzoMember@Roland I totally agree. Piklist can be made fully translatable in it’s own right, which is why I am advocating a separate plugin to provide any UI enhancements on top of Piklist if WPML (or some other multilingual plugin) is being used.
For example, Stella is another promising multilingual plugin by Theme FM. They have just recently released an add-on plugin for Yoast’s WordPress SEO. Now WordPress SEO is fully translatable, but the add-on plugin provides a nice UI to set SEO option per language from the WordPress admin.
I believe @Steve agrees that this is a sensible way forward.
-
November 30, 2012 at 8:41 am #489
Daniel MénardMemberHi piklisters!
I’m not sure that a wpml bridge is in fact needed. Here are my thoughts about this:
1. piklist need to better respect wordpress i18n:
– In many places, the code use the “__” function but without specifing the piklist text domain.Exemple :
$title = __('Piklist Widgets')in class-piklist-widget.php:60
It should be$title = __('Piklist Widgets', 'piklist')Using a plugin like codestyling localization (http://wordpress.org/extend/plugins/codestyling-localization/) helps because those strings appear in the “default” text domain (98 strings, including the piklist demos add-on).
– Using i18n functions with function calls or variables result in untranslatable strings:
Code like this :
$title = __($title);or this$description = __('Widgets for the ' . get_current_theme() . ' Theme.');is not translatable using usual tools.This blog article from Otto explain why you can’t do this:
http://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/2. In many places, piklist calls __() but with its own text domain and not the plugin text domain
Exemple : in post_type_labels() there are calls like
'name' => __(self::pluralize($label), 'piklist')It can’t works: i have a custom label, piklist pluralize it and then we ask gettext to find it in the piklist text-domain and obviously it won’t.
3. Strings in files headers (title, etc.) are not translatable
(see this thread: http://piklist.com/support/topic/title-translation/)
Piklist uses get_file_data on those strings, but it is not enough.To be translatable on wordpress.org, wordpress plugins have to define their text domain and domain path in the main plugin file header:
* Plugin name: my-plugin
* Text Domain: my-domain
* Domain Path: languages/
(see http://codex.wordpress.org/File_Header#Plugin_File_Header_Example)Piklist could use these headers to translate the strings specified in other plugin file headers.
Something along:
– when you search for “plugin type: piklist”, store the text-domain of each piklist plugin ;
– when rendering a view, call get_file_data() ; foreach header do header=__(header, plugin-text-domain).4. Piklist functions Pluralize and Singularize are only usable in english
I don’t see this as a problem. These functions are very pretty if you work in english or for prototyping, you just write:
‘labels’ => piklist(‘post_type_labels’, ‘Demo’)
and it works.But you can also specify all the labels if you want and it will work fine with piklist:
‘labels’ => array(
‘name’ => __(‘my cpt name’, ‘my-text-domain’),
‘add_new’ => __(‘add a my cpt record’, ‘my-text-domain’),
…
),
(see : “labels” in http://codex.wordpress.org/Function_Reference/register_post_type#Arguments)5. i18n also have impact on dates formats and so on
Code like this is probably not correct:$datef = __('M j, Y @ G:i');
We should used the format defined in worpress options (get_option(‘date_format’)).Hope it helps !
Cheers,
Daniel
-
November 30, 2012 at 11:13 am #491
-
December 3, 2012 at 3:31 pm #505
-
December 4, 2012 at 5:05 pm #514
SteveKeymasterAdded Text Domain to all localized strings in v0.7.0.
-
-
AuthorPosts
- You must be logged in to reply to this topic.