Setting up WordPress multilingual sites with Customizr


New ! Complete guide on how to use Polylang with Customizr.


 

Setting up a multilingual site with Customizr may look daunting at first, but it really isn’t. Follow the steps below.

1 ) Connect to your site’s files using an FTP client (for example FileZilla) or your host’s file manager (if available).

2) In the htdocs folder of your WordPress installation, you will find a file called wp-config.php. Edit this file with a plain text editor and change the line
define(‘WPLANG’, ”);

to your language and country codes. For example:
define(‘WPLANG’, ‘pt_BR’);
This is for Brazilian Portuguese. For other languages, you need to change it to your ISO-639 language code (e.g. ca for Catalan) followed by the ISO-3166 country code (e.g. _ES for Spain). This will tell WordPress to translate all phrases like “E-mail”, “reply to this comment” etc. into your language. The language files are very comprehensive in WordPress, with 83 languages currently defined.
3) If your language is one already also supported by Customizr (as of today: ar, ca, de, es, fa, fr, hi, hu, ir, it, nl, pl, pt, ro, ru, sv, tr, zh), then you will already have a language file set up in the \lang folder of Customizr. Customizr will automatically pick up your WordPress language setting and use it. This will give you automatic translation of phrases like “Read more”, “Sorry, but nothing matched your search criteria”, and so on (which are defined in Customizr, not in WordPress).

4) If your language is not supported yet by Customizr, then you need to:

1) Locate the default.po file in wp-content\themes\customizr\lang folder and download it to your computer.

2) Download Poedit

3) Open the default.po file with Poedit and start translating the strings (or just the strings you care about). Be careful not to insert special characters without using the tricks to make them acceptable (follow the English example). E.g. “featured image” (a phrase with quotes in it) becomes \”featured image\” in Poedit.

4) Save the file with your ISO codes (e.g. zh_TW or da_DK etc). Poedit will save two files with filetypes .mo and .po.

5Once you’ve finished, and if you’ve translated all the phrases, then send the .po and .mo files to Nicolas via the contact form here on Themes & Co and he’ll insert it in the theme. In the meantime — until the next Customizr update — place it in your wp-content\themes\customizr\lang folder where it will start translating for you.

5) Last but not least, if you’re creating a site in another language, but you prefer to work in English (say), then you can use plugins such as Admin in English to put the admin panels back into English. Alternatively, if you are using qTranslate, you can select your preferred admin-panel language in the sidebar of the dashboard.

Now you’re ready to use a plugin like qTranslate or Polylang to create your multi-lingual content. Customizr fully supports qTranslate. The author of Polylang has posted this solution on wordpress.org to make Polylang work with Customizr.

 

Further reading :

 

Let us know which you use and how you get on in the comments.

Important : If you have any trouble on setting up a multilingual site with Customizr, please don’t request any help with a comment form below (it will be deleted) but report it in the users forum since the solution might benefit to everyone. We’ll do our best to help.

@credits : ElectricFeet (@ElectricFeet)


