WebMaestroFr / wm-settings

Based on the WordPress Settings API, this class generates options pages. It supports all basic input types, selects and all, but also media uploads, which is quite neat.
http://webmaestro.fr/wordpress-settings-api-options-pages/
21 stars 2 forks source link

gettext #4

Open sixtyseven-multimedia opened 9 years ago

sixtyseven-multimedia commented 9 years ago

I probably found a little issue:

add_settings_error( $this->page, 'settings_reset', __( 'Default settings have been reset.' ), 'updated' );

shouldn't this be

add_settings_error( $this->page, 'settings_reset', __( 'Default settings have been reset.', 'wm-settings' ), 'updated' );

or does the translation come from the wordpress core?

And while talking about this, could you give me a hint, how to get the language properly loaded into the gettext context? I assume, I create the .po and .mo files and place them in my plugins language folder. But what's next? load_textdomain ('wm-settings','path to proper .mo') ? How do I create the name of the .mo, i.e. wm-settings-de_DE.mo?

sixtyseven-multimedia commented 9 years ago

That's what I tried without luck:

$domain = 'wm-settings';
        $locale = get_locale();
        $admin_mo = $domain.'-'.$locale.'.mo';
        load_textdomain( $domain, PATH_TO_PLUGIN . 'admin/languages/' . $admin_mo );