Jump to Navigation

Making WordPress multilangual

UPDATE: I wrote my own multilingual plugin, which works way better than Polyglot. Check it out here.

After spending days on installing all kinds of pluginsand “hacking” around in the code of several plugins, I think I am finally finished. Here is the list of plugins I use:

When I first installed Polyglot on WordPress 2.0.x, some little things didn’t work. WordPress didn’t apply filters for things they should have and Polyglot didn’t add filters for those functions, so some things didn’t get translated. After updating to 2.1, I have to say that every bug I fixed a week ago (why didn’t I move to WordPress a week later?), was already fixed. But the bug fixes for Polyglot were still needed. The main reason for me hacking around in Polyglot were the Date functions. It was not using strftime, which caused me not to be able to translate full string names of week days, month or years. After getting this to work, I installed the “Google XML Sitemaps” plugin, which generates a sitemap of all my wordpress pages. But sadly, it didn’t support Polyglot, so I had to hack around in it too, although this was pretty easy compared to the Polyglot “hacking”. So if anyone else is using Polyglot and Google XML Sitemaps and want them to work together, here are my files zipped. Read more to see a list of changes made by me.

  • Added support for Polyglot in Google XML Sitemaps
  • Fixed Date String Output in Polyglot

    For this I added 2 new arrays for strftime formats:



    plus 2 functions for fixed output:

    polyglot_translated_date() and polyglot_translated_time()

  • Added single_cat_title filter for Polyglot
  • Fixed problem with search URI and lang-pref settings

    was: /s=foo/lang-pref/en/

    now: /lang-pref/en/?s=foo

  • Several bug fixes in Polyglot

21 Responses to “Making WordPress multilangual”

  1. jon:


    I installed your Polyglot modification but I’m still not getting dates translated. What am I doing wrong ?


  2. Qian Qin:


    Redownload the file please. I added some instructions into the zip file.


  3. Frieder:

    Danke, werde deine Files gleich morgen ausprobieren, nutze nämlich auch WordPress 2.1, Google XML Sitemaps und wollte meine Seite auch auf zwei Sprachen umstellen.

  4. boris:

    hey qian,

    i’m using polyglot on my site. it’s a great plugin. i’ve always had one problem with it though. the post titles always got displayed in both languages i use. now i downloaded your modified polyglot file and suddenly the post titles get displayed correctly within . i’m using a couple pugins where the post titles still get displayed in both my languages though (cdc clean archives & plug’n'play google map). i was wondering if there is an easy way of getting the correct language displayed? you can have a look here.
    i have sent a mail to malyfred already, but he doesn’t seem to support his plugin anymore.
    cheers, b

  5. Qian Qin:

    Hi Boris,

    check if the functions used in your templates are all filtered functions in polyglot.php. If not, add it to there.

    Good luck!

  6. Olaf:

    Hohoho, das ist ja Klasse was du hier vorstellst. So ungefähr hab ich mir das auch zurecht gehackt.
    “Filter für single_cat_title in Polyglot hinzugefügt”, heißt das, es funktioniert damit auch mit dem Seitentitel? Also das da auch diese speziellen Tags greifen? Das fehlt mir nämlich noch.
    Das bekomm ich dann aber bestimmt selber hin wenn ich da reingucke ;)

    Viel wichtiger, hier funktioniert auch das mod-rewrite!!!! Was hast du getan um das hinzubekommen, da saß ich dazumal Stunden dran, es läuft einfach nicht. Wenn du da mal einen Tipp für mich hättest!?
    Also die URLs bekomm ich schön, nur das mit der .htaccess….

  7. Qian Qin:

    Hi Olaf,

    ich hab eigentlich die Standardkonfiguration, wüsste nicht, dass ich da was besonderes gemacht habe. Ich würde sagen, probier es einfach mal mit meinen Files aus, vielleicht gehts ja da. ;)


  8. Olaf:

    Kannst du mir mal bitte deine .htaccess schicken (mail)?

  9. Mathieu:

    Hi Qian,

    I try to setup a bilingual blog as well, and I would also be very interested in you .htaccess You url rewriting rules seem to be what I am looking for :)
    I sent you an email.

  10. Qian Qin:

    Hello Mathieu,

    I use the default .htaccess from wordpress 2.1, nothing fancy or special. It should work perfectly with it.

  11. boris:

    hey qian,

    how would you go about making the whole blogroll in wp 2.1 multilingual? with that i mean the category title and the link description. tried to alter the core, but that’s not really good and it didn’t work anyways. tried to add filters in polyglot.php, but that didn’t work either.

  12. Witek:

    Thanks so much for this! I spent 8 hours last night trying to work it out, and there you go! So simple! Got it working in 15 minutes! :)

  13. Help Translate WordPress For Your Readers and Everyone : The Blog Herald:

    [...] Polyglot 2.0 helps to make WordPress bilingual, too. It allows easy switching from the different languages and conversion of character codes within the post content. For tips on using this on WordPress 2.1, see Making WordPress Multilingual. [...]

  14. Roby:

    Hi, first, compliments you for qtraslate, very simple and logical idea to manage translation on WP,

    but … i trying to found a solution at… example: i have 2 lang. (IT and ENG),…if i navigate trought the site and i switched to Eng, it keep the selected language all time, but if i go to Home-Page it reset to the default Lang (It).

    There is a way to keep the choiched lang. also if i come back to home page?

  15. Vlady:

    Hallo everyone, the plugin is really good, but i couldn’t get is it possible to manage page title and keywords for different languages.

  16. dvromeu:

    qTranslate is the best solution I found for multilingual blogging with wordpress…


  17. Jon:

    I am using the plugin on my site. Now i see it very usefull, but what about the tags and title of content/sidebar.Is there an automatic language changer for that in the plugin or do we have to do it manualy?

  18. Qian Qin:

    take a look at the support forum.

  19. Sérgio Mago:

    Hello there. Thank you for qtranslate.
    It’s a wonderfull software, but… My widgets remain always in the same language. Including the text widgtes. How can I solve this problem? Is there a way of also having my all sidebar translated?
    I already saw a bi-lingual blog with the widgets translated and they use qtranslate. Help me with this please.

  20. Sergey N Lukin (slookin):

    I update latest Google sitemap plugin for support Polyglot

  21. Greek translator:

    Did you evaluate WPML Multilingual CMS?