20 thoughts on “Setting up WordPress multilingual sites with Customizr

  • Reply
    Mario Luis Tavares Ferreira

    Using Transposh for multilingual sites with Customizr and having the flags near de menu.

    Before, I would like to congrats for the amazing Theme that is Customizr!
    I would like to share my experience, despite that the last time that I developed any code was more than a decade ago…
    The result you see at: http://www.ieage.org
    I used “customizr-child” (child theme), read some comments here at code snippets and (used some code from Nicolas):
    the functions.php:

    • Reply
      Nicolas Post author

      Hi Mario, apparently you did not forget all your programming skills!
      This is a very interesting contribution which will help many users.
      Thanks for sharing the link of your website too, really good job!

    • Reply
      Pramod Walke

      Sir,
      Many thanks to Nicolas for giving such a great theme free.
      transposh is working fine… its not working for indian language “Marathi”… ok

      As per written in your post,
      i tried to edit create a file functions.php ( rename the original one) & using customizr regular theme not a child.
      The following error displays.. while accessing the website..

      PHP Parse error: syntax error, unexpected ‘}’ in C:\Inetpub\vhosts\dhammaprachar.org\httpdocs\wp-content\themes\customizr\functions.php on line 40

      Can you please correct me where i am wrong..
      Thanks in advance….

    • Reply
      Amico

      ‘ We were not able to find a supported in-memory caching engine, installing one can improve performance. Check Transposh FAQs’
      Mario thanks for a suggestion to transposh…i got this plugin and install it…but it show this above notic…while i have present installed plugins like WP-Super-Cache and APC…but still not working. Any idea you have on this regards? thanks in advance.

  • Reply
    alex

    i assume i can’t just copy and past this code into custom css field of personalization menu right?(actually i tried and it doesn’t seem to work

  • Reply
    Sebastian

    Hello Nicolas, Im trying to translate “Read more” and the others texts , I changed the config.php already with es_ES but Customizr never changes. What I’m doing wrong?

    Thx

  • Reply
    Stefan

    Hey guys,

    great work, i will try this on my site too. I prefer German and English. You can see the result very soon at: http:raul-blog.de

    Thx for this great theme and all its options

  • Reply
    ville

    Hi

    This only makes fat “empty line” before the slider. No flags, even they are in code, if I right click the “Inspect Element” with Crome. What’s wrong here?

  • Reply
    Ardeleanu

    I’m using transposh and want to delay the flag under my menu like mario did ….i copy/paste the code in my child-theme functions.php and nothing happends why?

  • Reply
    Shayan

    Hi
    Recently I started to have problems with this theme, apparently there is an error when the date-time is in unicode (arabic or persian) and it is not showing any of the posts neither in the blog home page or by direct list. Here is the error I get in the error_log file:

    Stack trace:
    #0 ../blog/wp-content/themes/customizr/inc/parts/class-content-headings.php(553): DateTime->__construct(‘????????-????-?…’)
    #1 ../blog/wp-includes/plugin.php(214): TC_headings->tc_add_update_notice_in_title(‘tc_post_page_title_callback(Array in ../blog/wp-content/themes/customizr/inc/parts/class-content-headings.php on line 553
    [15-Dec-2014 20:28:25] PHP Fatal error: Uncaught exception ‘Exception’ with message ‘DateTime::__construct() [
    datetime.–construct]: Failed to parse time string (€±€≥€π€≥-€∞€±-€±€∞ €±€∞:€≤€∂:€¥€≥) at position 0 (€): Unexpected character’ in ../blog/wp-content/themes/customizr/inc/parts/class-content-headings.php:553

    • Reply
      Nicolas Post author

      Thanks for reporting this Shayan. I am working in a fix.
      Before the fix is released, you can try to desactivate the following options using dates in the Customizr theme : in Appearance > Customize > Content > Post metas : uncheck Display the update date

      Did this help ?
      Also answer to this forum topic.

      • Reply
        Shayan

        Thanks for the reply Nicolas,

        I’ve already tried that, it didn’t do the trick.
        I even unchecked all the metas related to dates (published date) but still nothing.

  • Reply
    Wanjun Li

    Good day Nicolas

    First thank you for created such a wonderful theme and I purchased featured pages and fond plugs from you.

    Now I come to a very frustrating situation, my multilingual website doesn’t work. The main problem is the main menu can’t switch between two languages.

    I have dig some clues on Internet and it tells me that the Ajax in customizer theme option should be turned off, could you please tell me where to close it?

    My website is http://www.pagetrans.com

    My customizr user id is: joshua.vip@outlook.com

    Very appreciate for you help!

      • Reply
        Wanjun Li

        Good day, Nicolas, I am using polylang plugs in my site, and I followed all the steps. I created two main menus, one for chinese and one for English and assigned them to two languages. but it can’t switch between them. always display chinese menu.

        Something is very stringe, in my wp-config.php file, I don’t have ‘define(‘WPLANG’, ”);’ this defination, so I added it by myself with
        define(‘WPLANG’, ‘zh_CN’);

        Really appreciate your help, this problem has bothered me nearly one week and can’t fix it…..:(

Leave a Comment

Your email address will not be published. Required fields are marked *

You may also use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">