Blogging can be fueled by various reasons:

  • Ego satisfaction
  • As a means of expressing personal creativity
  • As a profession
  • As an extra source of income
  • Any other reason

If one or several of these motivations just happened to find you, then you are probably standing now on the first steps of the path to blogging.

Perhaps this is not the first time that you start this journey, and the path that you see is clear.

But if, like me, you are new to blogging, then several questions can arise.

Moreover, if you’re idea is to give birth to a multilingual blog, then even more questions can defer the moment of your first blog entry.

Here are my personal discoveries on the way from blog idea to blog life, in 6 quick steps.

If you know where you want to go, but are not quite sure on how to get there, maybe they can help on pointing out the way.

Step 1: Clearing the Path

So you know you want to create a blog, and perhaps you even know what kind of content you want it to host.

But somehow, you are still not quite sure if it’s worth it, if you really have something to say, and how exactly you want to say it.

A couple of questions that helped me sail pass the point of doubt, and define how I wanted my blog to be were:

  • Why are you starting a blog?
  • What will be the main content of you blog?

Spending some time browsing other blogs can also help on clearing the path towards blogosphere citizenship.

You can find blogs everywhere and anywhere, but a good place to start can be checking comments left by others on sites of your interest: usually people will leave a link to their blog together with their comment.

Existing blogs will give you some inspiration, and help paint the image of your blog-to-be.

Step 2: Multilingual Blogging

So now that you’ve spent some time defining your blog, the path seems already a little less fuzzier, and you can almost picture yourself typing in your first entry.

But then, the blog’s multilingual nature causes some inevitable questions to appear.

Are you going to translate all the entries, or are the localized versions going to have different entry trails as well as languages?

Is it worth translating every entry?

Should comments also be localized?

There are quite a lot of multilingual blogs out there that can help you decide what approach you want to take on multilingual blogging.

For an idea on what kind of decisions you will have to make, check out this excellent blog entry.

Probably the two most important aspects are:

These are some of the important decisions I made:

  • I follow a symmetric model, meaning that every blog entry is available in all languages, and every entry has an individual localized comment trail (Comment contents are not handled, meaning that nothing stops a visitor to place a comment in a comment trail in a language other than the comment’s trail language)
  • All translation is done manually, by me
  • All languages live in the same unique blog installation
  • There is no mixture of languages on individual pages, and language selection is offered on every page, through a link in the site header
  • The content is fully localized, meaning that all content is translated, such as: Post titles, excerpts and body, Categories, Tags, Blog interface messages, Alt text for images, Page title, Etc.
  • When possible, outgoing links vary depending on the language: for example, a wikipedia link in the Spanish version should point to the Spanish wikipedia entry and to the English wikipedia entry for the English version (one exception to this is the blogroll)
  • I have not considered other local sensitive data, such as date formats
  • Language handling is done through a specific blog functionality, and is totally independent from categories or tags

Building software to handle all of these considerations could take some time, but fortunately, there are some excellent blogging options readily available that offer most of the needed functionalities that will allow you to concentrate on the content, rather than on all the meta-blogging nuisances.

Step 3: The Software

Blogging has never been easier, and one of the main reasons for this is because there have never been so many possibilities regarding blogging software.

There are hundreds of blogging options, each with different advantages and disadvantages, and it’s just a matter of checking them out to see which one will fulfill your needs.

Nevertheless, regarding multilingual blogging, most of them will probably require some tuning and customization.

I ended up choosing Wordpress because of it’s user friendliness, its flexibility, and the number of plugins, themes and widgets that are available.

(if you happen to work with Mac OS, check out MAMP and textwrangler, that’s all you will be needing to play around with a local Wordpress installation)

There are various multilingual plugins for wordpress.

I tried out language switcher, Gengo and qTranslate.

I chose qTranslate, due to it’s ease of use and simplicity, although it’s a good idea to test run all of them, and see which one is the closest to your needs.

I did some minor tuning on qTranslate in order to handle multilingual comment trails.

As a theme I chose Mandigo, because it is fully localized, and I liked it’s design.

Other plugins I currently use and found to be very useful are:

Wordpress extension, tuning and customization possibilities are almost infinite, and user contribution is very high, so be sure to check if a plugin or a widget doesn’t already exist for a functionality you may need before hacking away.

Step 4: Going Live

By this point, you probably now have a nice local installation, fully tuned and customized, begging to escape localhost confinement, and expand into the world wide web looking for a home in the blogosphere.

There are various aspects to consider before taking your blog to the real world, but probably the most important one is on how you will host your blog.

The main options are self hosting, free shared web hosting or paid shared web hosting, with each option having different possibilities.

