Knowledgebase: WordPress
Preparing strings in WordPress for localization
Posted by Viktor Klymonchuk, Last modified by Viktor Klymonchuk on 02 September 2011 10:16 AM

How to prepare strings for translations in WordPress

Sample of non-translatable strings:

<div class="content">
<h1>Welcome to my site!</h1>
<p>I hope you'll like it.</p>
</div>

Change to:

<div class="content">
<h1><?php _e("Welcome to my site!"); ?></h1>
<p><?php _e("I hope you'll like it."); ?></p>
</div>

From

<?php next_posts_link('Older Entries') ?>

To

<?php next_posts_link(__('Older Entries')) ?>

 

Read also: http://codex.wordpress.org/I18n_for_WordPress_Developers#Marking_Strings_for_Translation

(0 vote(s))
Helpful
Not helpful

Comments (0)
Managed by WebCTO