Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1199 Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1199 Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1199 Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1199 Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1244 Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1391 Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1391 Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1391 Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1391 Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/classes.php on line 1442 Strict Standards: Redefining already defined constructor for class wpdb in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/wp-db.php on line 306 Deprecated: Assigning the return value of new by reference is deprecated in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/cache.php on line 103 Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/cache.php on line 431 Deprecated: Assigning the return value of new by reference is deprecated in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/query.php on line 61 Deprecated: Assigning the return value of new by reference is deprecated in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/theme.php on line 1109 Strict Standards: Declaration of Walker_Comment::start_lvl() should be compatible with Walker::start_lvl(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/comment-template.php on line 1266 Strict Standards: Declaration of Walker_Comment::end_lvl() should be compatible with Walker::end_lvl(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/comment-template.php on line 1266 Strict Standards: Declaration of Walker_Comment::start_el() should be compatible with Walker::start_el(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/comment-template.php on line 1266 Strict Standards: Declaration of Walker_Comment::end_el() should be compatible with Walker::end_el(&$output) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/comment-template.php on line 1266 Strict Standards: Redefining already defined constructor for class WP_Dependencies in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/class.wp-dependencies.php on line 31 Strict Standards: Redefining already defined constructor for class WP_Http in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/http.php on line 61 Deprecated: Non-static method WP_Http_ExtHTTP::test() should not be called statically, assuming $this from incompatible context in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/http.php on line 94 Deprecated: Non-static method WP_Http_Curl::test() should not be called statically, assuming $this from incompatible context in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/http.php on line 97 Deprecated: Non-static method WP_Http_ExtHTTP::test() should not be called statically, assuming $this from incompatible context in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/http.php on line 142 Deprecated: Non-static method WP_Http_Streams::test() should not be called statically, assuming $this from incompatible context in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/http.php on line 145 Multi-Language Blog - Heracleum Pages

    Articoli precedente e prossimo:
Saturday, 17 February, 2007

Word is: multi-language.

Or better, “bilingual”. In my case, I basically had the need to write articles in two languages (italian and english). During my first search I read about plugins that support multiple language in a single post with features to switch them client-side. This is not exactly what I was looking for: different entries in different language but one related to the other as one the translation of the other. The language switch should be “global”: browsing the blog in english the user have to see only english posts; each entry should expose a link to its translation -if any- in the other language, otherwise show a “No translation” label.

All this, and even more of course, is made possible applying the “Gengo” worpress plugin.
Well, actually Gengo -as is- did’t fulfill all my requirements so I had to apply a lot of code modification to make it work as I needed.

First of all, Gengo expect to receive the current language as a parameter in the query-string (e.g. ?language=en) which, once activated the URL rewrite wordpress option (as I did), will show in the URL as a “/en/” appended in any context, for instance a full URL could be:
host/wordpress/2007/02/17/post-title/en/
This solution, to me and others -as I could read in theis forums- looks quite ugly.
Since outside the section where Wordpress is installed (/pages here in this site) the whole site language setting is determined by a subdomain (3rd level), it.heracleums.org for italian version and no subdomain (heracleums.org) for english one, I wanted Gengo to determine the current language the same way. This is the first relevant modification I had to apply.

The other aspect to be aware of using Gengo is that even its latest version does not currently support WP 2.1! Anyway, as far as I can see, this is actually creating problems when setting translation relations in the WP Write/Manage post page but fortunately you can make this association in the plugin’s “translations” page.

A related problem happens trying to get the single entry translations -the language switch- in the theme: it doesn’t work saying “No translations” even if all is properly set. The workaround requires constant mySQL queries: this led me quickly to consider using a cache management plugin (discussed later).

All the rest is working unexpectedly good, just to tell about another nice multilingual feature: the Categories, a common object through the different languages, have each their translation.

The rest of my work is all about the custom Theme development which have to show the same look of the whole site, current language awareness for various labels and captions -usually written in english directly in the HTML code of the theme-, pure CSS styling and various issues.



13 Responses to “Multi-Language Blog”

  1. Sudoku Says:

    if you are into Sudoku you shall check out Kakuro which is a new puzzle game that’s getting popular lately :-)

  2. Katja Says:

    I have a similar situation with a multilingual website - the site language setting is determined by a subdomain outside of Wordpress. Unfortunately, I’m rather new to using Wordpress and I would greatly appreciate if you could share the Gengo hack :).

  3. Heracleum Says:

    Hi Katja,
    I see this domain-determined language thing is getting quite popular.
    Unfortunately in WP and Gengo the thing is not easy, I hacked gengo but the login cookies of WP are by exact domain (not *.site.org), if I login in it.heracleums.org and switch gengo language I find myself not logged in in the english version. So take also this into account.

    First of all, I think you should tell your website or whatever, so I can contact you when I find a way to share the hacked gengo for language domains. Of course I did some lazy modifications that -as they are now- can work only on my site :P but they can be generalized.

  4. Katja Says:
    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/kses.php on line 1002 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/kses.php on line 1003

    Hi :)

    The site is currently http://www.go-zveza.com, but it is under some renovation, and it only uses wordpress for the news section (so logging in or out is not really a problem) - there’s a lot of other active content that i’m not sure about how to integrate into it.

    One idea I had was to hack the permalink functions wordpress uses to extend them over the whole site, or something like that, but I’d really have to look through the code to see if that’s possible.

    Thanks for the help :)

  5. Heracleum Says:
    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/kses.php on line 1002 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-includes/kses.php on line 1003

    Hi Katja,
    i see your site renovation is not currently showing a domain-determined language, i see a fixed http://www. instead of en. or .sl, i even can’t see any kind of URL rewriting active, showing the language parameter in the querystring…
    –short pause–
    Oh my, what th.. aww. I had a quick jump on jamietalbot.com (both homepage and forums) who is the creator of Gengo.. but(!) the site is completely down crack/hacked, apparently blank pages but full of cloaked spam links… I just wanted to ask him about a domain-language aware version.

  6. Katja Says:

    Hi,

    yes, a domain-determined language is what i had planned for the next version (I’m not really sure how to do it with gengo short of a hack). As it is, another acceptable solution would also be to append the language code just after the domain instead of at the end (as gengo does).

    I could send you the url of the test version, but I’d rather not post it here (and I didn’t find an email to send it to :) ).

  7. Heracleum Says:

    Ah yes, no contact section yet :)
    The address is simple, write to the “admin” user of this site ;) (spam of course will not reach this address if i go on sharing it like this eheh)

    In a few words:
    1) do you think it will use the “same method” as this (my) site does?
    2) does you language subdomain (let’s say “sl.sitename.net) will be used also in different “levels” before other 3rd level subdomain? for instance, do you have subdomains for other purposes (non language), let’s say forum.sitename.net?
    2a) if you do, do you want the language domain to keep a fixed 3rd level domain (forum.sl.sitename.net, not recommended :D but i see a few sites doing it…) or more easily it will stay always as last level (and leftmost) domain like sl.forum.sitename.net

  8. Katja Says:

    I sent an email, hopefully to the right address :D

  9. sohbet Says:

    Theme site lince looks nice.

  10. Au Pair Says:

    very nice web site. My English is not so good, so I do not understandt it well, but it seems very good. Thanks

  11. deneme Says:

    CMS so far and it is easy to maintain and plus the community is truly great z sex porno

  12. web tasarım Says:

    Multi-Language Blog - Heracleum Pages güzel bir yazı özenle yazılmış thank you.

  13. to domain name Says:

    hi guys…

    hi guysI would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well and i have start my own blog now, , thanks for your effort…

