Multilingual trilogy in progress: xili-tidy-tags 1.4.1 shipped

The release of WordPress 3.0 was an opportunity to improve and rewrite some parts of xili-tidy-tags plugins. No deep transformations but deep verification of compatibility with lastest version and obviously for multisite mode. So as presented here (see clouds at right), this plugin brings an original way to organize the tags both by languages or semantic ways.
To download use the WP repository or the internal plugin updating page.

Posted in News | Leave a comment

xili-language 1.7.1 is shipped: sub-selection of pages in top nav menu

Since previous intermediate version 1.7.0, version 1.7.1 add an option to easily configure the top navigation menu in a site. The example below is built with ‘twentyten’ theme delivered with WordPress 3.0.

For visitors, the top (here left) logo or title is well known to be a link to come back to home of the website. But for pages (as about or contact) it was not obvious previously to sub-select pages according current visitor’s language (only template_tags must be added by php users). Now, since WP 3.0 and hooks available in new navigation menu, it is easier for xili-language plugin to insert good items.

How to insert: step by step with ‘twentyone’ theme

  1. Verify that nav menu is set.
    Top Menu settings

    Top Menu settings

  2. Prepare pages and here translation in other languages of your website.
    Pages and translated pages

    Pages and translated pages

  3. Activate automatic insertion in xili-language admin UI.
    Activation of automatic insertion of sub-selection of pages

    Activation of automatic insertion of sub-selection of pages

  4. Enjoy…

F.A.Q.

  • In the menu, I want to insert only the childs of page #2, how to ?
    As in template-tag wp_list_pages(), you can add some params to create the selection. Plugin will add some others params to be sure the result of the query can be inserted.

    Pages Query sub-selection

    Pages Query sub-selection

  • Other questions ?
    Go to forum.
Posted in How to, News | Tagged , , | 1 Comment

xili-language 1.7.0 is shipped in other versions : some “howto”

xili-language 1.7.0 is shipped in other versions repository part.

With now WordPress 3.0, the default theme named twentyten can be used without php coding for a multilingual site [as shown here]. xili-language plugin works on mono or multisite mode.

  • some functions are improved through new hooks (front-page selection without source coding for webmasters).
  • if you build your theme, some of your functions need revisions.

Some experiences when updating “old” theme as this running in dev.xiligroup.com

Topnews in dev.xiligroup

Topnews in dev.xiligroup

After upgrading with 1.7.0, the top news is displayed when page is in en_us but not when front-page is in fr_fr… Why ?

As you can read, the top news are drived by some lines in header.php (some here below). The editor have add some custom fields (topnews-xx_xx) to define ID of top news for each language.

