From 2eecdcfc3eeb1c2c2ec326121a919692ad537df7 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Fri, 6 Sep 2024 12:13:27 +0200 Subject: [PATCH] =?UTF-8?q?Rename=20=E2=80=9CPayment=20method=E2=80=9D=20t?= =?UTF-8?q?o=20=E2=80=9CInvoicing=20method=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is only for user-visible strings; the name from the point of view of code and database remains the same. This is an attempt to force a distinction between payment method, used in invoices, and payment accounts, for payments. Closes #100. --- pkg/company.go | 4 +- pkg/invoices.go | 4 +- pkg/quote.go | 6 +- po/ca.po | 158 ++++++++++++--------- po/es.po | 158 ++++++++++++--------- web/template/app.gohtml | 2 +- web/template/payments/methods/index.gohtml | 14 +- 7 files changed, 199 insertions(+), 147 deletions(-) diff --git a/pkg/company.go b/pkg/company.go index 0223ed1..92a0808 100644 --- a/pkg/company.go +++ b/pkg/company.go @@ -778,7 +778,7 @@ func newPaymentMethodForm(locale *Locale) *paymentMethodForm { locale: locale, Name: &InputField{ Name: "method_name", - Label: pgettext("input", "Payment method name", locale), + Label: pgettext("input", "Invoicing method name", locale), Type: "text", Required: true, }, @@ -821,7 +821,7 @@ func (form *paymentMethodForm) Parse(r *http.Request) error { func (form *paymentMethodForm) Validate() bool { validator := newFormValidator() - validator.CheckRequiredInput(form.Name, gettext("Payment method name can not be empty.", form.locale)) + validator.CheckRequiredInput(form.Name, gettext("Invoicing method name can not be empty.", form.locale)) validator.CheckRequiredInput(form.Instructions, gettext("Payment instructions can not be empty.", form.locale)) return validator.AllOK() } diff --git a/pkg/invoices.go b/pkg/invoices.go index 197156f..c04eed6 100644 --- a/pkg/invoices.go +++ b/pkg/invoices.go @@ -868,7 +868,7 @@ func newInvoiceForm(ctx context.Context, conn *Conn, locale *Locale, company *Co PaymentMethod: &SelectField{ Name: "payment_method", Required: true, - Label: pgettext("input", "Payment Method", locale), + Label: pgettext("input", "Invoicing Method", locale), Selected: []string{mustGetDefaultPaymentMethod(ctx, conn, company)}, Options: mustGetPaymentMethodOptions(ctx, conn, company), }, @@ -925,7 +925,7 @@ func (form *invoiceForm) Validate() bool { if validator.CheckRequiredInput(form.Date, gettext("Invoice date can not be empty.", form.locale)) { validator.CheckValidDate(form.Date, gettext("Invoice date must be a valid date.", form.locale)) } - validator.CheckValidSelectOption(form.PaymentMethod, gettext("Selected payment method is not valid.", form.locale)) + validator.CheckValidSelectOption(form.PaymentMethod, gettext("Selected invoicing method is not valid.", form.locale)) allOK := validator.AllOK() for _, product := range form.Products { diff --git a/pkg/quote.go b/pkg/quote.go index 7e4018d..3a48e92 100644 --- a/pkg/quote.go +++ b/pkg/quote.go @@ -707,8 +707,8 @@ func newQuoteForm(ctx context.Context, conn *Conn, locale *Locale, company *Comp }, PaymentMethod: &SelectField{ Name: "payment_method", - Label: pgettext("input", "Payment Method", locale), - EmptyLabel: gettext("Select a payment method.", locale), + Label: pgettext("input", "Invoicing Method", locale), + EmptyLabel: gettext("Select a invoicing method.", locale), Options: mustGetPaymentMethodOptions(ctx, conn, company), }, } @@ -752,7 +752,7 @@ func (form *quoteForm) Validate() bool { validator.CheckValidDate(form.Date, gettext("Quotation date must be a valid date.", form.locale)) } if form.PaymentMethod.String() != "" { - validator.CheckValidSelectOption(form.PaymentMethod, gettext("Selected payment method is not valid.", form.locale)) + validator.CheckValidSelectOption(form.PaymentMethod, gettext("Selected invoicing method is not valid.", form.locale)) } allOK := validator.AllOK() diff --git a/po/ca.po b/po/ca.po index b1017c2..fa6a10b 100644 --- a/po/ca.po +++ b/po/ca.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: numerus\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n" -"POT-Creation-Date: 2024-08-30 02:37+0200\n" +"POT-Creation-Date: 2024-09-06 12:07+0200\n" "PO-Revision-Date: 2023-01-18 17:08+0100\n" "Last-Translator: jordi fita mas \n" "Language-Team: Catalan \n" @@ -458,32 +458,67 @@ msgctxt "title" msgid "Edit Quotation “%s”" msgstr "Edició del pressupost «%s»" +#: web/template/app.gohtml:20 +msgctxt "nav" +msgid "Dashboard" +msgstr "Tauler" + +#: web/template/app.gohtml:21 +msgctxt "nav" +msgid "Quotations" +msgstr "Pressuposts" + +#: web/template/app.gohtml:22 +msgctxt "nav" +msgid "Invoices" +msgstr "Factures" + +#: web/template/app.gohtml:23 +msgctxt "nav" +msgid "Expenses" +msgstr "Despeses" + #: web/template/app.gohtml:24 +msgctxt "nav" +msgid "Payments" +msgstr "Pagaments" + +#: web/template/app.gohtml:25 +msgctxt "nav" +msgid "Products" +msgstr "Productes" + +#: web/template/app.gohtml:26 +msgctxt "nav" +msgid "Contacts" +msgstr "Contactes" + +#: web/template/app.gohtml:37 msgctxt "menu" msgid "Account" msgstr "Compte" -#: web/template/app.gohtml:30 +#: web/template/app.gohtml:43 msgctxt "menu" msgid "Tax Details" msgstr "Configuració fiscal" -#: web/template/app.gohtml:36 web/template/company/invoicing.gohtml:3 +#: web/template/app.gohtml:49 web/template/company/invoicing.gohtml:3 msgctxt "title" msgid "Invoicing and Quoting" msgstr "Facturació i pressuposts" -#: web/template/app.gohtml:42 web/template/company/taxes.gohtml:3 +#: web/template/app.gohtml:55 web/template/company/taxes.gohtml:3 msgctxt "title" msgid "Taxes" msgstr "Imposts" -#: web/template/app.gohtml:48 web/template/payments/methods/index.gohtml:3 +#: web/template/app.gohtml:61 web/template/payments/methods/index.gohtml:3 msgctxt "title" -msgid "Payment Methods" -msgstr "Mètodes de pagament" +msgid "Invoicing Methods" +msgstr "Mètodes de facturació" -#: web/template/app.gohtml:54 web/template/payments/accounts/new.gohtml:11 +#: web/template/app.gohtml:67 web/template/payments/accounts/new.gohtml:11 #: web/template/payments/accounts/index.gohtml:3 #: web/template/payments/accounts/index.gohtml:11 #: web/template/payments/accounts/edit.gohtml:11 @@ -491,55 +526,16 @@ msgctxt "title" msgid "Payment Accounts" msgstr "Comptes de pagament" -#: web/template/app.gohtml:60 +#: web/template/app.gohtml:73 msgctxt "menu" msgid "Switch Company" msgstr "Canvi d’empresa" -#: web/template/app.gohtml:68 +#: web/template/app.gohtml:81 msgctxt "action" msgid "Logout" msgstr "Surt" -#: web/template/app.gohtml:77 -msgctxt "nav" -msgid "Dashboard" -msgstr "Tauler" - -#: web/template/app.gohtml:78 -msgctxt "nav" -msgid "Quotations" -msgstr "Pressuposts" - -#: web/template/app.gohtml:79 -msgctxt "nav" -msgid "Invoices" -msgstr "Factures" - -#: web/template/app.gohtml:80 -msgctxt "nav" -msgid "Expenses" -msgstr "Despeses" - -#: web/template/app.gohtml:81 -msgctxt "nav" -msgid "Payments" -msgstr "Pagaments" - -#: web/template/app.gohtml:82 -msgctxt "nav" -msgid "Products" -msgstr "Productes" - -#: web/template/app.gohtml:83 -msgctxt "nav" -msgid "Contacts" -msgstr "Contactes" - -#: web/template/app.gohtml:91 -msgid "Numerus Version: %s" -msgstr "Numerus versió: %s" - #: web/template/contacts/new.gohtml:2 web/template/contacts/new.gohtml:11 #: web/template/contacts/new.gohtml:19 msgctxt "title" @@ -837,8 +833,8 @@ msgstr "Per defecte" #: web/template/payments/methods/index.gohtml:24 msgctxt "title" -msgid "Payment Method" -msgstr "Mètode de pagament" +msgid "Invoicing Method" +msgstr "Mètode de facturació" #: web/template/payments/methods/index.gohtml:25 msgctxt "title" @@ -846,8 +842,8 @@ msgid "Instructions" msgstr "Instruccions" #: web/template/payments/methods/index.gohtml:72 -msgid "No payment methods added yet." -msgstr "No hi ha cap mètode de pagament." +msgid "No invoicing methods added yet." +msgstr "No hi ha cap mètode de facturació." #: web/template/payments/methods/index.gohtml:90 msgctxt "action" @@ -856,13 +852,13 @@ msgstr "Estableix" #: web/template/payments/methods/index.gohtml:100 msgctxt "title" -msgid "New Payment Method" -msgstr "Nou mètode de pagament" +msgid "New Invoicing Method" +msgstr "Nou mètode de facturació" #: web/template/payments/methods/index.gohtml:109 msgctxt "action" -msgid "Add new payment method" -msgstr "Afegeix nou mètode de pagament" +msgid "Add new invoicing method" +msgstr "Afegeix nou mètode de facturació" #: web/template/payments/methods/edit.gohtml:18 msgctxt "action" @@ -1216,8 +1212,8 @@ msgstr "El percentatge ha de ser entre -99 i 99." #: pkg/company.go:781 msgctxt "input" -msgid "Payment method name" -msgstr "Nom del mètode de pagament" +msgid "Invoicing method name" +msgstr "Nom del mètode de facturació" #: pkg/company.go:787 msgctxt "input" @@ -1225,14 +1221,14 @@ msgid "Instructions" msgstr "Instruccions" #: pkg/company.go:824 -msgid "Payment method name can not be empty." -msgstr "No podeu deixar el nom del mètode de pagament en blanc." +msgid "Invoicing method name can not be empty." +msgstr "No podeu deixar el nom del mètode de facturació en blanc." #: pkg/company.go:825 msgid "Payment instructions can not be empty." msgstr "No podeu deixar les instruccions de pagament en blanc." -#: pkg/company.go:912 pkg/quote.go:755 pkg/invoices.go:928 +#: pkg/company.go:912 msgid "Selected payment method is not valid." msgstr "Heu seleccionat un mètode de pagament que no és vàlid." @@ -1312,12 +1308,12 @@ msgstr "Notes" #: pkg/quote.go:710 pkg/invoices.go:871 msgctxt "input" -msgid "Payment Method" -msgstr "Mètode de pagament" +msgid "Invoicing Method" +msgstr "Mètode de facturació" #: pkg/quote.go:711 -msgid "Select a payment method." -msgstr "Escolliu un mètode de pagament." +msgid "Select a invoicing method." +msgstr "Escolliu un mètode de facturació." #: pkg/quote.go:747 msgid "Selected quotation status is not valid." @@ -1335,6 +1331,10 @@ msgstr "No podeu deixar la data del pressupost en blanc." msgid "Quotation date must be a valid date." msgstr "La data del pressupost ha de ser vàlida." +#: pkg/quote.go:755 pkg/invoices.go:928 +msgid "Selected invoicing method is not valid." +msgstr "Heu seleccionat un mètode de facturació que no és vàlid." + #: pkg/quote.go:889 pkg/quote.go:894 pkg/invoices.go:1120 pkg/invoices.go:1125 msgctxt "input" msgid "Id" @@ -1672,6 +1672,32 @@ msgctxt "input" msgid "Holded Excel file" msgstr "Fitxer Excel del Holded" +#~ msgctxt "input" +#~ msgid "Payment method name" +#~ msgstr "Nom del mètode de pagament" + +#~ msgctxt "title" +#~ msgid "Payment Methods" +#~ msgstr "Mètodes de pagament" + +#~ msgid "Numerus Version: %s" +#~ msgstr "Numerus versió: %s" + +#~ msgctxt "title" +#~ msgid "Payment Method" +#~ msgstr "Mètode de pagament" + +#~ msgid "No payment methods added yet." +#~ msgstr "No hi ha cap mètode de pagament." + +#~ msgctxt "title" +#~ msgid "New Payment Method" +#~ msgstr "Nou mètode de pagament" + +#~ msgctxt "input" +#~ msgid "Payment Method" +#~ msgstr "Mètode de pagament" + #~ msgid "Selected invoice status is not valid." #~ msgstr "Heu seleccionat un estat de factura que no és vàlid." diff --git a/po/es.po b/po/es.po index 234af9c..78f1865 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: numerus\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n" -"POT-Creation-Date: 2024-08-30 02:37+0200\n" +"POT-Creation-Date: 2024-09-06 12:07+0200\n" "PO-Revision-Date: 2023-01-18 17:45+0100\n" "Last-Translator: jordi fita mas \n" "Language-Team: Spanish \n" @@ -458,32 +458,67 @@ msgctxt "title" msgid "Edit Quotation “%s”" msgstr "Edición del presupuesto «%s»" +#: web/template/app.gohtml:20 +msgctxt "nav" +msgid "Dashboard" +msgstr "Panel" + +#: web/template/app.gohtml:21 +msgctxt "nav" +msgid "Quotations" +msgstr "Presupuestos" + +#: web/template/app.gohtml:22 +msgctxt "nav" +msgid "Invoices" +msgstr "Facturas" + +#: web/template/app.gohtml:23 +msgctxt "nav" +msgid "Expenses" +msgstr "Gastos" + #: web/template/app.gohtml:24 +msgctxt "nav" +msgid "Payments" +msgstr "Pagos" + +#: web/template/app.gohtml:25 +msgctxt "nav" +msgid "Products" +msgstr "Productos" + +#: web/template/app.gohtml:26 +msgctxt "nav" +msgid "Contacts" +msgstr "Contactos" + +#: web/template/app.gohtml:37 msgctxt "menu" msgid "Account" msgstr "Cuenta" -#: web/template/app.gohtml:30 +#: web/template/app.gohtml:43 msgctxt "menu" msgid "Tax Details" msgstr "Configuración fiscal" -#: web/template/app.gohtml:36 web/template/company/invoicing.gohtml:3 +#: web/template/app.gohtml:49 web/template/company/invoicing.gohtml:3 msgctxt "title" msgid "Invoicing and Quoting" msgstr "Facturación y presupuestos" -#: web/template/app.gohtml:42 web/template/company/taxes.gohtml:3 +#: web/template/app.gohtml:55 web/template/company/taxes.gohtml:3 msgctxt "title" msgid "Taxes" msgstr "Impuestos" -#: web/template/app.gohtml:48 web/template/payments/methods/index.gohtml:3 +#: web/template/app.gohtml:61 web/template/payments/methods/index.gohtml:3 msgctxt "title" -msgid "Payment Methods" -msgstr "Métodos de pago" +msgid "Invoicing Methods" +msgstr "Métodos de facturación" -#: web/template/app.gohtml:54 web/template/payments/accounts/new.gohtml:11 +#: web/template/app.gohtml:67 web/template/payments/accounts/new.gohtml:11 #: web/template/payments/accounts/index.gohtml:3 #: web/template/payments/accounts/index.gohtml:11 #: web/template/payments/accounts/edit.gohtml:11 @@ -491,55 +526,16 @@ msgctxt "title" msgid "Payment Accounts" msgstr "Cuenta de pago" -#: web/template/app.gohtml:60 +#: web/template/app.gohtml:73 msgctxt "menu" msgid "Switch Company" msgstr "Cambio de empresa" -#: web/template/app.gohtml:68 +#: web/template/app.gohtml:81 msgctxt "action" msgid "Logout" msgstr "Salir" -#: web/template/app.gohtml:77 -msgctxt "nav" -msgid "Dashboard" -msgstr "Panel" - -#: web/template/app.gohtml:78 -msgctxt "nav" -msgid "Quotations" -msgstr "Presupuestos" - -#: web/template/app.gohtml:79 -msgctxt "nav" -msgid "Invoices" -msgstr "Facturas" - -#: web/template/app.gohtml:80 -msgctxt "nav" -msgid "Expenses" -msgstr "Gastos" - -#: web/template/app.gohtml:81 -msgctxt "nav" -msgid "Payments" -msgstr "Pagos" - -#: web/template/app.gohtml:82 -msgctxt "nav" -msgid "Products" -msgstr "Productos" - -#: web/template/app.gohtml:83 -msgctxt "nav" -msgid "Contacts" -msgstr "Contactos" - -#: web/template/app.gohtml:91 -msgid "Numerus Version: %s" -msgstr "Numerus versión: %s" - #: web/template/contacts/new.gohtml:2 web/template/contacts/new.gohtml:11 #: web/template/contacts/new.gohtml:19 msgctxt "title" @@ -837,8 +833,8 @@ msgstr "Por defecto" #: web/template/payments/methods/index.gohtml:24 msgctxt "title" -msgid "Payment Method" -msgstr "Método de pago" +msgid "Invoicing Method" +msgstr "Método de facturación" #: web/template/payments/methods/index.gohtml:25 msgctxt "title" @@ -846,8 +842,8 @@ msgid "Instructions" msgstr "Instrucciones" #: web/template/payments/methods/index.gohtml:72 -msgid "No payment methods added yet." -msgstr "No hay métodos de pago." +msgid "No invoicing methods added yet." +msgstr "No hay métodos de facturación." #: web/template/payments/methods/index.gohtml:90 msgctxt "action" @@ -856,13 +852,13 @@ msgstr "Establecer" #: web/template/payments/methods/index.gohtml:100 msgctxt "title" -msgid "New Payment Method" -msgstr "Nuevo método de pago" +msgid "New Invoicing Method" +msgstr "Nuevo método de facturación" #: web/template/payments/methods/index.gohtml:109 msgctxt "action" -msgid "Add new payment method" -msgstr "Añadir nuevo método de pago" +msgid "Add new invoicing method" +msgstr "Añadir nuevo método de facturación" #: web/template/payments/methods/edit.gohtml:18 msgctxt "action" @@ -1216,8 +1212,8 @@ msgstr "El porcentaje tiene que estar entre -99 y 99." #: pkg/company.go:781 msgctxt "input" -msgid "Payment method name" -msgstr "Nombre del método de pago" +msgid "Invoicing method name" +msgstr "Nombre del método de facturación" #: pkg/company.go:787 msgctxt "input" @@ -1225,14 +1221,14 @@ msgid "Instructions" msgstr "Instrucciones" #: pkg/company.go:824 -msgid "Payment method name can not be empty." -msgstr "No podéis dejar el nombre del método de pago en blanco." +msgid "Invoicing method name can not be empty." +msgstr "No podéis dejar el nombre del método de facturación en blanco." #: pkg/company.go:825 msgid "Payment instructions can not be empty." msgstr "No podéis dejar las instrucciones de pago en blanco." -#: pkg/company.go:912 pkg/quote.go:755 pkg/invoices.go:928 +#: pkg/company.go:912 msgid "Selected payment method is not valid." msgstr "Habéis escogido un método de pago que no es válido." @@ -1312,12 +1308,12 @@ msgstr "Notas" #: pkg/quote.go:710 pkg/invoices.go:871 msgctxt "input" -msgid "Payment Method" -msgstr "Método de pago" +msgid "Invoicing Method" +msgstr "Método de facturación" #: pkg/quote.go:711 -msgid "Select a payment method." -msgstr "Escoged un método e pago." +msgid "Select a invoicing method." +msgstr "Escoged un método de facturación." #: pkg/quote.go:747 msgid "Selected quotation status is not valid." @@ -1335,6 +1331,10 @@ msgstr "No podéis dejar la fecha del presupuesto en blanco." msgid "Quotation date must be a valid date." msgstr "La fecha de presupuesto debe ser válida." +#: pkg/quote.go:755 pkg/invoices.go:928 +msgid "Selected invoicing method is not valid." +msgstr "Habéis escogido un método de facturación que no es válido." + #: pkg/quote.go:889 pkg/quote.go:894 pkg/invoices.go:1120 pkg/invoices.go:1125 msgctxt "input" msgid "Id" @@ -1672,6 +1672,32 @@ msgctxt "input" msgid "Holded Excel file" msgstr "Archivo Excel de Holded" +#~ msgctxt "input" +#~ msgid "Payment method name" +#~ msgstr "Nombre del método de pago" + +#~ msgctxt "title" +#~ msgid "Payment Methods" +#~ msgstr "Métodos de pago" + +#~ msgid "Numerus Version: %s" +#~ msgstr "Numerus versión: %s" + +#~ msgctxt "title" +#~ msgid "Payment Method" +#~ msgstr "Método de pago" + +#~ msgid "No payment methods added yet." +#~ msgstr "No hay métodos de pago." + +#~ msgctxt "title" +#~ msgid "New Payment Method" +#~ msgstr "Nuevo método de pago" + +#~ msgctxt "input" +#~ msgid "Payment Method" +#~ msgstr "Método de pago" + #~ msgid "Selected invoice status is not valid." #~ msgstr "Habéis escogido un estado de factura que no es válido." diff --git a/web/template/app.gohtml b/web/template/app.gohtml index be488f7..5801914 100644 --- a/web/template/app.gohtml +++ b/web/template/app.gohtml @@ -58,7 +58,7 @@
  • - {{( pgettext "Payment Methods" "title" )}} + {{( pgettext "Invoicing Methods" "title" )}}
  • diff --git a/web/template/payments/methods/index.gohtml b/web/template/payments/methods/index.gohtml index 490c2c4..10a5860 100644 --- a/web/template/payments/methods/index.gohtml +++ b/web/template/payments/methods/index.gohtml @@ -1,6 +1,6 @@ {{ define "title" -}} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentMethodsPage*/ -}} - {{( pgettext "Payment Methods" "title" )}} + {{( pgettext "Invoicing Methods" "title" )}} {{- end }} {{ define "breadcrumbs" -}} @@ -21,7 +21,7 @@ {{( pgettext "Default" "title" )}} - {{( pgettext "Payment Method" "title" )}} + {{( pgettext "Invoicing Method" "title" )}} {{( pgettext "Instructions" "title" )}} @@ -47,7 +47,7 @@ {{ .Instructions }} @@ -60,7 +60,7 @@ > {{ csrfToken }} {{ deleteMethod }} - @@ -69,7 +69,7 @@ {{- end }} {{ else }} - {{( gettext "No payment methods added yet." )}} + {{( gettext "No invoicing methods added yet." )}} {{ end }} @@ -97,7 +97,7 @@
    -

    {{( pgettext "New Payment Method" "title")}}

    +

    {{( pgettext "New Invoicing Method" "title")}}

    {{ csrfToken }} {{ with .Form -}} @@ -106,7 +106,7 @@ {{- end }}