Skip to content

Commit

Permalink
Added translations.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaseven7h committed Sep 16, 2024
1 parent 49c4206 commit cd687f2
Show file tree
Hide file tree
Showing 8 changed files with 321 additions and 10 deletions.
33 changes: 23 additions & 10 deletions class.wp-wide-admin-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class WP_Wide_Admin_Menu {
public function __construct() {
$this->define_constants();

$this->load_textdomain();

self::$options = get_option(
'wp-wide-admin-menu-options',
array( "wp-wide-admin-menu-width" => 240 )
Expand All @@ -37,10 +39,18 @@ private function define_constants(): void {
define( 'WP_WIDE_ADMIN_MENU_URL', plugin_dir_url( WP_WIDE_ADMIN_MENU_FILE ) );
}

public function load_textdomain(): void {
load_plugin_textdomain(
'wp-wide-admin-menu',
false,
dirname( plugin_basename( __FILE__ ) ) . '/languages'
);
}

public function admin_menu(): void {
add_options_page(
esc_html__( 'WP Wide Admin', 'wp-wide-admin-menu' ),
esc_html__( 'WP Wide Admin', 'wp-wide-admin-menu' ),
__( 'WP Wide Admin', 'wp-wide-admin-menu' ),
__( 'WP Wide Admin', 'wp-wide-admin-menu' ),
'manage_options',
'wp-wide-admin-menu',
array(
Expand Down Expand Up @@ -76,7 +86,7 @@ public function admin_options_page(): void {
add_settings_error(
'wp-wide-admin-menu-options',
'wp-wide-admin-menu',
esc_html__( 'Settings Saved', 'wp-wide-admin-menu' ),
__( 'Settings Saved', 'wp-wide-admin-menu' ),
'success'
);
}
Expand All @@ -95,7 +105,7 @@ public function admin_options_page(): void {
$do_settings_sections = ob_get_clean();

ob_start();
submit_button( esc_html__( 'Save Settings', 'wp-wide-admin-menu' ) );
submit_button( __( 'Save Settings', 'wp-wide-admin-menu' ) );
$submit_button = ob_get_clean();

echo self::$m->render( 'admin-page', array(
Expand All @@ -112,8 +122,8 @@ public function register_settings(): void {
'wp-wide-admin-menu-option-group',
'wp-wide-admin-menu-options',
array(
'label' => esc_html__( 'WP Wide Admin Menu', 'wp-wide-admin-menu' ),
'description' => esc_html__( 'Settings for the WP Wide Admin Menu plugin.', 'wp-wide-admin-menu' ),
'label' => __( 'WP Wide Admin Menu', 'wp-wide-admin-menu' ),
'description' => __( 'Settings for the WP Wide Admin Menu plugin.', 'wp-wide-admin-menu' ),
'sanitize_callback' => array( $this, 'sanitize_options' ),
'show_in_rest' => true,
'default' => array(
Expand All @@ -123,13 +133,13 @@ public function register_settings(): void {
);
add_settings_section(
'wp-wide-admin-menu-settings-section-general',
esc_html__( 'General', 'wp-wide-admin-menu' ),
__( 'General', 'wp-wide-admin-menu' ),
array( $this, 'wp_wide_admin_menu_settings_section_general' ),
'wp-wide-admin-menu-settings-page-general'
);
add_settings_field(
'wp-wide-admin-menu-width',
esc_html__( 'Width', 'wp-wide-admin-menu' ),
__( 'Width', 'wp-wide-admin-menu' ),
array( $this, 'wp_wide_admin_menu_width' ),
'wp-wide-admin-menu-settings-page-general',
'wp-wide-admin-menu-settings-section-general',
Expand All @@ -152,7 +162,10 @@ public function sanitize_options( $options ): array {

public function wp_wide_admin_menu_settings_section_general(): void {
echo self::$m->render( 'wp-wide-admin-menu-settings-section-general', array(
'section_description' => esc_html__( 'General settings for the WP Wide Admin Menu plugin.', 'wp-wide-admin-menu' )
'section_description' => __(
'General settings for the WP Wide Admin Menu plugin.',
'wp-wide-admin-menu'
)
) );
}

Expand All @@ -161,7 +174,7 @@ public function wp_wide_admin_menu_width( $args ): void {
$field_value = isset( self::$options['wp-wide-admin-menu-width'] )
? esc_attr( self::$options['wp-wide-admin-menu-width'] )
: 240;
$field_description = esc_html__( 'The width for the Admin menu.', 'wp-wide-admin-menu' );
$field_description = __( 'The width for the Admin menu.', 'wp-wide-admin-menu' );
echo self::$m->render( 'wp-wide-admin-menu-width', array(
'field_value' => $field_value,
'field_description' => $field_description
Expand Down
Binary file added languages/wp-wide-admin-menu-es_MX.mo
Binary file not shown.
74 changes: 74 additions & 0 deletions languages/wp-wide-admin-menu-es_MX.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: WP Wide Admin Menu\n"
"POT-Creation-Date: 2024-09-16 16:34-0600\n"
"PO-Revision-Date: 2024-09-16 16:37-0600\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es_MX\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.5\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
"X-Poedit-WPHeader: wp-wide-admin-menu.php\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
"X-Poedit-SearchPathExcluded-1: vendor\n"

#: class.wp-wide-admin-menu.php:52 class.wp-wide-admin-menu.php:53
msgid "WP Wide Admin"
msgstr "WP Wide Admin"

#: class.wp-wide-admin-menu.php:89
msgid "Settings Saved"
msgstr "Ajustes guardados"

#: class.wp-wide-admin-menu.php:108
msgid "Save Settings"
msgstr "Guardar Ajustes"

#. Plugin Name of the plugin/theme
#: class.wp-wide-admin-menu.php:125
msgid "WP Wide Admin Menu"
msgstr "Menu WP Wide Admin"

#: class.wp-wide-admin-menu.php:126
msgid "Settings for the WP Wide Admin Menu plugin."
msgstr "Configuración del plugin WP Wide Admin Menu."

#: class.wp-wide-admin-menu.php:136
msgid "General"
msgstr "General"

#: class.wp-wide-admin-menu.php:142
msgid "Width"
msgstr "Ancho"

#: class.wp-wide-admin-menu.php:165
msgid "General settings for the WP Wide Admin Menu plugin."
msgstr "Configuración general del plugin WP Wide Admin Menu."

#: class.wp-wide-admin-menu.php:174
msgid "The width for the Admin menu."
msgstr "La anchura del menú Admin."

#. Plugin URI of the plugin/theme
msgid "http://rhaseven7h.com/gmm-mail-from"
msgstr "http://rhaseven7h.com/gmm-mail-from"

#. Description of the plugin/theme
msgid "A simple plugin for WordPress to widen the Admin menu."
msgstr "Un simple plugin para WordPress para ampliar el menú de administración."

#. Author of the plugin/theme
msgid "Gabriel Medina"
msgstr "Gabriel Medina"

#. Author URI of the plugin/theme
msgid "http://rhaseven7h.com/author/gmedina"
msgstr "http://rhaseven7h.com/author/gmedina"
Binary file added languages/wp-wide-admin-menu-fr_CA.mo
Binary file not shown.
74 changes: 74 additions & 0 deletions languages/wp-wide-admin-menu-fr_CA.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: WP Wide Admin Menu\n"
"POT-Creation-Date: 2024-09-16 16:34-0600\n"
"PO-Revision-Date: 2024-09-16 16:40-0600\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr_CA\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.5\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
"X-Poedit-WPHeader: wp-wide-admin-menu.php\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
"X-Poedit-SearchPathExcluded-1: vendor\n"

#: class.wp-wide-admin-menu.php:52 class.wp-wide-admin-menu.php:53
msgid "WP Wide Admin"
msgstr "WP Wide Admin"

#: class.wp-wide-admin-menu.php:89
msgid "Settings Saved"
msgstr "Paramètres sauvegardés"

#: class.wp-wide-admin-menu.php:108
msgid "Save Settings"
msgstr "Sauvegarder les réglages"

#. Plugin Name of the plugin/theme
#: class.wp-wide-admin-menu.php:125
msgid "WP Wide Admin Menu"
msgstr "WP Wide Admin Menu"

#: class.wp-wide-admin-menu.php:126
msgid "Settings for the WP Wide Admin Menu plugin."
msgstr "Paramètres du plugin WP Wide Admin Menu."

#: class.wp-wide-admin-menu.php:136
msgid "General"
msgstr "Général"

#: class.wp-wide-admin-menu.php:142
msgid "Width"
msgstr "Largeur"

#: class.wp-wide-admin-menu.php:165
msgid "General settings for the WP Wide Admin Menu plugin."
msgstr "Paramètres généraux du plugin WP Wide Admin Menu."

#: class.wp-wide-admin-menu.php:174
msgid "The width for the Admin menu."
msgstr "La largeur du menu d'administration."

#. Plugin URI of the plugin/theme
msgid "http://rhaseven7h.com/gmm-mail-from"
msgstr "http://rhaseven7h.com/gmm-mail-from"

#. Description of the plugin/theme
msgid "A simple plugin for WordPress to widen the Admin menu."
msgstr "Un simple plugin pour WordPress pour élargir le menu d'administration."

#. Author of the plugin/theme
msgid "Gabriel Medina"
msgstr "Gabriel Medina"

#. Author URI of the plugin/theme
msgid "http://rhaseven7h.com/author/gmedina"
msgstr "http://rhaseven7h.com/author/gmedina"
Binary file added languages/wp-wide-admin-menu-pt_BR.mo
Binary file not shown.
74 changes: 74 additions & 0 deletions languages/wp-wide-admin-menu-pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: WP Wide Admin Menu\n"
"POT-Creation-Date: 2024-09-16 16:34-0600\n"
"PO-Revision-Date: 2024-09-16 16:39-0600\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.5\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
"X-Poedit-WPHeader: wp-wide-admin-menu.php\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
"X-Poedit-SearchPathExcluded-1: vendor\n"

#: class.wp-wide-admin-menu.php:52 class.wp-wide-admin-menu.php:53
msgid "WP Wide Admin"
msgstr "WP Wide Admin"

#: class.wp-wide-admin-menu.php:89
msgid "Settings Saved"
msgstr "Configurações Salvas"

#: class.wp-wide-admin-menu.php:108
msgid "Save Settings"
msgstr "Salvar Configurações"

#. Plugin Name of the plugin/theme
#: class.wp-wide-admin-menu.php:125
msgid "WP Wide Admin Menu"
msgstr "Menu de administração amplo do WP"

#: class.wp-wide-admin-menu.php:126
msgid "Settings for the WP Wide Admin Menu plugin."
msgstr "Configurações para o plug-in WP Wide Admin Menu."

#: class.wp-wide-admin-menu.php:136
msgid "General"
msgstr "Geral"

#: class.wp-wide-admin-menu.php:142
msgid "Width"
msgstr "Largura"

#: class.wp-wide-admin-menu.php:165
msgid "General settings for the WP Wide Admin Menu plugin."
msgstr "Configurações gerais para o plug-in WP Wide Admin Menu."

#: class.wp-wide-admin-menu.php:174
msgid "The width for the Admin menu."
msgstr "A largura do menu Admin."

#. Plugin URI of the plugin/theme
msgid "http://rhaseven7h.com/gmm-mail-from"
msgstr "http://rhaseven7h.com/gmm-mail-from"

#. Description of the plugin/theme
msgid "A simple plugin for WordPress to widen the Admin menu."
msgstr "Um plug-in simples para o WordPress para ampliar o menu de administração."

#. Author of the plugin/theme
msgid "Gabriel Medina"
msgstr "Gabriel Medina"

#. Author URI of the plugin/theme
msgid "http://rhaseven7h.com/author/gmedina"
msgstr "http://rhaseven7h.com/author/gmedina"
76 changes: 76 additions & 0 deletions languages/wp-wide-admin-menu.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: WP Wide Admin Menu\n"
"POT-Creation-Date: 2024-09-16 16:34-0600\n"
"PO-Revision-Date: 2024-09-16 16:32-0600\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"X-Generator: Poedit 3.5\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
"X-Poedit-WPHeader: wp-wide-admin-menu.php\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
"X-Poedit-SearchPathExcluded-1: vendor\n"

#: class.wp-wide-admin-menu.php:52 class.wp-wide-admin-menu.php:53
msgid "WP Wide Admin"
msgstr ""

#: class.wp-wide-admin-menu.php:89
msgid "Settings Saved"
msgstr ""

#: class.wp-wide-admin-menu.php:108
msgid "Save Settings"
msgstr ""

#. Plugin Name of the plugin/theme
#: class.wp-wide-admin-menu.php:125
msgid "WP Wide Admin Menu"
msgstr ""

#: class.wp-wide-admin-menu.php:126
msgid "Settings for the WP Wide Admin Menu plugin."
msgstr ""

#: class.wp-wide-admin-menu.php:136
msgid "General"
msgstr ""

#: class.wp-wide-admin-menu.php:142
msgid "Width"
msgstr ""

#: class.wp-wide-admin-menu.php:165
msgid "General settings for the WP Wide Admin Menu plugin."
msgstr ""

#: class.wp-wide-admin-menu.php:174
msgid "The width for the Admin menu."
msgstr ""

#. Plugin URI of the plugin/theme
msgid "http://rhaseven7h.com/gmm-mail-from"
msgstr ""

#. Description of the plugin/theme
msgid "A simple plugin for WordPress to widen the Admin menu."
msgstr ""

#. Author of the plugin/theme
msgid "Gabriel Medina"
msgstr ""

#. Author URI of the plugin/theme
msgid "http://rhaseven7h.com/author/gmedina"
msgstr ""

0 comments on commit cd687f2

Please sign in to comment.