mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2024-12-22 11:53:53 +02:00
A better way of loading language files
This commit is contained in:
parent
7660b7601c
commit
df80c7e5eb
1 changed files with 5 additions and 2 deletions
|
@ -103,8 +103,11 @@ class PluginName {
|
|||
public function plugin_textdomain() {
|
||||
|
||||
// TODO: replace "plugin-name-locale" with a unique value for your plugin
|
||||
load_plugin_textdomain( 'plugin-name-locale', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
|
||||
|
||||
$domain = 'plugin-name-locale';
|
||||
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
|
||||
load_textdomain( $domain, WP_LANG_DIR.'/'.$domain.'/'.$domain.'-'.$locale.'.mo' );
|
||||
load_plugin_textdomain( $domain, FALSE, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
|
||||
|
||||
} // end plugin_textdomain
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue