Episode #6 – Child theme, Multilingual website: Questions in bulk…

In the previous episodes, we have seen the essential elements to build a multilingual website based on xili-language trilogy and a child theme of the default twentyten theme delivered by WP team.

Now, a little break for questions and answers:

Q: What are the modifications inside the files of the child against the parent ? Why ?

A:File by file for php developers with minimal knowledge in WP architecture !

  • category.php : the title and description before the list of excerpts in loop:
    twentyten

    <h1 class="page-title"><?php
    					printf( __( 'Category Archives: %s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' );
    				?></h1>
    				<?php
    					$category_description = category_description();
    					if ( ! empty( $category_description ) )
    						echo '<div class="archive-meta">' . $category_description . '</div>';

    twentyten-xili

    <h1 class="page-title"><?php
    					printf( __( 'Category: %s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' );
    				?></h1>
    				<?php
    					$category_description = trim(strip_tags(category_description()));
    					if ( ! empty( $category_description ) )
    						echo '<div class="archive-meta"><p>' . __($category_description,'twentyten') . '</p></div>';
  • page.php and single.php : insertion of xiliml_the_other_posts template tag just under the title
    twentyten-xili

    <div class="entry-meta">
    						<?php xiliml_the_other_posts($post->ID,"Read this post in"); ?>
    					</div><!-- .entry-meta -->

    and add a class for rtl languages :

    post_class(single_lang_dir($post->ID))

    (call a function added in functions.php)

  • functions.php
    contains minimal functions to not use languages files of parent theme, call a library to display flags in menu and side menu and to add languages in search..

Q: In WPLANG, some languages are not with 5 chars but with 2 chars like in japanese install kit, how to ?

A: Before version 1.8.8, it was necessary to change wp-config.php like japanese and set WPLANG to ISO : from ja to ja_JA and rename the ja.mo to ja_JA.mo inside languages sub-folder of current theme. Now with 1.8.8, the trilogy is updated, it is not necessary. So very easy for a japanese to transform his site in a multilingual site by adding other language files as here for test.

japanese welcome example

japanese welcome example

Q: What about xili-language and texts inside plugins ?
A: With innumerable crowd of plugins (and widgets), it is perhaps possible to define

  1. mono language plugin: not ready for localization
  2. plugin ready for localization (with .pot file and .po series) – perhaps ready for multilingual in visitor’s side if no datas set by enduser
  3. plugin ready for localization AND live multilingual – providing api or way to switch datas language

If a widget is well designed, his title is translatable.
For labels or terms, if localizable, xili-language is able (if checked) to switch live the domain of the plugin to the domain of the theme (only in user side – not admin)… So just need to add term (and translation) via xili-dictionary to .po and .mo…

Q: What about WP 3.1 next release now in beta testing ?

A: In localhost here, all the tests done with WP 3.1beta (mono and multisite mode) show the compatibility with multilingual xili-language trilogy plugins.

Q: What about multisite or WP 3.x network mode ?

A: As implemented here, xili-language is compatible with multisite mode. For support and services, order a quotation.

Q: What about Quick Edit for language in posts list ?

A: Yes, the hooks were found for little source add on… available since 1.8.9 soon !!!

quick-edit: pop-up to choose language in posts list

quick-edit: pop-up to choose language in posts list

Now very easy to modify a posts list in dashboard !

This entry was posted in How to and tagged , , , , . Bookmark the permalink.