I have a wordpress theme without textdomain (i.e. e(x) and not e(x,domain)). I also have the .po and .mo files in a folder under /themes/My Theme/localization (Notice the space name in the my theme). I would like to activate fr_FR. I created fr_FR.po and .mo and changed the wp-config to add the locale for fr_FR. However, I am still not getting the french to work. I saw many sites telling you to add a load_theme_textdomain at the top of functions.php, but I do not know what would my textdomain be. Any help will be appreciated.
Renaming a default taxonomy field ('description') in WordPress
How to exclude posts in taxonomy based on custom field?
Wordpress jQuery Post Attachment Image Gallery?
Display Values from Custom Tables in wordpress Admin Panel
Will have to become this:.
_e('some text'); __('some other text');
get last inserted id from wordpress $wpdb
Next you'll need to add this bit of code at the top of your functions.php file:.
_e('some text', 'your-domain'); __('some other text', 'your-domain');
Wordpress popularity contest to only track posts from a specific category
You can read more about it in this post..
load_theme_textdomain( 'your-domain', TEMPLATEPATH.'/localization' ); $locale = get_locale(); $locale_file = TEMPLATEPATH."/localization/$locale.php"; if (is_readable($locale_file)) require_once($locale_file);
OpenSource alternatives on XCloner [closed]
What is the difference between developing a Drupal module and a WordPress plugin?
I did this recently to a theme which was not designed for localization, so I'm posting what I did.. Add this to functions.php.
load_theme_textdomain( 'your-domain', TEMPLATEPATH.'/languages' );. where
your-domaincan be any name, but keep it uniform throughout all theme files.. Now go through all the theme PHP files, and do the following:. If you see
_e('some text')then change it to
_e('some text', 'your-domain');. If you see
__('some text')then change it to
__('some text', 'your-domain');. If you see
_e()then, . If
"some text"is used in a function call, then make it
__()like above, including the text domain . If
"some text"is just printed and not part of any function call, surrround it with a
_e()like shown above, and don't forget the text domain.
. Read the Wordpress internationalization and localization guide for more information..
$localebefore wordpress has a bash at it, then wordpress uses the server's locale settings (in the
wp-includes/l10n.phpfile, the function
. The solution I used, is to set the global $locale right next to defining
global $locale; $locale = 'am_AM'; define('WPLANG', $locale);