From cac8acb841ab081188598f6097cd5ae34ad6b521 Mon Sep 17 00:00:00 2001 From: GonGarce Date: Mon, 16 Feb 2026 23:36:32 +0100 Subject: [PATCH] Translate unit price and add spanish translations --- src/helpers/Price.php | 4 +- src/translations/en/stripe.php | 8 ++ src/translations/es/stripe.php | 151 +++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 src/translations/es/stripe.php diff --git a/src/helpers/Price.php b/src/helpers/Price.php index dda18a3..016fa3f 100644 --- a/src/helpers/Price.php +++ b/src/helpers/Price.php @@ -131,7 +131,7 @@ public static function asUnitPrice(mixed $stripePrice): string if ($stripePrice['recurring'] !== null) { if ($stripePrice['recurring']['interval_count'] == 1) { - $unitPrice = "$pricePerUnit/{$stripePrice['recurring']['interval']}"; + $unitPrice = $pricePerUnit . '/' . Craft::t('stripe', $stripePrice['recurring']['interval']); } else { $unitPrice = $pricePerUnit . ' ' . lcfirst($interval); } @@ -212,7 +212,7 @@ public static function getInterval(mixed $stripePrice): string } else { $interval = Craft::t('stripe', 'Every {intervalCount} {interval}', [ 'intervalCount' => $stripePrice['recurring']['interval_count'], - 'interval' => $stripePrice['recurring']['interval'], + 'interval' => Craft::t('stripe', $stripePrice['recurring']['interval']), ]); } diff --git a/src/translations/en/stripe.php b/src/translations/en/stripe.php index 2673a55..f498283 100644 --- a/src/translations/en/stripe.php +++ b/src/translations/en/stripe.php @@ -140,4 +140,12 @@ 'Which template should be loaded when a product’s URL is requested.' => 'Which template should be loaded when a product’s URL is requested.', 'Yes' => 'Yes', 'per unit' => 'per unit', + 'year' => 'year', + 'years' => 'years', + 'month' => 'month', + 'months' => 'months', + 'week' => 'week', + 'weeks' => 'weeks', + 'day' => 'day', + 'days' => 'days', ]; diff --git a/src/translations/es/stripe.php b/src/translations/es/stripe.php new file mode 100644 index 0000000..95f9122 --- /dev/null +++ b/src/translations/es/stripe.php @@ -0,0 +1,151 @@ + '{unitPrice} por grupo de {divideBy}', + 'Add a product' => 'Añadir un producto', + 'All products' => 'Todos los productos', + 'All subscriptions' => 'Todas las suscripciones', + 'Amount' => 'Importe', + 'API Connection' => 'Conexión API', + 'API Version' => 'Versión de la API', + 'Archived in Stripe' => 'Archivado en Stripe', + 'Are you sure you want run a complete sync of all Stripe Products, Prices, Subscriptions, Customers, Invoices and Payment Methods?' => '¿Estás seguro de que deseas ejecutar una sincronización completa de todos los productos, precios, suscripciones, clientes, facturas y métodos de pago de Stripe?', + 'Are you sure you want to sync this user’s Stripe customer data?' => '¿Estás seguro de que deseas sincronizar los datos de cliente de Stripe de este usuario?', + 'Are you sure you want to delete this webhook?' => '¿Estás seguro de que deseas eliminar este webhook?', + 'Cancel at period end' => 'Cancelar al final del período', + 'Cancel at' => 'Cancelar el', + 'Cancel Immediately' => 'Cancelar inmediatamente', + 'Canceled at' => 'Cancelado el', + 'Canceled in Stripe' => 'Cancelado en Stripe', + 'Configure the product’s front-end routing settings.' => 'Configura los ajustes de enrutamiento del front-end del producto.', + 'Couldn’t save settings.' => 'No se pudieron guardar los ajustes.', + 'Couldn’t save webhook settings.' => 'No se pudieron guardar los ajustes del webhook.', + 'Create the webhook for the current environment.' => 'Crear el webhook para el entorno actual.', + 'Create' => 'Crear', + 'Created {duration} ago.' => 'Creado hace {duration}.', + 'Created at' => 'Creado el', + 'Created' => 'Creado', + 'Currency' => 'Moneda', + 'Currency options' => 'Opciones de moneda', + 'Current period' => 'Período actual', + 'Customer chooses' => 'El cliente elige', + 'Customer Email' => 'Correo electrónico del cliente', + 'Discounts' => 'Descuentos', + 'Draft' => 'Borrador', + 'Due' => 'Vencido', + 'Ended at' => 'Finalizado el', + 'Every {intervalCount} {interval}' => 'Cada {intervalCount} {interval}', + 'Frequency' => 'Frecuencia', + 'General' => 'General', + 'Has Stripe Customer' => 'Tiene cliente de Stripe', + 'ID' => 'ID', + 'Interval' => 'Intervalo', + 'Invoice No' => 'N.º de factura', + 'Invoices' => 'Facturas', + 'Last 4 digits' => 'Últimos 4 dígitos', + 'Leave blank if products don’t have URLs' => 'Dejar en blanco si los productos no tienen URL', + 'Live Mode' => 'Modo Live (Real)', + 'Max Amount' => 'Importe máximo', + 'Metadata' => 'Metadatos', + 'Min Amount' => 'Importe mínimo', + 'New Product' => 'Nuevo producto', + 'New Subscription' => 'Nueva suscripción', + 'No invoices exist yet.' => 'Aún no existen facturas.', + 'No payment methods exist yet.' => 'Aún no existen métodos de pago.', + 'No webhooks exist yet.' => 'Aún no existen webhooks.', + 'No Stripe API key found. Make sure you have added one in the plugin’s settings screen.' => 'No se encontró ninguna clave de API de Stripe. Asegúrate de haber añadido una en la pantalla de ajustes del complemento.', + 'No' => 'No', + 'One-time' => 'Pago único', + 'Open in Stripe' => 'Abrir en Stripe', + 'Partial packages' => 'Paquetes parciales', + 'Payment Method Id' => 'ID del método de pago', + 'Payment Methods' => 'Métodos de pago', + 'Preset Amount' => 'Importe preestablecido', + 'Price per Unit' => 'Precio por unidad', + 'Price Type' => 'Tipo de precio', + 'Prices' => 'Precios', + 'Primary Currency' => 'Moneda principal', + 'Product Template' => 'Plantilla de producto', + 'Product URI format' => 'Formato de URI del producto', + 'Products' => 'Productos', + 'Publishable Key' => 'Clave pública (Publishable)', + 'Resume subscription' => 'Reanudar suscripción', + 'Round {roundDirection} to nearest complete package' => 'Redondear {roundDirection} al paquete completo más cercano', + 'Routing Settings' => 'Ajustes de enrutamiento', + 'Scheduled in Stripe' => 'Programado en Stripe', + 'Secret Key' => 'Clave secreta', + 'Settings saved.' => 'Ajustes guardados.', + 'Settings' => 'Ajustes', + 'Starts at' => 'Comienza el', + 'Status' => 'Estado', + 'Stripe Customer(s)' => 'Cliente(s) de Stripe', + 'Stripe Customers successfully synced' => 'Clientes de Stripe sincronizados correctamente', + 'Stripe Edit' => 'Editar en Stripe', + 'Stripe ID' => 'ID de Stripe', + 'Stripe Price' => 'Precio de Stripe', + 'stripe price' => 'precio de stripe', + 'Stripe Prices' => 'Precios de Stripe', + 'stripe prices' => 'precios de stripe', + 'Stripe Product' => 'Producto de Stripe', + 'stripe product' => 'producto de stripe', + 'Stripe Products, Prices, Subscriptions, Customers, Invoices and Payment Methods successfully synced' => 'Productos, precios, suscripciones, clientes, facturas y métodos de pago de Stripe sincronizados correctamente', + 'Stripe Products' => 'Productos de Stripe', + 'stripe products' => 'productos de stripe', + 'Stripe Publishable Key' => 'Clave pública de Stripe', + 'Stripe Secret Key' => 'Clave secreta de Stripe', + 'Stripe Status' => 'Estado de Stripe', + 'Stripe Subscription' => 'Suscripción de Stripe', + 'stripe subscription' => 'suscripción de stripe', + 'Stripe Subscriptions' => 'Suscripciones de Stripe', + 'stripe subscriptions' => 'suscripciones de stripe', + 'Stripe Sync All' => 'Sincronizar todo con Stripe', + 'Stripe Webhook Signing Secret' => 'Secreto de firma de webhook de Stripe', + 'Stripe' => 'Stripe', + 'Subscription resumed.' => 'Suscripción reanudada.', + 'Subscription cancelled.' => 'Suscripción cancelada.', + 'Subscriptions' => 'Suscripciones', + 'Sync Customer from Stripe' => 'Sincronizar cliente desde Stripe', + 'Sync all data' => 'Sincronizar todos los datos', + 'Sync customer-related Stripe data.' => 'Sincronizar datos de Stripe relacionados con el cliente.', + 'Sync from Stripe' => 'Sincronizar desde Stripe', + 'Template' => 'Plantilla', + 'This user isn’t a Stripe customer' => 'Este usuario no es un cliente de Stripe', + 'Topic' => 'Tema (Topic)', + 'Type' => 'Tipo', + 'UID' => 'UID', + 'Unable to create webhook' => 'No se pudo crear el webhook', + 'Unable to resume subscription.' => 'No se pudo reanudar la suscripción.', + 'Unit Price' => 'Precio unitario', + 'Updated at' => 'Actualizado el', + 'URL' => 'URL', + 'Webhook ID' => 'ID del Webhook', + 'Webhook Signing Secret' => 'Secreto de firma del Webhook', + 'Webhook could not be deleted' => 'No se pudo eliminar el webhook', + 'Webhook deleted' => 'Webhook eliminado', + 'Webhook registered successfully, but we had trouble saving those settings. Please go to your Stripe Dashboard, get the webhook signing secret and id and add them to your plugin (Control Panel > Stripe > Webhooks).' => 'El webhook se registró correctamente, pero tuvimos problemas al guardar los ajustes. Por favor, ve a tu panel de Stripe, obtén el secreto de firma y el ID del webhook y añádelos a tu complemento (Panel de control > Stripe > Webhooks).', + 'Webhook registered.' => 'Webhook registrado.', + 'Webhook settings saved.' => 'Ajustes de webhook guardados.', + 'Webhooks' => 'Webhooks', + 'What product URIs should look like.' => 'Qué aspecto deben tener las URI de los productos.', + 'Which template should be loaded when a product’s URL is requested.' => 'Qué plantilla debe cargarse cuando se solicita la URL de un producto.', + 'Yes' => 'Sí', + 'per unit' => 'por unidad', + 'year' => 'año', + 'years' => 'años', + 'month' => 'mes', + 'months' => 'meses', + 'week' => 'semana', + 'weeks' => 'semanas', + 'day' => 'día', + 'days' => 'días', +];