mirror of
https://github.com/WenPai-org/wpicp-license.git
synced 2025-08-03 05:13:20 +08:00
Merge pull request #2 from alexclassroom/main
Even if GlotPress generated language pack and push to the sites, this…
This commit is contained in:
commit
7bfa9599e6
1 changed files with 3 additions and 6 deletions
|
@ -38,12 +38,9 @@ function wpicp_license_menu() {
|
|||
}
|
||||
|
||||
/** Load translation */
|
||||
$current_locale = get_locale();
|
||||
if (!empty($current_locale)) {
|
||||
$mo_file = dirname(__FILE__) . '/languages/wpicp-license-' . $current_locale . ".mo";
|
||||
if (@file_exists($mo_file) && is_readable($mo_file)) {
|
||||
load_textdomain('wpicp-license', $mo_file);
|
||||
}
|
||||
add_action( 'init', 'wpicp_load_textdomain' );
|
||||
function wpicp_load_textdomain() {
|
||||
load_plugin_textdomain( 'wpicp-license', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
||||
}
|
||||
|
||||
// Add settings page and field
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue