Skip to content

Commit

Permalink
Add new translation
Browse files Browse the repository at this point in the history
  • Loading branch information
cquesadad committed Aug 21, 2024
1 parent 18d652b commit 4df3b09
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 9 deletions.
11 changes: 10 additions & 1 deletion custom-price-user-role.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
// Include file for frontend modifications
include_once(plugin_dir_path(__FILE__) . 'public/custom-price-display.php');

function cpur_load_textdomain() {
load_plugin_textdomain(
'custom-price-user-role',
false,
dirname(plugin_basename(__FILE__)) . '/languages/'
);
}
add_action('plugins_loaded', 'cpur_load_textdomain');

// Verificar si los plugins requeridos están activos
function require_members_plugin() {
// Asegurarse de que la función is_plugin_active esté disponible
Expand Down Expand Up @@ -58,7 +67,7 @@ function crbp_add_custom_price_fields() {
'id' => 'custom_price_' . $role,
'class' => 'short',
// Translators: %s is the role name.
'label' => sprintf(__('Precio para rol %s', 'woocommerce'), $details['name']),
'label' => sprintf(__('Price by role: %s', 'custom-price-user-role'), $details['name']),
'type' => 'number',
'custom_attributes' => array(
'step' => 'any',
Expand Down
Binary file added languages/custom-price-user-role-en_EN.mo
Binary file not shown.
12 changes: 8 additions & 4 deletions languages/en.po → languages/custom-price-user-role-en_EN.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgstr ""
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/custom-price-user-"
"role\n"
"POT-Creation-Date: 2024-08-21T16:34:21+00:00\n"
"PO-Revision-Date: 2024-08-21 17:37+0100\n"
"PO-Revision-Date: 2024-08-21 18:10+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en\n"
Expand Down Expand Up @@ -50,15 +50,15 @@ msgstr "Custom Price By User Role"

#: admin/plugin-settings.php:21
msgid "Custom Price by User Rol"
msgstr "Custom Price by User Role"
msgstr "Custom Price by User Rol"

#: admin/plugin-settings.php:42
msgid "Main configuration"
msgstr "Main settings"
msgstr "Main configuration"

#: admin/plugin-settings.php:48
msgid "Show/hide custom prices"
msgstr "Show/hide custom price"
msgstr "Show/hide custom prices"

#: admin/plugin-settings.php:58
msgid "Select whether you want to show or hide prices by role:"
Expand All @@ -79,3 +79,7 @@ msgid ""
msgstr ""
"The plugin <b>Members</b> is required to make <b>Custom Role Based Pricing</"
"b> work correctly. Please, activate Member Plugin."

#: custom-price-user-role.php:40
msgid "Price by role: %s"
msgstr "Price by role: %s"
Binary file added languages/custom-price-user-role-es_ES.mo
Binary file not shown.
14 changes: 10 additions & 4 deletions languages/es.po → languages/custom-price-user-role-es_ES.po
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Copyright (C) 2024 Carlos Quesada
# This file is distributed under the GPLv3.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Project-Id-Version: Custom Price by User Role 1.0.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/custom-price-user-"
"role\n"
"POT-Creation-Date: 2024-08-21T16:34:21+00:00\n"
"PO-Revision-Date: 2024-08-21 17:42+0100\n"
"PO-Revision-Date: 2024-08-21 18:08+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.4\n"
"X-Poedit-Basepath: .\n"
"X-Domain: custom-price-user-role\n"

#. Plugin Name of the plugin
#: custom-price-user-role.php
Expand All @@ -26,7 +28,7 @@ msgid ""
"WooCommerce REST API."
msgstr ""
"Añade campos de precios personalizados según el rol de usuario y habilita "
"que se actualicen los precios a través de la API RESTde Woocommerce."
"que se actualicen los precios a través de la API REST de Woocommerce."

#. Author of the plugin
#: custom-price-user-role.php
Expand Down Expand Up @@ -79,3 +81,7 @@ msgstr ""
"El plugin <b>Members</b> es requerido para hacer que el plugin <b>Precios "
"Personalizados por Rol de Usuario</b> funcione correctamente. Por favor, "
"instale y active el plugin Members."

#: custom-price-user-role.php:40
msgid "Price by role: %s"
msgstr "Precio para rol: %s"
4 changes: 4 additions & 0 deletions languages/custom-price-user-role.pot
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ msgstr ""
#: custom-price-user-role.php:44
msgid "The plugin <b>Members</b> is required to make <b>Custom Role Based Pricing</b> work correctly. Please, activate Member Plugin."
msgstr ""

#: custom-price-user-role.php:40
msgid "Price by role: %s"
msgstr ""
Binary file removed languages/en.mo
Binary file not shown.
Binary file removed languages/es.mo
Binary file not shown.

0 comments on commit 4df3b09

Please sign in to comment.