skriker

Polyglot

author - malyfred / 2005-02-22 /
  • česky

Example

In a Rhodes tailor shop:
Order your summers suit. Because is big rush we will execute customers in strict rotation.

A sign posted in Germany's Black forest:
It is strictly forbidden on our black forest camping site that people of different sex, for instance, men and women, live together in one tent unless they are married with each other for that purpose.

This post is here to introduce the plugin called "Polyglot" - plugin for complete and easy localization of your blog into several languages. Polyglot is based on Language Picker. If you have any problem reading documentation of Language Picker can be helpful. I have developed it for my private use but some other guys/gals could be interested (hello Mihailo:o) as well.

I have fixed all bugs in Language Picker that I've found and added ability to automatically detect the visitor's preferred language and then choose the right translation for him/her. You can try it here - with this post. Example above should be in czech or english according to your selection or preferred language in your browser.

How it works

For example this post actually looks like this:


[lang_cs]Dva studenti…[/lang_cs]

[lang_en]In a Rhodes tailor shop…[/lang_en]

This post is here to…

And that's it. You can translate titles of the posts, pages, names of the categories etc. in the same way.

ISO codes

You are supposed to use [lang_xx] where 'xx' is the ISO code of the language. These can be found here: ISO codes

Language versions

If you put to your index.php (and single.php, search.php etc.) in your themes something like this:

<?php if(function_exists('polyglot_other_langs')) {
//display existing language versions of the post
polyglot_other_langs(' ','<ul>', '</ul>', '<li>', '</li>');
}?>

(must be inside of the WordPress loop) you allow your visitors to choose the language version of particular post (as could be seen above).

Flags

Name of the language or associated flag will be shown according to the value of $polyglot_settings['use_flags']. (Thx Mateusz Łoskot for inspiration)

Preferred language

Then you can offer your visitors to set preferred language for entire blog (as you see in my menu). It can be done by code like this:


if(function_exists('polyglot_list_langs')){
polyglot_list_langs(false);
}

that you put e.g. in your sidebar.php. Function polyglot_list_langs() accepts one optional parameter true or false that says whether names of languages or flags should be shown.

RSS

You can also offer RSS feeds in different languages:

<a href="<?php bloginfo('url'); ?>?feed=rss2&lang_view=en"> English RSS</a>

Last thing you have to do is to specify languages of your blog in polyglot.php. Basically - you just add ISO codes to the array $polyglot_settings['knownlangs'].

If there is no suitable language version of text present - then the default language version is selected. If even default language version is not there - then only parts that are not translated are shown.

Template localization

Because Polyglot changes dynamically prefered language of your blog - you don't have to do anything special to translate your blog except that everything in your templates that should be translated must be "gettexed". And appropriate .mo files must be in your wp-includes/languages directory. You can get them here: WP localization files and they should be renamed to xx.mo where 'xx' is the ISO code of certain language.

Time & Date

Time and date formats can be cusomized to fit the language traditions since the versin 0.8.

Permalinks

Permalinks are fully supported, and turned on by default, since version 2.0 was released

Comments

The version 0.8 has also introduced the ability to write comments on posts in more language versions. Your visitors must use [lang_xx] instead of <lang_xx>.

Other useful plugins

You can also try some other of my plugins: IImage Browser, IImage Gallery, IImage Panorama, JÄÅ Preview.

Known issues

  • You have to set WPLANG (e.g. define('WPLANG', 'en');) in your wp-config.php. Thank you Pete!
  • If you are using WP older than 1.5 - uncomment part of the code from line 125 and comment part from line 139.

Important

Since version 0.8 you can use [lang_xx] instead of <lang_xx>. That's useful for those using WYSIWYG editors.

Fixes

01.04.2008 - WP 2.5 compatibility improved
27.01.2008 - WP 2.3 compatibility improved (tags, links, initialization,…)
11.10.2007 - few RSS related filters added
27.05.2007 - some setcookie improvements
22.05.2007 - small improvements related to new features in WP2.2
29.01.2007 - version 2.0 released. Many new features and improvements added (permalinks among others).
24.03.2006 - original WP function trailingslashit doesn't work as intended so it has been replaced by polyglot_trailingslashit
20.01.2006 extended polyglot_the_date, now accepts $before & $after
extended polyglot_list_langs, now sets a class for the <li>s (language_item and current_language_item)
Thanks Jan for all these improvements!
07.01.2006 Tag [lang_xx] added
18.10.2005 Huge update - flags added, 'translate categories' plugin implemented etc.
25.5.2005 Polyglot is now using standard load_default_textdomain() function.
13.3.2005 Tag <lang_all> is since this moment optional - everything except translated parts is handled as <lang_all>
12.3.2005 Fixed problem with WP1.5 - thanks Matthias.

Download

polyglot2.5.zip.

default_gettext.zip - fully gettexed default theme. (thanks to Maira)

Let me know

I'd appreciate if you let me know that you use Polyglot on your web. You can also choose whether you want to be informed about new versions:

How to translate categories

There are two ways. At first you can write translations directly to the category 'name' using [lang_??] tags. But WordPress is limiting the name length to just 55 characters so you will have a problem to fit all translations inside. I'd recommend you increasing the length of 'name' column in 'items' table (WP <2.3 - 'cat_name' column in 'categories' table) in your WP database.

Second way is to add all translations of categories to your .mo files and Polyglot will try to translate them. It's tested with wp_list_cats() function.