<?php
$page_front = get_option('page_on_front');
$news_id = get_post_meta($page_front, 'topnews-'.the_curlang(), true);
if ($news_id) {
   $temp_query = $wp_query; $wp_query = null; /* to reset the lang of current wp_query */
   $wp_query = new WP_Query('p='.$news_id);

With xili-language 1.7.0 ‘get_option‘ is now filtered for ‘front-page’. So if current language is defined as in a header, the function get_option('page_on_front'); return the a filtered value equal to the translated page. To recover the french top news, the custom fields topnews-fr_fr for ID must filled in linked page in french of the default front page. (in the previous version, all the custom fields were set in default front-page).
Remember now, when front-page is “page” : no need to use special querytag as hlang as in previous versions to switch between page of each language… it is now automatic…

Question: In this website, the site’s title and the site’s description is translated when changing for english to french, why ?
Answer: With 1.7.0, filters of bloginfo('name') and bloginfo('description') are active inside the plugin (in previous versions, possible via external functions). If .mo file contains the targeted translations, the title and description are translated. xili-dictionary incorporates some features to append the .po file with these infos.

Posted in How to | Leave a comment

New “post_type” in multilingual context and xili-language

Snapshop of new post_type: exemple book

Snapshop of new post_type: exemple book

Question: Is xili-language plugin compatible with a site containing multilingual posts featured with personalized post_type ?

YES – since version 1.7.0 – xili-language incorporates some new features to set a language to a new type of post (like above in a book example as described in codex).
We introduce some changes to not only display labels for post or page but also for other types of post as built by the powerful function register_post_type( $post_type, $args )

What has to do the developer of the plugin which add this new post_type ?

Less then ten lines of php code to link the metabox (at right in the screenshot above) with the functions xili_language_checkboxes and xili_language_linked_posts of the instantiation of the xili-language’s class.

Can you show the URI of a query of a category in on language ?
Example listing books in type ‘electronic’ and in ‘german’ :
your.website.tld/type/electronic/?lang=de_de

What else ?

Nothing, it works like other posts or pages…

Soon more details when when 1.7.0 shipped…

Posted in News | Tagged , | Leave a comment

xili-language plugin: Creation of a multilingual website with WordPress 3.0 and his new theme twentyten

The new 3.0 version of WordPress is such that it is today easier to create a multilingual site with plugin Xili-language and few methods without being a webmaster with knowledge in php…
Xili-language is also a very powerful toolkit for webmasters and designers of multilingual sites (content management – CMS). These aspects are not addressed here.

What is a multilingual site?

This is a site that contains articles and pages in different languages, each having (or not) a translation / adaptation into another language. For the visitor, who often comes to the site after a search, he discovers not only the desired article, but the whole theme of WordPress (the menus, the sidebar, the titles of categories) that will be displayed in the same language than the target page or section.

Do not be confused with the localization that is a translation of the frozen look of the site (theme) and that is only in the language of its author.
Finally, the authors of the multilingual site is the master of content. There is no automatic translation by robots.

The Xili-language plugin adds a taxonomy “language” that does not conflict with other “semantic” classifications of the site. So an article is an article, a page, a page with its title, its content, excerpt (abstract) and classification (categories, keywords, …) etc … No change untimely interface author or unnecessary additions to the database tables WP. Each author does not interfere with the author in another language. Since the WP version 2.3, Xili-language is functional and takes part gradually of improvment of WP kernel (core).

How does it work?

The plugin Xili-language uses the potential of WordPress (taxonomies, hooks, api, etc …) to interpret the classification by language and adapt the translation files (.mo) available in the folder of current theme.

Basically a localizable theme will change the language according the language in wp-config.php which is the language of the Author’s interface (dashboard) of the site.

In a multilingual context, it is necessary to have multiple languages available for the visitor side, the admin side can remain in the language of the webmaster. In most cases the default language is English (that of WordPress) and therefore the translation files (.po and mo) refer to this language (lines msgid). The line msgstr being that the translated text.

msgid "Comment %d does not exist"
msgstr "Le commentaire %d n’existe pas."

As the default theme “twentyten” is in English, the root language for multilingual site in our example will be English.

extract of file search:
_e( 'Search Results for: %s', 'twentyten' );

Remember, for to define the key texts of the site description and categories: we will do the same.

List of categories

List of categories

What to prepare?

For the theme “twentyten”, simply add the .mo language files selected in the WordPress installation kits and add them to the sub-folder ‘languages’ of the theme folder in installed site. For this example, we’ll take four languages : French, German, English and Spanish.

How to translate the site-specific terms (categories, labels, …)

Either you have poEdit app. and a text editor to complete files .po or, you used the plugin Xili-dictionary (beta because of its spartan interface – no javascript for lists and pagination but stable – that we use daily).

Step by step

Example for a single site (multi-mode (eg wpmu) will be dealt with later because multisite requires a somewhat different approach in the management and location of file as .mo)

WordPress 3.0 installation

Check that theme “twentyten” is current.

Add the file .po and .mo of target languages (here fr_FR, de_DE and es_ES)

Can be found in sub-folder languages of theme’s folder named twentyten of each kit as below.
http://es.wordpress.org/
http://fr.wordpress.org/
http://de.wordpress.org/

Enabling plugins Xili-language (choice of languages) and Xili-dictionary

Creating a category – such as “Actualités” then “News” and its description (“Recent news about website) as the pivot language is English.

Writing of one or two articles in French and / or English we will learn to link if their content is the translation – adaptation of the other.

Adding widgets Xili-specific language – settings…

Customizing the new menu system of the header (wp_nav_menu)

Navigation menu

Navigation menu

tags and plugin Xili-tidy-tags.

Details of previous steps

[UPDATED] The next post will be different as expected because it will be the same continuation of the other series about child theme. To avoid modifications inside default theme, a child theme is built (and available soon) and contains mimimum to have a multilingual website powered by xili-language.

To follow

Posted in How to | Tagged , , , , | 1 Comment