Lascia un commento

Tag XHTML permessi: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Strict Standards: Redefining already defined constructor for class sk2_plugin in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-content/plugins/SK2/sk2_plugin_class.php on line 45
It sounds like SK2 has recently been updated on this blog. But not fully configured. You MUST visit Spam Karma's admin page at least once before letting it filter your comments (chaos may ensue otherwise).
Strict Standards: Declaration of sk2_captcha_plugin::output_plugin_UI() should be compatible with sk2_plugin::output_plugin_UI($output_dls = true) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-content/plugins/SK2/sk2_plugins/sk2_captcha_plugin.php on line 70 Strict Standards: Declaration of sk2_pjw_simpledigest::output_plugin_UI() should be compatible with sk2_plugin::output_plugin_UI($output_dls = true) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-content/plugins/SK2/sk2_plugins/sk2_pjw_daily_digest_plugin.php on line 268 Strict Standards: Declaration of sk2_rbl_plugin::treat_this() should be compatible with sk2_plugin::treat_this(&$cmt_object) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-content/plugins/SK2/sk2_plugins/sk2_rbl_plugin.php on line 342 Strict Standards: Declaration of sk2_referrer_check_plugin::output_plugin_UI() should be compatible with sk2_plugin::output_plugin_UI($output_dls = true) in /storage/content/74/1007074/heracleums.org/public_html/pages/wp-content/plugins/SK2/sk2_plugins/sk2_referrer_check_plugin.php on line 78