Comments

  1. Mihailo 2005-02-22 / 3.10 am

    Yay!!! I also wish this something like this becomes part of the core. I’d also like to see it more advanced, so that instead of using lang tags, each article article and/or category would have separate language field, and selected for displaying based on that.

    Till then, I’m off to play with Polyglot :) Thanks!

  2. Jason 2005-02-22 / 11.36 pm

    I’ll have to take a look when I get some time… I’m glad somebody’s working on stuff like this; I wish I had the time to continue with it myself…

  3. Yves 2005-02-27 / 11.23 pm

    Nice work! Works like a charm. One problem though with the “previous post” and “next post” links that displays the titles of the preceding and following post in the single.php view. It show the titles for all languages , one next to the other. Any workaround? What about a mini “the loop” just for this navigation part?

  4. malyfred 2005-02-28 / 1.33 am

    >Yves It should be possible just to add proper hook for this in polyglot.php. If you could not find the right one I would suggest to call the lang_picker_respect_more("your text") function on this. Where you replace “your text” with whatever should be “polygloted”.

  5. Yves 2005-03-02 / 12.50 am

    Well, after much head scratching and Plugin API documentation reading I saw the light (I am a newbie PHP meddler) and added
    add_filter('next_post', 'lang_picker_respect_more',1);
    add_filter('previous_post', lang_picker_respect_more',1);
    to polyglot.php but with no effect.
    These functions however are not referred to as available filter hooks in the Codex but I don’t quite know what I am missing.

    Oh and on another note, Would you know where to find a gettexed version of the Kubrick theme?

  6. malyfred 2005-03-02 / 3.12 am

    >Yves These hooks seem to be good for it and if it doesn’t work - we have to “dig deeper” in the code…:o( Gettexed Kubrick should be soon on official WP web. As far as I know - they are working on it. Look into archive of wp-polyglots mail list: wp-polyglots.

  7. Yves 2005-03-02 / 8.33 pm

    Thank you for your reply. I may settle for more conventionnal “next post/previous post” links in the meantime.
    I did find a hint that fully gettexed themes might not be feasible until version 1.5.1 .I decided for the short term to use the theme-switcher plugin to switch between two hard translated theme, now the challenge is to have the same link switch the theme and the language of the post and the locale! An hybrid between polyglot and theme-switcher?

  8. malyfred 2005-03-02 / 10.29 pm

    >Yves Actually it shouldn’t be so hard. Just let the Polyglot do its work and change the themeswitcher to respect selected language. It could be like 4 lines of code!

  9. neingeist 2005-03-14 / 9.12 pm

    TrackBack: neingeist » The Tower of Babylon

  10. freshlabs - Wordpress multilanguage 2005-03-15 / 12.13 pm

    […] rschiedene Ansprüche. Bislang habe ich zwei davon ausprobiert: Polyglot (Autor URI: http://fredfred.net/skriker/in…) Polyglot erlaubt es, die Sprache in einem Post mi […]

  11. joe 2005-03-20 / 5.25 pm

    How did you manage to change the menu titles also? I attempted to specify the variations in the code in the same way as you would for making a multi-language post, but no luck… is it something to do with the mo files? they didnt seem very editor friendly! I hope you don’t mind me asking… :>

  12. malyfred 2005-03-20 / 5.36 pm

    >joe At first you have to “gettexed” your templates - so for example in sidebar.php you need something like this:
    _e('Categories') instead of just ‘Categories’.
    Then you have to download .po file of your tranlation and add the tranlations of all string that are not in the default WP version. Then use poEdit to generate your own .mo file. And that’s it. If you want to translate categories as well - let me know - I can release plugin that I am using for that purpose.

  13. IImage Browser | skriker 2005-03-21 / 5.38 am

    […] one for you if you like 360° panoramas. If you would like to have multilingual blog - try Polyglot. Download: iimage-browser.1.4.2.zip iimage-browser.1.4.3.zip - beta - IImage Browser butt […]

  14. IImage Gallery | skriker 2005-03-22 / 1.18 pm

    […] rowser for adding images to you galleries and IImage Panorama if you like 360° panoramas! Polyglot is for those who would like to have their blog or posts in more languages. Download: iima […]

  15. Sean 2005-03-23 / 2.37 pm

    Hi Malyfred,

    I just love your plugins. Use your image plugins on http://www.seansite.net and will try out your language plugin on http://www.bandung.seansite.ne….

    But got some issues when it comes to your language plugin which I hope you can help me with (tried the address to Language Picker as mentioned in your post, but I can’t get it to work):

    1. How did you get the language link on the same line as the post date and so on? Whatever I do I get it on the line below. You can see it on http://www.bandung.seansite.ne…. Doesn’t look to nice :-/

    2. I added both english and indonesian to all posts (4) on http://www.bandung.seansite.ne…. But only the two first ones comes in indonesian if I choose that language from the sidebar. Why?

    3. Downloaded a version of indonesian, wanted to upload it to wp-includes/languages. The folder languages wasn’t there so I made it myself. Hmmmz, can’t see that It make use of my id.po file. Any idea why?

    Thanks again for your great plugins. You are abviously a gifted guy when it comes to making plugins :-). Hope that you can help me out on the issues above.

  16. malyfred 2005-03-23 / 7.53 pm

    >Sean Thank you:o)

    1) That’s a question of CSS: display: inline;

    2) I think that in your case it’s because of <!–more–> tag. Your post should look like:
    <lang_en>english bla bla</lang_en>
    <lang_xx>xx bla bla</lang_xx>
    <!--more-->
    <lang_en>english vla vla</lang_en>
    <lang_xx>xxx vla vla</lang_xx>

    3) .po is just source for .mo file and that one must be in wp-includes/languages directory. Use poEdit to generate it

  17. Sean 2005-03-24 / 4.33 am

    Malyfred,

    Thanks for your quick reply on my newbie questions :-)

    1. WHere should I add display: inline; in my style.css? Tried to add it to post-content but didn’t work, then tried to make post-content ul li and added it there but still didn’t work.

    Also tried to find others who had added this plugin to see what they have done, but can’t find any.

    Fantastic if you can help me out, if not I’ll just have to look around for a bit longer.

    2. You was right. Thank you :-)

    3. Added the .mo file now … but nothing happens.

    All this is for http://www.bandung.seansite.ne….

    Thanks again!

  18. malyfred 2005-03-24 / 9.48 pm

    >Sean
    1) you have it in: post-title so…

    3) have you added ‘id’ to the list of allowed languages?

  19. joe 2005-03-25 / 8.31 pm

    It would be great to see your plugin to do that yeah… I think I will want to translate the categories too yes. Thank you very much for sharing the info with me on how to change the titles!

  20. malyfred 2005-03-31 / 8.18 pm

    >joe I have added translate-categories.zip plugin to the download section. Try it.

  21. Moshu 2005-04-05 / 4.52 pm

    Hi malyfred,
    I tried to use this plugin, but only with half success. I mean I got it work in the post title and inside the post, using the code provided, even the link for switching languages shows up in the meta line…
    But I have problems when wanting to change the language for the whole site. As I can see on your site clicking the “cesky” in the meta lione of the post will change the language in the sidebar. That didn’t work for me.
    Also, using the code for the sidebar menu for language change gives me an error.
    Am I missing something?
    (p.s. It is not on the blog I linked in my name here, it’s on a testbed.)

  22. malyfred 2005-04-05 / 5.15 pm

    >Moshu Comment #12 doesn’t help?

  23. Moshu 2005-04-07 / 6.24 pm

    Thanks, Malyfred, but not really. I am beyond that see this.
    Anyway I’ll give it a try again, will see what happen!

  24. ken1 2005-04-10 / 7.46 pm

    hello
    ne at this and trying to install polyglot plugin on my blogsite…
    question:
    in what file should i put the htmlcode you are talking about
    /?lp_lang_pref=en”>English

    regards

  25. ken1 2005-04-10 / 7.48 pm

    äsch…grrr..
    you know what code i mean right?


    Then you can offer them to set preffered language for entire blog as well (as you see in my menu). It can be done by code like this:

    /?lp_lang_pref=en”>English

    You are supposed to use where ‘xx’ is the ISO code of language. These can be found here: ISO codes

  26. diego_moreda 2005-04-10 / 11.05 pm

    hello,

    i am having some problems with the plugins, same one as most people have. i can display the posts in several languages, but i cant display the other parts of the weblog in a localized version. furthermore, if i activate the plugin the blog localization is overriden (ie. i have set the WLANG to spanish, and the blog, web admin, etc is in spanish if the plugin is not activated; it switches back to english if activated).
    i have tried several things but nothing worked … any help would be much appreciated.

    keep the good work!

  27. malyfred 2005-04-11 / 12.24 am

    >ken1 Yes I know:o) You can put it anywhere you want. I have it in sidebar.php but it depends on you. It’s just a link that change the language when you click on it.

  28. malyfred 2005-04-11 / 12.27 am

    >diego_moreda have you set $default_lang and $knownlangs properly? Because otherwise you don’t have to do anything special to switch the language of other stuff on your page. What the Polyglot does is actually nothing more than changing the value of WLANG according to user’s preferences. You just have to use gettext in you template and put translated strings into your .po/.mo files.

  29. Christoffer Soop » Blog Archive » A Polyglot WordPress? 2005-04-15 / 12.28 pm

    […] should thus be considered as a cross-cutting concern. Update: I just found out about the Polyglot plugin which seems to do the trick. Haven’t tried it yet, but it seems promising. […]

  30. wyrfel 2005-04-15 / 7.05 pm

    Hei guys, i just found a probable solution to the problem of a non working site localization: looking at the code you’ll realize that polyglot dupes part of code that is already present in wp-i10n.php .
    Look for if ($lang_change_locale && class_exists(’streamreader’)){ and comment out everything from if ( is_readable($mofile) && ($locale != ‘en_US’) ) { tp gettext_reader($input);//fred for WP1.5 or later
    }. Then add
    load_default_textdomain(); right after that.
    That should do it.

  31. wyrfel 2005-04-15 / 7.08 pm

    Ok, more readable again:
    Before:

    if ($lang_change_locale && class_exists('streamreader')){
    $locale = $lp_lang_pref;
    $mofile = ABSPATH . WPINC . "/languages/$locale.mo";

    if ( is_readable($mofile) && ($locale != 'en_US') ) {
    $input = new FileReader($mofile);
    } else {
    $input = false;
    }

    if(get_settings('version')

    After:

    if ($lang_change_locale && class_exists('streamreader')){
    $locale = $lp_lang_pref;
    $mofile = ABSPATH . WPINC . "/languages/$locale.mo";

    load_default_textdomain();

    require(ABSPATH . WPINC . '/locale.php');
    }

  32. wyrfel 2005-04-15 / 7.09 pm

    I’m giving up, you know what i mean. ;-)

  33. wyrfel 2005-04-15 / 9.03 pm

    Also found a solution for the problem with the previous_post/next_post links… You will have to edit wp-includes/template-functions-links.php. It includes the previous_post() and next_post() functions. Within those replace $string .= wptexturize($nextpost->post_title); with $string .= wptexturize(apply_filters('the_title', $nextpost->post_title, $nextpost));. Make sure to replace $nextpost with $lastpost for the previous_post function.

  34. every little secret » Blog Archive » New plugin found 2005-04-16 / 9.27 pm

    […] 尚宮です!

    四月 17th, 2005
    New plugin found

    Polyglot 正是我想用的plugin,但似乎不是為初階用戶以設,嗯,改天要試試 […]

  35. r0n 2005-04-18 / 6.29 pm

    Hello, thank you for cooking out this great plugin! Works like a charme for my posts. However one thing with WP 1.5 puzzles me a bit: When writing “PAGES” in different languages, I´m using english and german, there´s always the german PAGE content displayed on my site. It doesn´t pick the ‘lp_lang_pref=en’ variable with PAGES. As mentioned above, POSTS are fine.. When adding ‘?lp_lang_view=en’ to PAGE link URI it´s being displayed in english. Is it because the polyglot plugin doesn´t work with WP 1.5 PAGES or am I just overlooking anything? Thanks for attention so far

  36. malyfred 2005-04-20 / 10.32 am

    >wyrfel thx. it seems that you are using night build of WP right?

  37. malyfred 2005-04-20 / 10.38 am

    >r0n It should work with pages without any problems. You just have to edit template for pages to show the links for language versions on proper place. Another hint: Have you tried ?lp_lang_pref=en?

  38. r0n 2005-04-20 / 11.23 am

    I got it: I just C&P your suggested code for global blog language preferences :
    <a>/?lp_lang_pref=en">English</a>
    : however after I removed that slash before ?lp_lang_pref=en :
    <a>?lp_lang_pref=en">English</a>
    : PAGES will be displayed in the proper language now. Thanks for your feedback, I really appreciate. Whooh, now I´m really fine with my Blog and will go online soon ;))

  39. Loïc 2005-04-21 / 4.49 am

    Comment #30 worked for me too. Titles in sidebar are translated now.

    $mofile = ABSPATH . WPINC . "/languages/$locale.mo";
    /*if ( is_readable($mofile) && ($locale != 'en_US') ) {
    $input = new FileReader($mofile);
    } else {
    $input = false;
    }

    if(get_settings('version')

  40. Loïc 2005-04-21 / 4.50 am

    end of preceding post …

    $l10n[’default’] = new gettext_reader($input);//fred for WP1.5 or later
    }*/
    load_default_textdomain();

  41. Francis 2005-04-21 / 5.24 pm

    Thank for this plugin! Very usefull. It seems to work. However, when switching from English to French, I have this message at the top a my screen before site content :

    Warning: Cannot use a scalar value as an array in d:\serveur local\easyphp1-7\www\wordpress\wp-includes\wp-l10n.php on line 74
    At the same time, all text become taller.

    Do you have a solution for me ?

  42. malyfred 2005-04-21 / 8.23 pm

    >Francis Look at Known bugs and change the code as you need.

  43. Francis 2005-04-25 / 4.32 pm

    Well Malyfred, thank you for your reply. But as a beginner,
    even passionate, and don’t understand what I should do with those
    lines of code (around line 75). I get lost. I’m using WordPress 1.5.
    Having my site fully bilingual under WordPress is crucial to me and it seems that your plugin is a must. Thank you again for your help.

  44. malyfred 2005-04-25 / 8.09 pm

    >Francis I’ve mentioned that this plugin is not for pure beginners! But anyway - the code looks like this:
    if(get_settings('version')<'1.5'){
    $l10n = new gettext_reader($input);// before WP1.5
    }
    else{
    $l10n['default'] = new gettext_reader($input);// for WP1.5 or later
    }

    But sometimes the version number detection doesn’t work. In your case you should replace all this code by :
    $l10n['default'] = new gettext_reader($input);

  45. Daniel S. Haischt 2005-04-26 / 8.06 pm

    If noone figured out already - This is the way how to localize the previous/next link in WP 1.5.

    You need to use the previous_post_link()/next_post_link() functions in your templates instead of previous_post()/next_post().

    If you take a look at the source of template-functions-links.php, you will figure that the standard previous_post() function is not using the apply_filters() function. previous_post_link() does!

    Cheers!

  46. Blog Archive | HILFE!!! 2005-04-28 / 5.05 pm

    […] aquo; Mono-what? HILFE!!! Weiß jemand, wie ich das nette plugin polyglot installiert bekomme? Bitte helft mir!!! Dieser […]

  47. Yves 2005-04-30 / 4.52 pm

    > Daniel S. Haischt comments #45
    Thank you for the Tip! It works perfectly!
    > Loic #39 and wyrfel #30
    Big thanks to you guys too.

    I struggled a bit to to manage to translate categories so here are the details:

    1) Install the plugin and activate it
    2) You have to edit the PO file for your target language (see The Codex for details). In this Po file insert your category names and their translation. Save it as a *.mo file and override the one you already have.
    3) Thats’ all. Enjoy!

    There is still the trouble of wp_list_pages() not displaying the translated page names or the fact that all the languages appears in the Archives/search pages but that might be easier to solve in version 1.5.1

    An again, thank you Jason and Malyfred for the tremendous work.

  48. Blomstereng.org - Blog » Blog Archive » LanguageSprk 2005-04-30 / 6.15 pm

    […] « Plastic Toys Sprk N har jeg ftt installert ett nytt multi sprk plugin her p blogen. S n blir det litt mer oversiktlig her. Som fr kan man ve […]

  49. Rob 2005-05-13 / 7.03 pm

    There was an XML validation problem with your plugin which was easily fixed. It involves changing the function lp_other_langs to output “&amp;” instead of “&”. Check out this url for more info:
    http://www.htmlhelp.com/tools/…

    A very good plugin otherwise. Thanks for the hard work.

  50. empdesign | Blog Archive | Plugins Wp 2005-05-16 / 6.54 pm

    […] lugin For WordPress: Permite añadir un sistema integrado de encuestas en la bitácora. Polyglot: Versión mejo […]

  51. Carlo 2005-05-19 / 3.23 am

    Your plugin works like a charm! The only problem I’m having now, is that I can’t manage to set italian as the language displayed by default (I did set ‘it’ as preferred language in Polyglot.php). I’m also forced to put even italian parts between lang tags, otherwise both versions are displayed.
    Can you suggest me a solution?

    Thanks in advance, Carlo.

  52. malyfred 2005-05-19 / 4.05 am

    >Carlo That’s not a bug that’s a feature:o) There has been left old and not-true-anymore comment for default lang.

    Current behaviour of filtering lang versions is described in the post. Every language version must be enclosed by <lang_xx> tags and unenclosed text is always shown.

    And about your ‘it’ issue - don’t forget that Polyglot gets the information about your prefered language from the browser and there is english set as default in most cases. Default language is not used if your post has appropriate language version.

  53. Carlo 2005-05-19 / 4.48 am

    malyfred, thank you for replying so quickly.
    As you can see in my blog, I managed to make it work, just by adding to my main template the code you suggested above for the global language prefs. :)
    Now everything is working as I want.
    Next step will be to make the whole blog bilingual…
    Thank you again, and keep up the great work!

    Best regards,
    Carlo.

  54. Pete 2005-05-21 / 4.16 pm

    Hola, I don’t know if its mentioned anywhere, but at least for me I had to change in wp-config.php the line
    define (’WPLANG’, ”);
    to
    define (’WPLANG’, ‘en_US’);
    (or put your own localization in), to get ?lp_lang_pref=en (or some other language) type switching working. Otherwise language switching for whole blog didn’t work, I guess it got always overwritten or something as locale.php checks for empty string.

  55. Pete 2005-05-21 / 6.58 pm

    … and I got this to work fabulously with WP-Cache by changing the cookie name in polyglot.php to wordpress_lang_pref (wp-cache searches for “wordpress”). Dunno if it is the proper way though.

  56. malyfred 2005-05-21 / 9.23 pm

    >Pete Thank you! That could be answer to many questions here. It’s also good to know that polyglot works with WP-Cache.

  57. fethiye 2005-05-22 / 10.01 pm

    thanks for this great plugin! have been using it for a while now, and now i want to add the translate-categories, but that does not seem to work. downloaded, activated it but still shows my category as a huge text including the etc tags…

  58. malyfred 2005-05-22 / 10.42 pm

    >fethiye Of course - because translate-ctagories works in a different way. You have to add translations of names of your categories to your .mo file. You cannot use tags as in your posts.

  59. fethiye 2005-05-23 / 3.21 am

    thanks for the quick response. the .mo file for my language (Turkish) does not exist. So I made a very basic .po file (containing “Categories” and one of my categories’ name) compiled it and dropped it into the multilingual subdirectory. Nothing seem to change. Seems like I am missing something easy, but what?

  60. Training Today’s Athlete » WordPress Plugins 2005-05-23 / 4.58 am

    […] ic/tools/wordpress/wp-gatekeeper.html Polyglot for multilingual posts and stuff like that. fredfred.net/skriker/index.php/ […]

  61. malyfred 2005-05-23 / 10.36 am

    >fethiye I’ve tried to download tr.mo file from your server and it seems that it is not at the proper place: wp-includes/languages/tr.mo

    Try also simple _e("your testing category") code in your template, as translate-categories could be buggy.

  62. JÄÅ Preview | skriker 2005-05-23 / 5.05 pm

    […] and activate it. P. S. You should also try these plugins: IImage Browser, IImage Gallery, Polyglot, IImage Panorama BTW do you know how to pronounce JÄÅ? No? Ok - just like this: yaeo:) […]

  63. fethiye 2005-05-24 / 11.03 pm

    Thanks a lot for your help! I just didn’t know where to put the .mo file, and could not find any info about it. Now it is in the directory you specified, but nothing changed ;( I also put the .po file there — a basic one. Maybe I am doing something wrong with that one, too!

  64. malyfred 2005-05-25 / 1.32 am

    >fethiye simplest test: do you have _e('Categories'); in your sidebar.php? .po file seems to be ok. Which version of WP do you use?

  65. fethiye 2005-05-25 / 7.11 am

    I am using WP 1.5, and yes I do have _e(’Categories’) in my sidebar.php (just double checked it). I also added that “bread” -> “ekmek” as a category in that .po file, too. Oh, yes, I do have this plugin activated as well.

    thanks again for looking into this!

  66. malyfred 2005-05-25 / 11.09 am

    >fethiye I’ve changed the code of Polyglot a bit - download it now and let me know.

  67. Sylvain 2005-05-25 / 3.23 pm

    I’m glad to see I’m not the only one who has problems w/polyglot! ;-) I’m a newbie w/WP and malyfred was really helpful when I sent him an email about the installation (thanx again, dude!). Reading through this forum I finally was able to get not only the posts, but the rest of my blog translated too (Pete’s comment #54 did it for me! Thanx, man). One weird thing, though: not all of my page gets translated (words like “Categories”, “Archives”, “Links” etc.) remain in English, even if they ARE in my .mo files, but their subcategories come out properly!?!? What’s with that? One more thing, I’ve been searching the web like a madman and read everything I could on gettext for the past week, but I still can’t figure out how to “gettext” anything. I mean, there’s not even a .exe file in the bundle I’ve downloaded!!!Would anyone care to explain this ssssssllllllloooowwwwlllyyy, please.

  68. ☆MY BLOG☆僕のブログ☆MON BLOG☆ » Blog Archive » blogging from downtown Sendai on my cellphone… 2005-05-25 / 3.25 pm

    […] rom downtown Sendai on my cellphone…

    Ain’t that awesome! (^O^)/♪

    This entry was posted

    on Tuesday, M […]

  69. malyfred 2005-05-25 / 8.02 pm

    >Sylvain OK - how to gettext anything, let’s use the word “Categories” in your sidebar.php as an example.

    Open the sidebar.php in your favourite text editor (preferably supporting UTF-8, but…). Find the word “Categories”. It can look e.g. like:
    <h3>Categories</h3>
    chage it to this:
    <h3><?php _e('Categories');?></h3>

    and you have successfully gettexed “Categories”.

  70. I did it my way » Blog Archive » Multilanguage Mehrsprachigkeit 2005-05-26 / 9.06 am

    […] hen die kein Deutsch sprechen. Damit man nicht beide Texte lesen muss hilft mir ein nettes Worpress-Plugin.

    This entry was posted

    […]

  71. fethiye 2005-05-27 / 2.25 am

    the new polygot didn’t seem to change anything…

  72. malyfred 2005-05-27 / 10.48 pm

    >fethiye hmmm - have you tried comment #54?

  73. Sylvain 2005-05-29 / 8.53 am

    >malyfred You’re the man! Thanx to you it looks like I’ll be up and running on schedule (June 1st)… One thing, though, I can’t seem to find some of the strings I’d like to “gettext”, like “Leave a comment” for example. I’ve looked in every file manually, ran a search through windows, etc. I know it must be somewhere, because you changed it to “Napsat komentář” and “Kommentera”. Sorry I’m so persistent, but I’d really like to give my readers the option to have everything in their prefered language.

  74. malyfred 2005-05-29 / 10.03 am

    >Sylvain C’mon! Try harder! comments.php and “Leave a Reply” in your current theme.

  75. The Blog of Henrik Pauli » WordPress Polyglot plugin 2005-05-29 / 6.35 pm

    […] Uncategorized — Henrik Pauli @ 18:35 One of the plugins I’m using is Polyglot, which would be good if it did a couple things differently.  One of them being showi […]

  76. r0n 2005-06-01 / 2.24 pm

    does anyone know if there´s a way to insert the currently displayed language into header meta tags?

    <META name="language" content="<?php need_function () ; ?>">

  77. malyfred 2005-06-02 / 8.52 pm

    >r0n Download the latest version of Polyglot and set $polyglot_settings['print_meta'] = true;

  78. r0n 2005-06-03 / 10.25 am

    Thanks a lot, Fred!

  79. r0n 2005-06-03 / 12.38 pm

    I´ve been running into a couple of more issues about getting the currently displayed language value (Fred may already know…) so I added two simple functions to my polyglot.php which ECHO or RETURN the ISO code:


    function polyglot_echolang(){
    global $lp_lang_pref;
    echo $lp_lang_pref;
    }

    function polyglot_returnlang(){
    global $lp_lang_pref;
    return $lp_lang_pref;
    }

    The functions seem to be working with either ?lp_lang_pref=XX or ?lp_lang_view=XX on my site.

    May be useful i.g. to offer localized RSS feeds like:

    <?php bloginfo('rss2_url'); ?>?lp_lang_view=<?php polyglot_echolang(); ?>

    or whenever one needs to offer different content for each language, like <META> description, keyword TAGs etc..

  80. De Culturis Mundi 2005-06-03 / 7.25 pm

    Multilingual blogging

    First of all: some clarification is due about the terminology. As I mentioned in one of my first posts I chose WP beacuse I loved “the possibility of writing in different languages, with different alphabets without having to think for a moment …

  81. I did it my way » Blog Archive » Pimp my Blog 2005-06-09 / 5.40 pm

    […] ines Artikels. Find ich klasse! Cat2Tag: Erstellt “Tags” aus den Kategorien. Polyglot: Ermöglicht das posten in mehreren Sprachen. OK, das geht auch so, aber dank dieses Plug […]

  82. FN 2005-06-09 / 8.43 pm

    This looks like the missing-link I’ve been looking for - however Language Picker’s site give a 404 so I really don’t know how to install this. I’m a professional PHP coder so I could do it without a problem - but my issue is where do I put the file and what inclusions are required? Sorry to add to the list of “Help Me” posts malyfred - if you have time, your direction would be appreciated :)

    -FN-

  83. FN 2005-06-09 / 9.59 pm

    Ok - I managed to get it myself - sorry for the premature plea for help. My only question left is the multi-lingual RSS Feed:

    http://nc.synergyxr.net/nema/f…

    I see in “description” is shows both the lang-en and lang-de… should it show both like that or just the one for the language the client has selected? If that feed page is right, no worries, I’m just not familiar enough with XML to know.

    Thanks again,
    -FN-

  84. r0n 2005-06-10 / 11.40 am

    FN, you should add an excerpt (=description) filter to polyglot.php


    add_filter('the_excerpt', 'lang_picker_respect_more',1);

    then you´ll get proper localized RSS Feeds

  85. Younghusband 2005-06-12 / 8.31 am

    What would put the icing on the cake is if we could make a quicktag for Lang 1 Lang 2 etc, so that we don’t have to hand type each time. Any thoughts?

  86. r0n 2005-06-12 / 4.12 pm

    Could be done by adding (for each language ISO) to your quicktags.js:

    edButtons[edButtons.length] =
    new edButton('ed_lang_xx'
    ,'lang_xx'
    ,''
    ,''
    );

  87. r0n 2005-06-12 / 4.14 pm

    ahh, sorry, should be:

    edButtons[edButtons.length] =
    new edButton('ed_lang_xx'
    ,'lang_xx'
    ,'<lang_xx>'
    ,'</lang_xx>'
    );

  88. malyfred 2005-06-13 / 2.49 am

    >r0n&FN I’ve added this fix to the current version of Polyglot.

  89. Sylvain 2005-06-20 / 9.28 am

    >Younghusband

    Try this guide, it worked great for me!

  90. besorgt. » blog.start 2005-06-24 / 12.22 pm

    […] nt in time. This blog is based on a slightly modified version of WordPress and the plugin PolyGlot by Martin Chlupac which permits multilingual entries.

    posted in the w […]

  91. Vito Tardia 2005-06-29 / 9.41 pm

    […] ruenza nell’interfaccia, almeno fino a quando non avrò imparato a destreggiarmi con Polyglot e GetText. D’altra parte se fosse facile non sarebbe altrettanto divertente e vist […]

  92. Christoffer Soop » A Polyglot WordPress? 2005-07-02 / 10.01 pm

    […] should thus be considered as a cross-cutting concern. Update: I just found out about the Polyglot plugin which seems to do the trick. Haven’t tried it yet, but it seems promising. […]

  93. seyd » Just colophoning my changelog 2005-07-18 / 9.18 am

    […] e the most recent and the two bottom ones are random. As for the languages I had installed Polyglot and worked out all the localizations ( thanks […]

  94. seyd » Just colophoning my changelog 2005-07-18 / 9.20 am

    […] e the most recent and the two bottom ones are random. As for the languages I had installed Polyglot and worked out all the localizations ( thanks Pankaj for that hi.mo file! ), but in the e […]

  95. Jiyul 2005-07-23 / 1.04 pm

    Hey, thanks for what you did!
    but…
    is multingual rss works? I think yours dont work too.

    http://fredfred.net/skriker/in…

    Am I miss understanding?

    please help me.

  96. z 2005-07-23 / 4.17 pm

    i’m trying the plugin on a new photoblog and it does the job for me. however i’m following the instructions for the rss feeds, but besides the default language, the second language rss doesn’t work. the rss feed reader keeps spitting out errors. is there anything not listed here that i may have missed?

  97. micael 2005-07-24 / 6.36 am

    hi malyfred,
    Thank you very much for this plugin.
    It’s very usefull.
    unfortunatly, the list_cats of the translate-categories plugin don’t work …
    First I increase the number of allowed characters of “cat_name” in the database. (because titles were cutted)
    I try to touch this with no success:
    add_filter(’list_cats’,'translate_link’);
    or add some _e() in my sidebar.

    I see list_cats translation of your site work.
    Can you give me a way of work please?
    Thanks.

  98. micael 2005-07-24 / 9.01 am

    hmmm, “cat_name” don’t allow html tags.
    so, something like cat_encat_fr
    will don’t work in “list_cats”. It’s sure…

  99. micael 2005-07-26 / 12.56 am

    I found the solution:
    I remove all the “wp_specialchars” relative to “cat_name” in wp-admin/categories.php

    for example:
    $cat_name = wp_specialchars($_POST['cat_name']);
    become
    $cat_name = $_POST['cat_name'];

    now, I have a HTML render inside my “wp_list_cats” and the polyglot plugin understand it.
    Coool.

  100. malyfred 2005-07-26 / 5.23 pm

    >Jiyul&z I’m sorry that the instructions for RSS localization are not as clear as they could be. You have to use URL like this:
    http://addressofyourweb/?feed=…

  101. Rauru Blog » Blog Archive » Polyglot 2005-07-27 / 5.31 pm

    […] anohito on Thursday, July 28th, 2005 at 0:25 Now testing Polyglot, a plugin that enables to post in multiple languages. You can follow any […]

  102. Metabolik BioHacklab » Blog Archive » Wordpress multilingüe 2005-07-28 / 11.29 am

    […] a y castellano. Es muy f�cil! Hay que descargarse un plugin llamado Polyglot. El caso es que dicho plugin al parecer no contempla el idioma euskara (eu) as� que un co […]

  103. ptryk 2005-08-01 / 4.25 pm

    ran into something i can’t seem to fix.. i am using a plugin to fix menu’s from pages..

    well.. when i am in a page, and if someone should change the language, .. it puts them back to the index page.. also i get a database error when using
    get_page_link() or get_permalink() used e.g…


    /?lp_lang_pref=en”>[en]

    looks like the plugin can’t concoctenate?

  104. iLBorro’s blog » Wordpress multilingua? 2005-08-03 / 12.18 pm

    […] post possa essere sia in italiano che in inglese? La cosa sembra essere semplice grazie a questo plugin. Lo proverò, e vi terrò informati Nessu […]

  105. freshlabs — Wordpress multilanguage 2005-08-06 / 11.26 am

    […] Bislang habe ich zwei davon ausprobiert: Polyglot (Autor URI: http://fredfred.net/skriker/in…) Polyglot erlaubt es, die Sprache in einem Post mi […]

  106. malyfred 2005-08-09 / 10.58 pm

    >ptryk Don’t forget that you cannot use: ?lp_lang... with any kind of mod_rewrite or permalinks:(

  107. Netlex News » Blog Archive » test 2005-08-16 / 9.17 pm

    […] test Internationalisation Basic bilingual : installed Multilingual Polyglot This entry was posted on Tuesday, August 16th, 20 […]

  108. dan 2005-08-21 / 2.33 pm

    wow, great plugin! just what I want :-), Great Thanks!

  109. Valet och kvalet… at Spacewaster 2005-08-24 / 3.35 pm

    […] Uppdatering: Gjorde en snabb sökning, och hittade Polyglot, ska kolla bättre hur det fungerar i morgon. […]

  110. Bilingual at Spacewaster 2005-08-24 / 9.40 pm

    […] I’ve now installed the Polyglot plug-in, but there’s some problems as you might see… I’m working on a solution. […]

  111. Len » Blog Archive » Kadishtu 1.1 2005-08-31 / 12.57 pm

    […] Je teste un plugin d’i18n appellé Polyglot donc j’ai inclus une barre de menu de langage au thème et fait d’autres petits changements. […]

  112. Bilingual at Spacewaster 2005-09-06 / 12.48 pm

    […] now installed the Polyglot plug-in, but there’s some problems as you might see… I’m working on a solution. Jag har nu installerat Polyglot, men som du kanske mker r det liteproblem… jobbar med felskningen.   #     […]

  113. Fixed the language 2005-09-09 / 9.04 am

    […] Fixed the language, found out that it was a clash between Polyglot and PreFormatted, sadly Polyglot doesn’t work with my “Besides” blog-thingy. Have to look into that. Found another “clash”, Brian’s Latest comments didn’t want to translate… […]

  114. Fairweb 2005-09-16 / 10.36 am

    Adaptation et adoption du plugin Polyglot

    On m’a demandé d’adapter le bilinguisme sur un site réalisé avec Wordpress. Inutile de réinventer le monde. Wordpress est open source et on ne développe des plugins que lorsqu’on ne les trouve pas ailleurs. J’ai testé plu…

  115. Agaponeo's 2005-09-18 / 6.58 pm

    Problems with language

    Thanks at the plugin of malyfred for WordPress, now I can write in some languages, so the people can read in his language.
    But I think in this way I will get more confused with the languages, that I already get always confused with them (who meet me, …

  116. Agaponeo 2005-09-19 / 10.41 am

    HI.. thanks for this plugin…
    But I can’t get working the translate categories… really I don’t know how translate them… (the archives works well)
    and in the side bar… the tags doesn’t work for me :(…
    any clue?

    thanks again for this plugin :)

  117. malyfred 2005-09-19 / 1.08 pm

    Agaponeo> Tags in the sidebar seem to be ok. They look like they should and they work for me. Only problem I have noticed is that you’ve left some spaces or UTF BOM in the polyglot.php so you get warning at the very begining of every page.

    Translate categories plugin is very unreliable because it works in a very dirty way and probably only with wp_list_cats():( Unfortunately I have not found better way yet.

  118. Trackback 2005-09-19 / 1.19 pm

    Trackback: http://dongchimi.org/wp/?p=20

  119. El Rincón de Boriel » Boriel’s blog goes bilingualEl blog de Boriel se vuelve bilingüe 2005-09-19 / 2.00 pm

    […] Now, and thanks to the polyglot plugin for Wordpress, this site will be (whereever possible) in both languages, English and Spanish (and apologies for English grammar/spell mistakes ). […]

  120. Agaponeo 2005-09-19 / 7.42 pm

    Sorry.. I made some mistake.. can you delete the upper post? :)

    Thanks… but… the warning was for another plugin conflict that I resolved…

    The thing may be is that in the sidebar there is no this code –?php if(function_exists(’lp_other_langs’)) {
    //display existing language versions of the post
    lp_other_langs(’ ‘,”, ”, ”, ”);
    }?–

    do you think that can be that…?

    (sorry my english)

  121. malyfred 2005-09-19 / 8.16 pm

    Dear Agaponeo, I have checked your site twice and it looks exactly as it should. And it even works!:) So what is exactly your problem? What kind of different behaviour do you expect?

  122. Agaponeo 2005-09-21 / 10.17 am

    Sorry… for bother you…
    I wanted to be able to change the language in the sidebar, just some small content.

    But no problem. and like always thanks for the plugin.
    (is a little tyring write in many languages :S )

    bye bye

  123. malyfred 2005-09-21 / 12.18 pm

    Agaponeo> Maybe I’ve got it finally - you want to have some ‘content’ in the sidebar in different languages? Easy!

    1) ‘gettext’ it: _e('some text');

    2) add this translation into your .mo files

  124. Marc 2005-09-22 / 9.49 am

    Hello malyfred,

    first off, thanks for creating the currently only stable multilingual extension to WordPress. It has already helped me a lot. :-)

    One thing bothers me, tho - not being able to translate page titles yet. “translate-categories” works great, I just wished it would also do so for pages. Do I understand correctly that it cannot work because WordPress doesn’t offer an appropriate filter hook for wp_list_pages? Does the WordPress beta version do so, or do you have any other idea to solve that?

    Thanks for your help,
    Marc

  125. malyfred 2005-09-22 / 11.56 am

    Marc> Add this hook to your plugin:

    add_filter('wp_list_pages', 'lang_picker_respect_more',1);

    or re-download Polyglot. It’s not perfect because titles of genereated links stay untranslated, but…

    You can now translate page titles in exactly same way as post titles.

    example:
    <lang_en>English title</lang_en><lang_cs>Český název</lang_cs>

    It doesn’t look translated in administration (WP bug) but it works fine on the final page.

  126. Marc 2005-09-22 / 4.33 pm

    Well, that’s a start, thanks indeed! :-) Translating the links as well will require a new WordPress core filter hook, right? Like that I’d have already created a “translate-cats-and-pages” plugin… ;-)

    Regards,
    Marc

  127. Secretservices Performance Blog 2005-09-22 / 6.49 pm

    Mehrsprachig….Polyglot

    Um mein Blog mehrsprachig anzubieten, habe ich auf das Plugin Polyglot zurückgegriffen. Das funktioniert für die Artikel, wie hier wohl auch zu sehen, recht gut. Das Manko liegt darin, daß die Menüleiste nicht genauso einfach übersetzt werden kan…

  128. Agaponeo 2005-09-22 / 8.24 pm

    thanks for your patient.. and for undestandme what I wanted…
    sad is that I Think I can’t exec, i tryed some code that I find but the wordpress gettexec page didn’t really helped…

    Another thing.. Nice the new plugin ;)

  129. malyfred 2005-09-23 / 12.00 am

    Marc> Could you test the latest version of Polyglot? You don’t need any plugin for translating categories/pages anymore. But for links… yes, you are right, we need a new hook:(

  130. Agaponeo 2005-09-24 / 2.32 am

    I think I’m annoying… :)
    well Thanks for averyting and for this awesome plugin…
    I manage everything… (Is just some time to learn code ;) ). I get well with gettexec now… and how to edit po, pot & mo files… so now I have my traductions how I like them :)

    Sincerly Thank you again.

  131. Vito Tardia 2005-09-29 / 2.02 pm

    […] Siccome ho intenzione di scrivere sia in inglese che in italiano, è probabile che ci sia qualche incongruenza nell’interfaccia, almeno fino a che non sarò riuscito a integrare al meglio Polyglot e GetText. Lo sapevo che dopo i primi esperimenti su Blogger la mi curiosità mi avrebbe diretto verso WordPress. Quindi, visto che da qualche parte si deve pur cominciare, ho comiciato con l’installarlo e pasticciare un po’ con il codice…stupendo! Leggi » […]

  132. Marc 2005-09-29 / 10.18 pm

    malyfred,

    Pages work fine, thank you, but without the links it’s not really enough for me yet. Anyway, thanks for confirming my suspicions - I’m still quite of a WP-n00b, so that helps my ego a little. ;-)

    Marc

  133. Goulven 2005-09-30 / 7.50 pm

    Excellent plug-in. I use it for my site in english, french and arabic. I have a problem with arabic because the tag at the beginning of the page must have the dir=”rtl” parameter when other languages must have dir”ltr”.

    Is it possible to complete the plug-in with this parameter?

    Thanks and thanks again for your plug-in!

  134. malyfred 2005-09-30 / 11.59 pm

    Goulven> If I understand the concept of ‘ltr’ and ‘rtl’ codes - it must be specified in <html> tag and that cannot be done automaticaly because there is no Wordpress hook for that.

    But you can put this code to your header.php file:


    <html

    <?php
    if(polyglot_get_lang() == 'ar'){
    echo 'dir="rtl"';}
    ?>
    >

    Don’t forget to re-download Polyglot.zip because polyglot_get_lang() function has been added recently.

  135. malyfred 2005-10-03 / 11.03 pm

    ALL> I’ve noticed the WP/PHP bug in WP 1.5.2 and PHP 4.4.0. You have to fix gettext.php like this:

    //$MAGIC1 = (int)0x950412de; //bug in PHP 5
    //$MAGIC1 = (int) - 1794895138; //bug in PHP 4.4.0
    $MAGIC1 = 2500072158;

    //$MAGIC2 = (int)0xde120495; //bug
    //$MAGIC2 = (int) - 569244523;// bug in PHP 4.4.0
    $MAGIC2 = 3725722773;

  136. Goulven 2005-10-04 / 9.33 am

    malyfred> Thanks, it’s working!

  137. Tom 2005-10-13 / 3.17 pm

    I searching a way to translate categories in the RSS . Content of the post is correctly translated but not the categories… I tried some add_filter but no ways :(
    Any ideas ?

    PS: I updated my polyglot.php (don’t what had change) but I updated ;) I ought be nice to recall this version 0.5 because there is approx more than 100 new lines. But I understand that you’re probably overbooked.

    Always a great work/job! Thanks!
    Tom

  138. Tom 2005-10-13 / 3.50 pm

    I have consider a bit and here is the solution.
    Just add these following line to your translate-categories.php :


    function translate_the_category_rss($text){

    return preg_replace_callback('/()(.*?)()/i','translate_callback',$text);
    }
    add_filter('the_category_rss', 'translate_the_category_rss', 1);

  139. malyfred 2005-10-13 / 5.33 pm

    Tom> Thank you! I’ve added this fix to “official” version. But this version should be enough:


    add_filter('the_category_rss','__',1);

  140. Mateusz Łoskot 2005-10-15 / 5.17 am

    Hi,

    First, thanks guys for your great work and Polyglot plugin.

    Here is my small customization I called “Polyglot with flags” (down on the page):

    http://mateusz.loskot.net/proj…

    and it displays small flags instead of text label to indicate what languages are available for some post/page.
    You can configure it to use flags or text labels.

    I believe Martin you don’t mind I put it on my page to download :-)

    I added a few lines of code and big set of flags from http://www.crwflags.com/fotw/f… (with minor file names customization).
    More information is availabile in my comments in the code and README.txt file in archive on my website.

    I also have some problem, but I think it is a general problem or I don’t underdstant something :)
    Here is one of my posts in polish language and there is no english content for it, only polish, but as you see there is english flag (or text label) as available language:
    http://mateusz.loskot.net/2005…

    I have defined english as my default language, but I expect that if I put some post only in polish then only polish flag is visible. Am I right?

    Could you explain me this behaviour?
    What exactly default language means? Browser language or WP language?
    Cheers

  141. Tomkun 2005-10-15 / 6.35 am

    I downloaded this plugin yesterday and have got it working (mostly), but I have a problem when using it with firefox.

    In IE, everything is as it should be and when I navigate to a page, it remembers the language settings.

    But in firefox, when navigating to a page it ‘forgets’ what language it should be in and goes back to English. Anybody know of a fix for this? I am assuming it’s not a problem because it works fine in IE. It’s just that I personally use Firefox and it’s a pain in the bum!

    You can see what I mean here
    http://www.tensamurai.com

    Thanks :-)

  142. Tomkun 2005-10-15 / 7.18 am

    Oops! Never mind about that last request… It was my error!

  143. Tensamurai 2005-10-15 / 9.07 am

    Language

    Today, I spent a lot of time making sure that the different language interfaces work. Now the site is available in English and Japanese. It took a really long time to get everything working the way I wanted it to, but now I am fairly happy with it. …

  144. Tensamurai » Blog Archive » Language言葉 2005-10-15 / 9.11 am

    […] right now! The plugin is available from here. Posted by Tomkun under General | Permalink | Trackback | « English!| […]

  145. Mateusz Łoskot 2005-10-15 / 5.19 pm

    About problem described in my comment #140

    So, here is step-by-step desc of my problem.
    May be someone will be able to give a piece of advice.

    1. My Firefox has selected polish language as default (first on languages list in FF configuration). I have also selected english (placed on the langs list below polish).

    2. English is default language for my WP installation

    3. Most of my blog posts are in english and very few in polish

    4. Example of post in polish in my blog:
    http://mateusz.loskot.net/2005…

    5. What is wrong in my opinion?
    Why there is english flag below title header of my post in polish? I have no .. block of content, only …

    Here is another post which is available in both langauges: polish and english:

    http://mateusz.loskot.net/2005…

    and certainly it works perfectly, I see polish version and english flag, but when I see english version I have polish flag.

    The question is:
    Why I have english flag for post which is available ONLY in polish?

    Thanks for any help

  146. malyfred 2005-10-16 / 12.06 am

    Mateusz Łoskot> That’s a bug and I’ve fixed it in “official” version. Thanx for report.

    Btw I consider “taging” of one language posts as very problematic, because you get empty post if your default language and currently selected language are different than the language of the post. I wouldn’t recommend you doing that.

  147. Mateusz Łoskot 2005-10-16 / 12.31 am

    malyfred> I understand. Yes, I see having only one lang of post is a bit problematic, but I think it shouldn’t be difficult to solve. I’ll try to look at this but now I have not much time :-(
    Where I find official version? I could put this fix to my Polyglot-with-flags ;-)
    BTW, what do you think about my customization of Polyglot?

  148. malyfred 2005-10-16 / 1.10 am

    Mateusz Łoskot> Official version ~ re-download it from this page.

    One version language “issue” is actually quite difficult to solve as there is no obvious expected behaviour. Some people prefere current behaviour (as I do), some other would expect some text shown all the time. This problem gets bigger with two, three,… languages when the default language version is not present. Which version is the right one then?

  149. Mateusz Łoskot 2005-10-16 / 3.15 am

    malyfred> This problem gets bigger with two, three,…languages when the default language version is not present.

    Yes you’re right, I’m convinced.

    malyfred> Which version is the right one then?

    What do you mean? Version of what?

  150. malyfred 2005-10-16 / 7.42 pm

    Mateusz Łoskot> Language version…:)

  151. Mateusz Łoskot 2005-10-16 / 9.33 pm

    malyfred> Mateusz Łoskot> Language version…:)

    Oh, I see ;-)
    English is default language for my website.
    But as you suggested, I decided provide both versoins - pl, en - and i.e. if some of my post is in polish then I put short information as here:
    http://mateusz.loskot.net/2005…

    Not very elegant, but does not confuse users.

    And what about polyglot-with-flags?

  152. malyfred 2005-10-17 / 2.16 am

    Mateusz Łoskot> Well, I haven’t found any useful information about copyright of these flags.

    I take your version as a kind of “suggestion” what could be implemented to Polyglot in next version. Let me know if you have details about flags copyright issue.

  153. jesse 2005-10-18 / 8.54 pm

    hey Malyfred et al!
    thanks for such a useful blogging tool. The only thing that’s really driving me crazy is that only some of my page titles respond to the tags. Some work, others don’t.. Any ideas/suggestions?

  154. malyfred 2005-10-18 / 10.27 pm

    jesse> Do you use the latest version of Polyglot?

  155. jesse 2005-10-18 / 11.19 pm

    yes, i believe so. The one linked up top, correct? I also followed your advice in post 125 and added the following hook:

    add_filter(’wp_list_pages’, ‘lang_picker_respect_more’,1);

  156. malyfred 2005-10-18 / 11.51 pm

    jesse> Re-download it now just to be sure. There have been many things done about pages and related stuff recently and I’ve released new version (0.6) today.

    Which parameters do you pass to your wp_list_pages()?

  157. jesse 2005-10-19 / 12.30 am

    i just re-downloaded it, to no avail. I’m not sure where to check on which parameters i pass to my wp_list_pages()
    I’m only moderatly familiar with PHP/wordpress, I’m afraid! I realize that you put up a disclaimer regarding us newbies using this pluggin, but I am very grateful for your help.

  158. malyfred 2005-10-19 / 12.42 am

    jesse> You are calling wp_list_pages() somewhere in your theme. And there is some “stuff” between brackets. I’d like to know this stuff to be able to simulate it on my server.

  159. jesse 2005-10-19 / 12.50 am

    i see. I’m using the blix theme and haven’t made any significant changes: http://www.kingcosmonaut.de/bl…

    Hopefully you’ll find some answers there..

    Or is there anywhere I should be looking in particular? Like the Index.php page or something?

  160. malyfred 2005-10-19 / 2.14 pm

    jesse> There are about 10 files in the theme… is it that hard to check all of them?

  161. jesse 2005-10-20 / 12.18 am

    ok! I finally found it in the sidebar.php page. It is coded as follows:

  162. jesse 2005-10-20 / 12.20 am

    In between the brackets after wp_list_pages is written: ‘title_li=&sort_column=menu_order&exclude=’.$excluded

  163. malyfred 2005-10-20 / 1.11 am

    jesse> That seems ok:( Have you tried to deactivete all other plugins? It could be some plugins collision.

  164. jesse 2005-10-20 / 3.20 am

    yeah, i tried that :(

    I’m afraid it may just be over my head, but I’ll keep digging for an answer. Thanks for taking a look at it!

  165. Mateusz Łoskot 2005-10-23 / 12.51 am

    Hi malyfred!
    I sent some quoestions about copyrights of flags I use in my Polyglot customization.
    Here are two responses I got from Rob Raeside from FOTW (http://www.crwflags.com/fotw/)

    Here for my first question for copyrights explanation:

    ###########################################
    Hi Mateusz,
    You are welcome to use the images from FOTW provided you don’t end
    up selling them (i.e. “no commercial use”). For open source purpose,
    all we ask is that the source of the images be provided in the acknowledgements areas.

    Rob Raeside
    Director, Flags of the World,
    Wolfville, Nova Scotia, Canada
    http://flagspot.net

    ###########################################

    and second for more details about that acknowledgements:

    ###########################################
    Hi again, Mateusz,
    You should indicate something along the lines of “all flag images
    courtesy of FOTW (http://flagspot.net). For re-use of images, please
    see http://flagspot.net/flags/disc….”

    I can’t guarantee every image on FOTW is owned by FOTW for copyright
    purposes, but certainly all the national and state ones are. So
    unless you re-use an image that states it was provided by a third
    party, you would be OK with this statement.


    Rob Raeside
    Director, Flags of the World,
    Wolfville, Nova Scotia, Canada
    http://flagspot.net
    ###########################################

    So, what do you think now about flags in Polyglot?

  166. malyfred 2005-10-23 / 10.54 am

    Mateusz Łoskot> I’ve already implemented this “flag feature” as a part of big refurbishment of Polyglot’s code last week.

    I’ve used flags from GPL project http://www.phpmyvisites.net/

    But thank you for your idea and work!

  167. Mateusz Łoskot 2005-10-23 / 4.09 pm

    So, are you going to release Polyglot with those flags from phpMyVisities?
    I’m strongly interested.

  168. malyfred 2005-10-23 / 7.36 pm

    Mateusz Łoskot> Download Polyglot ver. 0.6 and you’ll see the flash of the future:))

  169. Tomkun 2005-10-24 / 1.35 pm

    Help!

    I am having serious trouble with this plug-in. Every time I try to switch to Japanese, I get this error:

    Fatal error: Cannot instantiate non-existent class: cachedfilereader in /home/tensamur/public_html/wp-includes/wp-l10n.php on line 72

    I didn’t used to have this problem, but it suddenly sprung up.

    I have reinstalled Wordpress, and the latest version of Polyglot (0.6), but I still can’t solve it.

    Anybody got any advice?

  170. Tomkun 2005-10-24 / 1.46 pm

    Oops…

    Sorry to waste your time. I edited the wrong file.

    wp-settings.php instead of wp-config.php

    SORRY! It’s all working perfectly now!

  171. Djuki 2005-10-26 / 11.07 pm

    
    Warning: Cannot modify header information - headers already sent by (output started at /home/djuki/public_html/djuki/blog/wp-content/plugins/polyglot/polyglot.php:1) in /home/djuki/public_html/djuki/blog/wp-admin/admin.php on line 10

    Warning: Cannot modify header information - headers already sent by (output started at /home/djuki/public_html/djuki/blog/wp-content/plugins/polyglot/polyglot.php:1) in /home/djuki/public_html/djuki/blog/wp-admin/admin.php on line 11

    Warning: Cannot modify header information - headers already sent by (output started at /home/djuki/public_html/djuki/blog/wp-content/plugins/polyglot/polyglot.php:1) in /home/djuki/public_html/djuki/blog/wp-admin/admin.php on line 12

    Warning: Cannot modify header information - headers already sent by (output started at /home/djuki/public_html/djuki/blog/wp-content/plugins/polyglot/polyglot.php:1) in /home/djuki/public_html/djuki/blog/wp-admin/admin.php on line 13

    I have this errors after instaling new version of this plygin. Can u hel me ?

  172. malyfred 2005-10-27 / 12.35 am

    djuki> You have obviously left some characters before <?php when you were editing polyglot.php. This can be even just UTF-8 BOM. You should use UTF-8 compliant editor where you have to turn the BOM off.

  173. Djuki 2005-10-27 / 11.21 am

    No i did not left caracters before

  174. Djuki 2005-10-27 / 11.24 am

    No i dod not lef some characters before php

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/djuki/public_html/djuki/blog/wp-content/plugins/polyglot.php:1) in /home/djuki/public_html/djuki/blog/wp-content/themes/Blue_Radiant/index.php on line 3

    I use sessions in mz blog, can thet be problem.

    And i use windows-1250 charcter coding.

  175. Erik 2005-11-01 / 11.43 pm

    I’m having some trouble with this plugin. I have uploaded the .mo files to the /wp-includes/languages/ directory, so that should be ok, and the other files needed (I think anyway, I uploaded the files in the downloade zip to the plugins directory, and it shows up in the admin panel).
    I added this piece of code to the php files,
    ', '', '', '');
    }?>

    but nothing happens. I’ve translated one post, but when I click the flag I get the post without my translation again. Do I have to add more code, did I add it in a wrong way or could I have made any other mistake? I’m not that sure just where to add it in the templates, but I have added it anyway.

  176. Erik 2005-11-01 / 11.47 pm

    Oops, the code didn’t show up very well.

    ‘, ”, ”, ”);
    }?>

  177. Erik 2005-11-01 / 11.49 pm

    Sorry, please delete that… anyway it was the code you provided above, after:
    If you put to your index.php (and single.php, search.php etc.) in your themes something like this:

  178. malyfred 2005-11-02 / 12.22 am

    Erik> It seems that you have set $polyglot_settings['lang_rewrite'] = true; haven’t you?

    Turn it off and let me know.

  179. Tomkun 2005-11-02 / 1.41 pm

    Is there a way of getting this to work with the folding page menu plugin? I tried that and it appears broken (It displays both languages). I guess it would be a simple fix for those with a talent at this sort of thing, but unfortunately, I am not one of them!

  180. malyfred 2005-11-02 / 2.36 pm

    Tomkun> Send me a link to that plugin and I’ll check it.

  181. Erik 2005-11-02 / 11.12 pm

    Thanks malyfred, I had. I turned it off and now it works alright. Just one thing though, now it shows up like a vertical list below the title of the post. Can you tell me how to take away the list-thing and put it on the same line as the title?

  182. malyfred 2005-11-02 / 11.51 pm

    Erik> Use:

    .inlinetitle ul {display: inline;}

    in your CSS file or call the function for generating of this list without list tags:


    <?php if(function_exists('lp_other_langs')) {
    //display existing language versions of the post
    lp_other_langs(' ',' ', ' ', ' ', ' ');
    }?>

  183. IImage Browser | skriker 2005-11-03 / 12.11 am

    […] Polyglot […]

  184. IImage Gallery | skriker 2005-11-03 / 12.14 am

    […] Polyglot […]

  185. Tomkun 2005-11-03 / 3.30 am

    OK, here’s the link…
    http://www.webspaceworks.com/r…
    If you can get it to work, I will be forever in your debt!

  186. malyfred 2005-11-03 / 1.45 pm

    Tomkun> Try to replace:

    $page_tree[$page->ID]['title'] = $page->post_title;

    in fold_page_list.php

    with:

    $page_tree[$page->ID]['title'] = apply_filters('the_title', $page->post_title);

    I haven’t tested this fix but it should work.

  187. Erik 2005-11-03 / 11.59 pm

    Thanks again, works good now.

  188. Tomkun 2005-11-04 / 1.32 am

    Thanks so much, that works perfectly. You are indeed a superstar.

  189. Thomas Augustsson 2005-11-06 / 6.07 pm

    I got really excited when I read about this plugin but I cant download it. Neither the original link or the mirror seem to be able to provide the file for me. Can anyoune mail or point to another source for the file so I can evaluate the plugin, it could be just what I am after.
    Thanks!

  190. Steven Greenwood 2005-11-07 / 7.12 pm

    I also had the “Warning: Cannot modify header information” error

    Solution: Use a UTF-8 editor like SuperEdi (http://www.wolosoft.com/en/superedi/)
    I was using Notepad

  191. malyfred 2005-11-07 / 7.21 pm

    Djuki> You can use Win-1250 as you want, but polyglot.php (and the rest of WP) is saved in UTF-8. So try to use Steven’s suggestion and edit polyglot.php with SuperEdi.

  192. Steven Greenwood 2005-11-08 / 1.05 pm

    malyfred, I am having trouble with the rewrite, that you describe in the polyglot.php. i.e.
    RewriteRule ^(.*)/xx/?$ /$1?lp_lang_view=xx [QSA]

    I have added:
    RewriteRule ^(.*)/de/?$ /$1?lp_lang_view=de [QSA]e
    to my .htaccess.

    I am using the standard Permalink Structure:
    /%year%/%monthnum%/�y%/%postname%/
    However the ‘deutsch’ link still resolves to:
    fluxmedia.de/?lp_lang_pref=de&page_id=6
    any ideas?
    thanks

  193. malyfred 2005-11-08 / 1.44 pm

    Steven Greenwood>
    Have you set:

    $polyglot_settings['lang_rewrite'] = true; ?

    I’m not allowed to use mod_rewrite on my webhosting so I cannot test it:(

  194. Steven Greenwood 2005-11-08 / 3.07 pm

    Yes, looks like this:
    $polyglot_settings[’lang_rewrite’] = true;

    RewriteRules look like this:
    RewriteRule ^(.*)/de/?$ /$1?lp_lang_view=de [QSA]
    RewriteRule ^(.*)/en/?$ /$1?lp_lang_view=en [QSA]

  195. malyfred 2005-11-08 / 8.52 pm

    Steven Greenwood> Re-download polyglot.zip because I’ve added some code related to this issue.

    I think that the main problem is in the RewriteRules… WP is using now a complicated system or generated rules and you should add more rules than just two and these should be more sophisticated. I cannot help you with this because I’m not allowed to use mod_rewrite on my server:( Try to ask your admin for help.

  196. trevor 2005-11-09 / 12.36 am

    This is a great plugin, but I’d just like to follow up Diego’s point of 10/4/2005. He’s having the same problem I’m experiencing: turning on the plugin overrides the localization choice of the administration interface, imposing English. Is there any way to use the plugin without doing this?

  197. trevor 2005-11-09 / 12.41 am

    Sorry for the stoopid question, just realised the answer was below D’s query. Thankyou…

  198. PDLib Blog » Bienvenidos! 2005-11-10 / 12.59 am

    […] Postear en varios idiomas Technorati Tags: PDLibBlog Tags […]

  199. MoebiuZ 2005-11-11 / 8.39 am

    Hi malyfred!

    I have found 2 little problems in Polyglot.

    If you click over a categorie (translated with tags) in the Title bar of the navigator you see:

    TitleTtle

    If you do same clicking over the title of a post, then you get in the title bar:

    TitleTitle

    There is any solution for that?

    You can see the problem here.

    Thx

  200. MoebiuZ 2005-11-11 / 8.41 am

    In the first example I mean

    lang_enTitle/lang_en lang_xxTitle/lang_en

  201. Daniele 2005-11-11 / 4.07 pm

    I have a problem
    because I installed Chen press to have an editor
    but If I write the code:
    prova

    when I save It has coverted in:
    prova

    so the plugin don’t work

    If I desactive chen press it goes
    have you any suggestion?

    DANIELE

  202. malyfred 2005-11-12 / 4.07 pm

    Daniele> If you know PHP at least a bit - then you can switch from <lang_xx> to and it will work fine. But you have to rewrite few lines in the polyglot.php.

  203. malyfred 2005-11-12 / 4.20 pm

    MoebiuZ> Find this code:


    if (is_single() || is_page()) {
    $title = strip_tags( $posts[0]->post_title );
    $title = apply_filters('single_post_title', $title);
    }

    in template-functions-general.php to:


    if (is_single() || is_page()) {
    $title = $posts[0]->post_title;
    $title = apply_filters('single_post_title', $title);
    $title = strip_tags($title);
    }

    I haven’t experienced such error when selecting category.

  204. Daniele 2005-11-14 / 6.04 pm

    Thank you
    I have desactived Chen Press
    then I’m going to find another editor (what do you use??)

    Your plugin is ideal for a multilanguage blog

    I have only a little problem

    some flags doesn’t want to appear:

    http://www.ottonovedue.com/wor…

    have you any ideas about?
    Thanks Daniele

  205. Daniele 2005-11-14 / 6.05 pm

    and then
    I’am italian how can I set my language to default

  206. malyfred 2005-11-14 / 7.18 pm

    Daniele> Open polyglot.php and you’ll see the answers to all your questions. You have to edit:

    $polyglot_settings['default_lang']

    and add

    $polyglot_settings['flags']['xx']
    $polyglot_settings['trans']['xx']

    for languages that are not specified yet.

    The most of languages are missing because I don’t know how they are called. E.g. “Portuguese” in Portuguese:) And also some people would prefer to have Brazilian flag for Portuguese instead of Portuguese flag etc.

  207. Daniele 2005-11-15 / 11.00 am

    Great

    Thank you very much
    in the next days I will try to insert yor plugin in other part of my blog

    Daniele

  208. Pierre 2005-11-15 / 12.16 pm

    Very nice plugin, but I have 2 problems (I’m 100% newbie, though):

    1. I’m unable to implement the language picker in index.php. Somehow the post’s title disappears and my sidebar is pushed to the bottom (I’m using the default template, by the way).

    2. I was able to put the language picker on my sidebar, but it looks like the selection is not kept in memory. Example: I’m on the homepage, I select “french”. The posts display in french, as expected. Now I click on a post’s title and in “post view” (or whatever you call it), the post is still in french. BUT if I now click on my blog’s title to go back to the main page, the posts are displayed in the default language again (instead of french).

    Any help would be much appreciated.

    P.S. As a sidenote, can I install the plugin within a subfolder of the plugins folder? All of my plugins are in the root “plugin” folder and it’s getting confusing. + can I do the same with all plugins (i.e. install them in their separate subfolder)?

  209. malyfred 2005-11-15 / 1.58 pm

    Pierre> Let’s start from the end - yes, you can install plugins in the subfolders.

    2. The selection is saved in cookie so there could be problem with settings in your browser or collision with some other plugin (don’t you use some caching plugin?)

    1. This is strange - send me a link to that page.

  210. Daniele 2005-11-15 / 3.41 pm

    It’s very strange

    the setup of my wordpressblog is in italian language but when I active your plugin It return in english

  211. Pierre 2005-11-15 / 4.47 pm

    Thanks for your quick reply, malyfred!

    1. Language selection using sidebar:

    I’m using the following other plugins:
    Adhesive
    Event Calendar
    Registered Only
    Subscribe2
    iimage browser (now deactivated)
    (and of course Polyglot)

    I deactivated iimage browser, because it doesn’t work properly (I suspect my company browser doesn’t accept javascript and this is the reason it doesn’t work).

    2. Language selector within index.php:
    Where exactly should I paste this code?
    ‘, ”, ”, ”);
    }?>

    I’m sending you testuser account credentials by mail, as well as my index.php prototype which doesn’t work.

  212. malyfred 2005-11-15 / 8.36 pm

    Daniele> Because Polyglot takes over the language settings… you should read Comment #206 more carefully.

    It also depends on your browser language settings because Polyglot respects the main language set in the browser as your prefered one.

  213. Thomas 2005-11-15 / 8.54 pm

    Hi! The plugin works wonderful. Merci!

    I have merely some remaining problems with the PAGE titles. There is no problem if I use OrganizationsOrganisationen but it does not understand my changes in the po/ mo file (which works fine with hte categories, e.g. wp_list_pages).

    Any idea?

    Cheers, Thomas

  214. Thomas 2005-11-15 / 8.56 pm

    ups, OrganizationsOrganisationen refers to

  215. Thomas 2005-11-15 / 8.58 pm

    last trial: lang-tag

  216. malyfred 2005-11-15 / 8.59 pm

    Pierre> I’ve checked your site and everything works fine!

    When you pick from the language offer in the sidebar - then the selection should be saved in the user’s cookie and he gets content in this language until he selects another one. It works for me so you should check your browser’s cookie settings.

    Also the languages offered for every post work fine. When you pick from this offer it just shows the post in selected language but this choice is not saved!

    And to answer your last question from your e-mail - Comments #85+86

    The only strange thing is that you have turned off $polyglot_settings['lang_change_locale']. Any special reason to serve french content surrounded by english “garbage”:)?

  217. malyfred 2005-11-15 / 9.08 pm

    Thomas> Page titles can be translated only with <lang_xx>One version</lang_xx> <lang_yy>Another version</lang_yy>

    I’ve explained why category names must be translated in .mo file in “How to translate categories” paragraph of the post.

    btw. these characters - < and > must be written like &lt; and &gt; :)

  218. Atun tun tun… » Probando plugin Polyglote 2005-11-15 / 10.49 pm

    […] - Se llama Polyglot y lo he descubierto gracias a Zootropo que lo recomendó en un comentario. - Estoy aún probándolo y modificándolo un poco para que aparezca a mi gusto - Haré un mini-how-to para los que quieran ponerlo en su blog, dado que, aunque en la página oficial del plugin lo explican bastante bien, seguro que hay alguno que no tiene ni idea de PHP ni de inglés, así que lo haré por esas almas cándidas - No es nada complicado escribir en dos idiomas, se hace al escribir la propia entrada. Ya vereis ya.. - Aun no sé como aparece en la sindicación, tendré que investigar más. […]

  219. Weblog de WiZaRd_ » Weblog (casiquasi) bilinge 2005-11-16 / 5.12 am

    […] Debido a una entrada en la que Manuls admita que le haba entrado el gusanillo de hacer su weblog bilinge, al estilo de David Martinez, yo haca un comentario en el que deca que a m tambin me gustara hacerlo (en valenciano y castellano), al cual Zootropo contesta aconsejndonos usar el plugin Polyglot. […]

  220. Daniele 2005-11-16 / 10.34 am

    I precise

    Your plugin goes very well

    I changed the parameters in 206

    but I use wordpress with a localization file in Italian .mo
    and when I active your plugin the language of administration and blog returns in english

    if I desactive the plugin every part returns in Italian

    I use a bowser in italian and I have tried to use all cod

  221. Pierre 2005-11-16 / 11.57 am

    Thanks a lot for your support, Martin. What do you mean by:
    “The only strange thing is that you have turned off $polyglot_settings[’lang_change_locale’]. Any special reason to serve french content surrounded by english “garbage”:)?”

  222. Pierre 2005-11-16 / 11.58 am

    I checked the code and it is set this way:
    $polyglot_settings[’lang_change_locale’] = TRUE;
    What’s wrong?

  223. malyfred 2005-11-16 / 3.43 pm

    Daniele> That must be just some mess in your language settings. Check twice wp-config.php and polyglot.php if everything is all right. Don’t forget that your language files must be called “xx.mo” e.g. “it.mo” and you have to set your default language also as xx not xx_XX.

  224. malyfred 2005-11-16 / 3.46 pm

    Pierre> So you don’t use french localization file (fr.mo)!

  225. Daniele 2005-11-16 / 4.23 pm

    Thank you Malyfred

    localization file called it_IT
    so you plugin didn’t know it

    now it is all good
    thank again

  226. Pierre 2005-11-16 / 5.35 pm

    Ah! No, I’m not using a localization file (I’m not that far yet). ;-)

    Concerning the language setting using the sidebar, it’s apparently not a cookie problem (I’ve checked and cookies do work). If I refresh my browser window, I get the correct result, so it rather appears to be related to the way Wordpress’ cache works. Any idea if there’s a workaround? Perhaps disable caching in WP? Don’t know how to do that, though.

  227. malyfred 2005-11-16 / 7.25 pm

    Pierre> WP doesn’t have any caching system by default and your page works for me so…

    Try to change language of this page in the sidebar - does it work?

  228. Atun tun tun… » Polyglot: Mini-how-to 2005-11-16 / 10.29 pm

    […] Polyglot es un plugin para Wordpress que te permite escribir las entradas en varios idiomas y dar la oportunidad al usuario de leerlo en uno u otro idioma. Tu tienes que escribir la entrada en los dos idiomas y cada una entre unas etiquetas específicas que explicaré más adelante. […]

  229. » Polyglot 2005-11-23 / 3.25 am

    […] Ja esta funcionant com volia el plugin per wordpress Polyglot, el traductor manual. Aquest plugin esta basat en el que feia servir abans jo, el Language Picker. Les millores que te es que detecta els tags en els post’s i si no escrius en un idioma no et possara la disponibilitat d’aquest. […]

  230. Denis 2005-11-23 / 7.36 pm

    Thanks for the plugin.
    Please add ‘he’ (for Hebrew) to knownlangs array in get_users_pref_lang() function (line 408). Without it, even if user has set her default lang to ‘he’, it has no effect by default.

    An additional question: does anyone has an idea how to switch stylesheets based on the chosen language? For Hebrew and Arabic, it is a necessity, as one needs to set the correct reading order for various elements (ltr, rtl).

    Thank you, Denis.

  231. malyfred 2005-11-23 / 11.48 pm

    Denis> Thank you. I’ve added ‘he’ to the list of recognised languages.

    I think that comment #133+134 could help you with ltr and rtl.

  232. » I tu, quins plugins tens?Y tu, ¿que plugins tienes? 2005-11-25 / 1.58 am

    […] - Polyglot: El plugin per traduir, ja comentat […]

  233. martin 2005-11-25 / 3.29 pm

    Hi,I am trying to install this useful plugin but it seems i am kinda stucked with my work. I have 3 languages to chose on my web . Translation of works fine but category list contains numbers of posts made in category under different language so menu looks really messy. Any suggestions?

  234. martin 2005-11-25 / 3.32 pm

    ….and actually i noticed that posts have the same problem: text of post is not shown but other information such a date of post, name are still presented:(

  235. malyfred 2005-11-26 / 2.12 am

    martin> I’ve checked your page and it seems fine. Only the post content has just one language version.

  236. martin 2005-11-26 / 10.25 am

    malyfred::. the problem is that in the sidebar, under catigories I have translated items with __ and after switching language to other one, they still have tracks in menu (they are still presented somehow: number of posts in translated category what does not belong to switched language). It seems 2 b filtering problem…..but I can not force code make right job:(

  237. Polyglot for B2Evolution 2005-11-26 / 12.20 pm

    Polyglot for B2Evolution

    Polyglot is a plugin for B2Evolution blogging system.

    It allows one to write multiple language version of the same post. It utilizes a set of tags in form <lang locale=”en”></lang>.

    Polyglot for B2Evolution has its roots in plugin w…

  238. malyfred 2005-11-26 / 1.32 pm

    martin> When you use gettext (= __ function) you have to have all translations in appropriate .mo files.

    Try the second method wiht <lang_xx> tags.

  239. martin 2005-11-26 / 7.48 pm

    hm…ok, I will try to explain again: I made two posts on my site- one in russian and the other one in estonian including lang_xx tags. Now when I’m switching on estonian language I c the post in estonian aaaaand the name of post in russian insead of my desire displaying only content of estonian page…

  240. martin 2005-11-26 / 9.16 pm

    malyfred::. do not bother urself with answer….solved my problem:) thnx 4 nice plugin;)

  241. schilke 2005-11-29 / 5.03 pm

    thx for that useful plugin. Just wanted to post a small note on an issue I would probably loose out of sight:
    Line 18 of your code
    “$polyglot_settings[’trans’][’de’] = ‘deutch’;”
    better should read
    “$polyglot_settings[’trans’][’de’] = ‘deutsch’;”
    I haven’t finnished work