WordPress: Multiple Languages

en

If you would like to have a language switch like I have, that can be done.

It’s now available on wordpress.org: Multilingual Text

Update 2011-09-21: Version 1.4 Released

Changelog

  • Version 1.4
    • Added custom usage
    • Small fixes
  • Version 1.3
    • Fixed an bug where the language selection was dropped
    • Added “” to write for all languages
  • Version 1.2
    • Added a “Settings” Link to the plugin page
    • Added many flags
  • Version 1.1
    • Added support for PHP 5.2
    • Fixed a few flaws
  • Version 1.0
    • Initial release

de

Wenn du auch gerne so eine Sprachumschaltung hättest wie ich, das kann man machen.

Es is nun auf wordpress.org: Multilingual Text

Update 2011-09-21: Version 1.4 Released

Changelog

  • Version 1.4
    • Added custom usage
    • Small fixes
  • Version 1.3
    • Fixed an bug where the language selection was dropped
    • Added “” to write for all languages
  • Version 1.2
    • Added a “Settings” Link to the plugin page
    • Added many flags
  • Version 1.1
    • Added support for PHP 5.2
    • Fixed a few flaws
  • Version 1.0
    • Initial release

44 Responses to “WordPress: Multiple Languages”


  • Dear Alex,

    I use WP 3.1.2 and wants to use your plugin; but I got the error while activating:

    Parse error: syntax error, unexpected ‘;’ in */wp-content/plugins/multilingual-text/multilingual-text.php on line 282

    Please post a sollution for this.

    Thanks.

    Tamas

  • Hello Tamas,

    are you sure that you’re using PHP >= 5.3?
    I think that’s the problem.

    ALeX.

  • 5.2.17 :(

    No possibility to modify. :(

    Is there a previous version which is compatible with 5.2.x?

    Tamas

  • I’m working on 5.2 compatible version.

  • I got this to work by adding a modifier in the .htaccess file.

    AddType application/x-httpd-php53 .php

    Hostgator has PHP 5.2 and PHP 5.3 installed but you have to have the .htaccess file add PHP 5.3.

  • How can I disable the the flags on text?

    Widget (optional):
    You can place a widget to switch between the languages, in this case you can disable the flags on text/title. You have to enter the name of all languages which will be showed.

  • @Peter:

    all that is already available.
    Widget is called Language and the settings can be found under Settings->General->Multilingual Text

  • Hello alex,

    Thanks for your plugin, it exactly meets the simplicity and efficientness I was looking for.

    Instead of providing flags one a time (which means a lot of new releases for nothing, and flags that don’t get along so well), you could use a flags pack.

    This one is interesting, since it’s licensed under CC: http://www.free-country-flags.com/flag_pack.php?id=4

    Starting from the tiny pack, I converted the names down to their 2-letters ISO counterpart using http://countrycode.org/ ; here is the result: http://zorun.tonbnc.fr/flags.tar.gz

    Note that ‘en’ isn’t an ISO code; it’s ‘gb’ or ‘us’ instead.

    I haven’t checked if your plugin is under CC itself, but I think a simple note in the README about where the flags come from should be enough.

    One more thing: your README is anything but clear about how to turn the title of an article multilingual… Do you have to modify the wordpress code itself? Or the theme? Isn’t there a simpler way? Maybe that’s a feature request against wordpress…

    Thanks,
    zorun

  • @zorun:

    first, thanks for your response!

    I started to write this Plugin (at first only for myself) because all the others were too complex.

    thanks for the flags, I’ll put them into the next release.

    I’ve changed the documentation from ‘en’ to ‘gb’ to match countries. (But for compatibility reasons the en flag will remain)

    In order to place a flag near the title modification to the theme must be done, read “Installation->Template Modifications” in the readme. The reason why this can’t be done automatically is that “the_title()” is used in many cases (e.g. all links to that post) I can’t replace it like the text.

    A change in the/all templates, which uses a new action for the main title only would help.

  • Hi Alex,
    I use your plugin on a WordPress blog and I just say that it works perfectly well ! Thanks for this great job.

    Besides this, could it be possible to add a ‘all’ language to replace the [:en,de,fr] by [:all] ? This could be helpful for non translated part like images, data, references, etc.

  • good evening,

    I have installed the pluging and it works quite well, thank you.
    But I notice something. When you select a language it is selected for every posts and pages.
    That’s good.
    When you clic on another post or page, the language stay the same.
    That’ good.
    But when you clic the second time on another post or page the language turn back to the default. Here is the englih.
    Infortunatly
    You can try it on these 3 test pages story 1 to story 3
    http://giorgio.lgnas.com/?page_id=206

  • @giorgio: I’ll look after that – currently no idea…

    @Gilles: Thanks for that suggestion, It’ll be in the next version.

    P.S.: I was on vacation

  • @giorgio: the bug is fixed.

    @Gilles: it’s implemented: “[:*]“.

  • Hi alx,

    Just to improve the code. It would be better to write the links around the flag like:

    '<a href="void(0)" rel="nofollow">'.

    in place of

    '<a href="#" rel="nofollow">'.

    It prevent to move the page back to top in most browsers.

  • Your plugin works perfect thank you! But i am having some trouble on Categories page. When i click on a flag, post gets tranlated to the selected language but flag doesn’t change, i have to click on it once more. After that flag gets selected. By the way im using iFeature theme and wordpress 3.2.1. Is it me only having trouble with it?

  • Hi Alex, I’m quite new to WordPress and so on, could you inform a bit more detailed, what do I have to do if I want my titles to be multilingual. The enigmatic:

    Multilingual title: replace the <?php the_title(); ?> with <?php Multilingual_Text::Title(); ?>, this can’t be done automatically because some titles (like the <title> or other <meta> elements) do not support switching

    unfortunately seem nothing to me. I succeded in changing the titles’ language only after reloading the page, not after clicking the flag.

    Thanks for help!

  • hi. great plugin. im using portfolio_slideshow and wanted to create bilingual image titles and descriptions. is there a way to do that?

  • @tom: You have to modify the theme you use. If you don’t know what to do, you should ask someone else.

    @dave: great idea. with the current version (1.4) you can use the Multilingual-Text Engine for your own, see readme.

  • Hi, sounds great. Can i use this in other plugins?
    for example i use “portfolio_slideshow” where i process pictures like this:
    if ( $description ) {
    $slideshow .= ”.$description.”;
    }

    or do i have to use the code in my main page?
    thank you for your work, i love that plugin.

  • Hi alex,

    Is there a technical limit on the size of the post that can be addressed using the Multilingual Text plugin.

    The plugin works perfectly with simple straight forward text but it gets a little confused when applied to large textes with images and links included within both the [:en] and [:fr] versions.

    Is there a particular approache that should be used in this case?

    Regards, Marc.

  • another idea: a way to use a custom button for example somewhere in the menu
    which changes itself from DE to EN when i klick it… so just showing one flag.

  • @dave: The readme explains how to use it. For now I don’t have plans to condense it to one flag, but I keep in mind.

    @Marc: There is no limit due to my plugin, only a general one from php – but if you hit that the execution will stopped.
    Can you mail me link to your page or send me the text which has problems?

  • Hello Thomas,

    I use your plugin and it work very well. But when I use in both my multilingual texts tag for text break (in HTML view: <!–more–>), on homepage is only first part of text which is used at first, for example only in Czech Also in this case text not switch to other language. Without ) tag work is normal, but in this situation is text on homepage too long.

    Example html:
    [:en]This is first sentence <!–more–> and this is the rest of article.
    [:ge]Diese ist erster Satz<!–more–> und diese ist der Rest von dem Artikel.
    In this situation I see text in English only.

    I saw, on your homepage work it good. What can I do wrong?

    Thanks Martin

  • @Martin: Thanks for your note, I’ll add that in the readme soon. You have to have only one “more” in the text:
    [:en]This is first sentence [:ge]Diese ist erster Satz [:*]<!--more--> [:en]and this is the rest of article. [:ge]und diese ist der Rest von dem Artikel.

  • Yes, it work great now! Thank you very much.

  • Thank you, this worked:
    $cap = Multilingual_Text::Parse($caption,false,true);

  • Hi Alex, one other thing. I have a multilingual page titles in the menu. When I switch the language using the flags on widget, the change is not immediately reflected in the menu. I must jump to the next page use or use F5. It is possible (for ex. as option) by language change to refresh whole page? See situation on http://www.samo.cz.

  • Hello Alex! Which tag should I use to place the language switcher in a (not widget ready) sidebar?

  • Hi Alex,

    Great plugin! So much easier to use than a whole bunch of others I tried.

    It works great in ie7 & 8, but in Chrome and Firefox displays both de and en text together. Do you have any idea why this might happen?

    Thank you.

  • Hi!

    As I know many others do, I totally love the elegant simplicity of this plugin. It’s exactly what I was looking for in order to have multilingual posts on my blog. (Granted, I haven’t really gotten to the actual blogging part yet.)

    There seems to be a problem with how the flag icons react to clicking, though. The first click does nothing, the second click changes the text, and only the third click changes the flag selection. This problem seems to always occur, and both in IE9 and Firefox.

    Clearly something in my chosen theme is clashing with the plugin, but since I don’t have any PHP experience I couldn’t possibly figure out what. My theme is Graphene 1.5.4.

    If you can’t help me solve this issue, I suppose I’ll just have to find another theme to work with. While I love the functionality and style of the theme, your plugin is actually more important to me. ^^;

  • After some more testing, it seems the plugin isn’t compatible with the Single Posts/Permalinks (single.php) or Pages (page.php). Not even in the default theme, Twenty Eleven.

    I have to click a flag 3-5 times before it reacts properly.

  • …I am so very dumb.

    There was a conflict between the Multilanguage plugin and a Facebook plugin I had activated but wasn’t using yet. So I guess now I’ve got to figure out how to get them to play nice with each other…

  • Hi, its me again.
    like you know i managed it to work with an plugin. im fighting with the placing of the flags.
    because there is no text in the main textfield, no international, it doesnt show me the flags.
    when i tick “show flags even if just one language….” it shows me one flag. can i use the custom script part to show the flags?

    Greetings.

  • Hi Guy’s
    Thanks for the plugin.

    Could you rebuild this plugin to a “flow/step/process” plug in. Where the flags are symbols for the steps and [ :st1 ] show the step1 text, [ :st2 ] shows the step2 text. I’m not much of a PHP guy but came close to it just replacing the languages with st1 st2. Problem is I need the languages more then the steps and don’t know how to add a second instance of your plugin without getting the [: language] and [: steps ] mixed up.

    I like the simple approach on this plug in.

    regards

  • Im not getting the flags next to my title like in this article :-) pasted ?
    wazzup, what am I doing wrong? http://www.go-que.com Widget is working

  • Thank you. i found what i needed.
    “”

    Works for showing just the Flags. I dont know if it i did that correctly or if there was an other way but it works. thx for yout plugin.

  • Got it working, more or less. I have my flags next to the text. That works for me. I would like to have a multilingual title but the way I read it in the read-me is to past the ‘ ‘ after the title. Must be me, it didn’t work. Or do I have to edit the template?

  • Hi Guys,
    Still waiting for an answer

  • @cas: i think you can do everything with the “freestyle” version of the plugin. Look at my post from 4. October 2011.

  • I have no problems with your plugin just love its simplicity and efficiency. Thank you!

  • Trying to edit the template after reading this:
    “* Multilingual title: replace the “ with “, this can’t be done automatically because some titles (like the “ or other “ elements) do not support switching”

    Which files in the template require this switch? I am currently using Suffusion.

  • Hi, how can i insert Title in wp editor /pages/ for automatic change after click on flag ??? I understand how work [:en]text blabla[:en]

  • Dear Alex,
    I have installed your Multiple Languages plugin version 1.4 and am using WordPress 3.4.1. Mostly using Chrome.
    I have inserted

    [:gb] Welcome in English!
    [:de] Wilkommen auf Deutsch!

    But see only that… Seems that is not executed (just checked that plugin is activated) Very much appreciate tips how to.
    Thanks a lot, Marcel

  • solved

    in the html there was strong and /strong around the language reference
    omitting that made the plugin work

    cheers, Marcel

Leave a Reply