I use an English WordPress package and this is very well.
Now, I would like to translate some elements of the blog (like “posted on”, “comments”) etc., but do leave the dashboard interface intact in English.
Is there any mechanism to translate just the site elements?
You can do the following:
- Get the the language pack (e.g.
de_DE.mo
) from wordpress.org. If the language pack isn’t available as a standalone download, you could also use the .mo
file which is bundled in the WordPress ZIP-file for your language. Located under wp-content/languages
.
- Move the
.mo
file to wp-content/languages/
of your default (english) WordPress installation.
- Change the
WPLANG
constant in wp-config.php
to the new locale (e.g. de_DE
)
- In your
functions.php
add the following filter:
functions.php
add_filter('locale', 'wpse27056_setLocale');
function wpse27056_setLocale($locale) {
if ( is_admin() ) {
return 'en_US';
}
return $locale;
}