An interesting alternative can be hosting your blog in the cloud.

I initially spent some time on free shared web hosting, but the annoying downtime and slow response time convinced me to switch to paid shared web hosting.

I decided to go for ICDSoft, and so far, so good.

If you are paranoid on making your whois info public, be sure to check out WhoisGuard.

Although the basic ICDSoft package includes site monitoring, I signed up with sitemeter, which offers the info I am really interested in.

UPDATE 08/04/09: I now use Google Analytics, find out why.

You should also spend some time thinking about a domain name, and the tld that goes with it.

Most web hosting offers will include some sort of web fronted to manage your site, but if you need a good ftp client for Mac OS, be sure to check out Cyberduck.

Step 5: Blog Promotion

Once everything is up and running, you will probably want to introduce your blog to the world.

One option is to first get some initial feedback from your inner circle of friends and contacts, and then move on to SEO.

There are hundreds of articles on SEO optimization, but a couple of initial steps can be submitting your site to google, and signing up with google webmaster tools, to check if Googlebot has heard your call.

You can also submit your site to the Open Directory Project.

(make sure to submit the localized index urls of your site to the appropriate category)

Future Considerations

Now that your blog is born, it will grow, change and expand.

It’s probably a good idea to keep it simple in the beginning, as it is not possible to know in which direction your blog will go.

Only time and content will show how your blog will mutate.

Some things I did not initially consider, and that I keep in mind for the future, are related posts, caching, a tag cloud, pingbacks, trackbacks or compression.

UPDATE 06/03/2008: Comment localization

These are the modifications I made to localize comments…

NOTE: The modifications are WordPress-Plugin agnostic, this is probably not the best way to go…

1. Commments Table (wp_comments):

  • Add ‘comment_lang’ field (this field contains ‘en’, ‘es’ or ‘ca’, defining the comment locale)

2. Comment Template (themes/mandigo/comments.php):

  • Add ‘comment_lang’ input field (contains ‘en’, ‘es’ or ‘ca’, defining the comment locale)
<input type="hidden" name="comment_lang" value="<?php global $q_config; echo $q_config['language']; ?>" />

3. Comment Post Handling (wp/wp-comments-post.php):

  • Add ‘comment_lang’ to comment data

Variable Definition Section:

$comment_lang = $_POST['comment_lang'];

Modification of Comment Data:

$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url',
'comment_content', 'comment_type', 'comment_parent', 'user_ID','comment_lang');

4. Comment Insertion (wp/wp-includes/comment.php):

  • Add ‘comment_lang’ to insert
function wp_insert_comment($commentdata)
...
$result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->comments
(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date,
comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type, comment_parent, user_id,
comment_lang)
VALUES (%d, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d, %s)",
$comment_post_ID, $comment_author, $comment_author_email, $comment_author_url, $comment_author_IP, $comment_date,
$comment_date_gmt, $comment_content, $comment_approved, $comment_agent, $comment_type, $comment_parent, $user_id,
 $comment_lang) );

5. Comment Retrieval (wp/wp-includes/comment-template.php):

  • Add ‘comment_lang’ to filter criteria for number of comments retrieval
function get_comments_number( $post_id = 0 ) {
global $q_config,$wpdb;
$lang = $q_config['language'];
$numcom = (int) $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d
AND comment_lang = %s", $post_id, $lang) );
return apply_filters('get_comments_number', $numcom);
}
  • Add ‘comment_lang’ to filter criteria for comments retrieval
function comments_template
...
if ( $user_ID) {
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_lang = %s AND
comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) )
ORDER BY comment_date", $lang, $post->ID, $user_ID));
} else if ( empty($comment_author) ) {
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_lang = %s AND
comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $lang, $post->ID));
} else {
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_lang = %s AND
comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND
comment_approved = '0' ) ) ORDER BY comment_date", $lang, $post->ID, $comment_author, $comment_author_email));
}

UPDATE 12/05/2009: Recent Comments Widget

It seems it’s a good time to add the “Recent Comments” widget…

The function wp_widget_recent_comments in the file <wp_home>/wp-includes/widgets.php was modified to get the selected language:

global $q_config;
$langsel=$q_config['language'];

And select only the comments in the selected language:

$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1'
AND comment_lang = '$langsel'
ORDER BY comment_date_gmt DESC LIMIT $number");

UPDATE 02/09/2009: Spanish and Catalan .mo files

I don’t remember exactly where I found them, but these are the .mo files I use in case they can be useful:

(They should be copied to /wp/wp-content/languages)

UPDATE 02/09/2009: How to add a non-predefined language in qtranslate

In order to add a non-predefined language in qtranslate, the translation file (.mo) and flag (.png) are needed.

For example, to add catalan to qtranslate:

1. Copy the translation file ca_ES to /wp/wp-content/languages

2. Copy the flag ca.png to /wp/wp-content/plugins/qtranslate/flags

3. Go to “Plugins” –> “qTranslate” -> “Settings”

4. “Add New Language”

5. Add the new language:

Adding a new language in qtranslate

Tags: ,
220 Responses to “Multilingual Blogging with Wordpress”
  1. Carme says:

    Congrats on your blog and your investigation!
    This is really a very good approach on issues arise to all of us when we start. And your explanation is quite clear, with good examples and useful resources.
    It may help others, so I will link your article from my blog to contribute.
    Thanks for sharing.

  2. Thanks!

    I hope it will be useful for other multilingual bloggers out there…

  3. paul gailey says:

    can you elaborate on what modifications you did to qtranslate for comments? did it handle your rss feeds in each language out of the box?

  4. legege says:

    How are you able to change the tagline for each language? Any chance you could release modifications to qTranslate?

  5. @paul gailey

    I updated the post with a brief explanation on the comment localization…

    Regarding RSS feeds, it seems to work out of the box…allthough I have not thoroughly tested it…

    I use FeedBurner for RSS Feeds, I defined three separate feeds for the three languages:

    http://feeds2.feedburner.com/dvromeu_es (Original feed: http://dvrom.eu/feed/)
    
    http://feeds2.feedburner.com/dvromeu_ca (Original feed: http://dvrom.eu/feed/)
    
    http://feeds2.feedburner.com/dvromeu (Original feed: http://dvrom.eu/feed/)
    

    @legege

    The tagline is managed through the All in One SEO plugin, so I just used the delimiter tags in the apropriate field:

    <!--:en-->dvrom.eu -  Multilingual ramblings centered on I.T...and everything else...<!--:-->
    <!--:ca-->dvrom.eu - Divagacions multiling¸es centrades en les T.I...i en tot lo demÈs...<!--:-->
    <!--:es-->dvrom.eu - Divagaciones multiling¸es centradas en las T.I...y en todo lo dem·s...<!--:-->
    
  6. Here - you can see (in french and english) our research results (and our xili-language plugin) about multilingual wordpress approach. (http://dev.xiligroup.com/?cat=393&lang=en_us) I think it is a cms way giving to webmasters (theme-design, data-design) and authors free way to organize the post (and the translated)… Ready to continue the exchange…

  7. nmask says:

    Hi, very useful advices, thanks!

    But I have small remark, when you submit comment it redirects you to wp-comments-post.php, and you have it also not translated, so I wonder is it hard to do :P

    thanks

  8. @Michel

    Thanks, the plugin looks promising…

    @nmask

    Thanks, I noticed this before, definitely something to put on the TODO list…@

  9. Amir says:

    Next time you check multilingual plugins for WordPress, have a look at WPML:
    http://wpml.org

    It’s modeled after Drupal’s i18n module, with similar architecture and features, but none of the complexity.

  10. Farhad Hamed says:

    Thanks for the last tutorial. I gave it a shot the other night, it worked pretty well and the comments are submitted BUT although I accept comments in Admin section, they are NOT shown in posts. Worth mentioning that I’m using 6 languages. Is it related to what you have taught in the tutorial??????

  11. @Farhad Hamed

    Hi,

    I would probably look into the code that loads the comments (wp/wp-includes/comment-template.php), and check the query…

    good luck!

  12. kaaliss says:

    hi,
    just one question: What is the php code to insert manually qtranslate in my template, the header ie?
    thks! :)

  13. @kaaliss

    I slightly modified the ‘qtrans_generateLanguageSelectCode’ function in the file ‘qtranslate_widget.php’ in the plugins/qtranslate directory:

                            global $q_config;
               	        $sellang=$q_config['language'];
    			$i = 0;
    			foreach($q_config['enabled_languages'] as $language) {
    				if ($sellang!=$language){
    					if ($sellang=='en'){
    						if($language == 'es') $text = 'Spanish';
    						if($language == 'ca') $text = 'Catalan';
    					}
    					if ($sellang=='es'){
    						if($language == 'en') $text = 'Inglés';
    						if($language == 'ca') $text = 'Catalán';
    					}
    					if ($sellang=='ca'){
    						if($language == 'en') $text = 'Anglès';
    						if($language == 'es') $text = 'Castellà';
    					}
    					echo '<a href="'.qtrans_convertURL('', $language).'" class="dvrtest" rel="nofollow">';
    					echo $text.'';
    					$i++;
    					if ($i!=2) echo ' - ';
    				}
    			}
    
  14.  
Leave a Reply