Templates
Translation Strings
Translation strings allow you to define text in multiple languages for use in a Cakedesk template.
Define translations in your template.json file using the strings property. They can then be accessed using the t() helper.
#Template.json Example
{
"name": "A Template with Translations",
"strings": {
"tax": {
"de": "Steuer",
"en": "Tax"
},
"thank_you_for_your_trust": {
"de": "Danke für dein Vertrauen!",
"en": "Thank you for your trust!"
}
}
}
#EJS Example
Use the strings above in your template.ejs file like so:
<p><%= t('thank_you_for_your_trust') %></p>
#Supported Languages
Currently, Cakedesk supports the following languages:
- English (en)
- German (de)
- Dutch (nl)
- Hungarian (hu)
- Swedish (sv)
- Finnish (fi)
- Spanish (es)
- Polish (pl)
- Slovenian (sl)
If you require support for additional languages, please reach out to me!
#Built-In Strings
The following strings are built into Cakedesk and do not need to be defined in your template.json file. But you can override them if you wish.
{
"amount": "Amount",
"an_error_occurred_reading_the_template_file": "An error occurred reading the template file.",
"an_error_occurred_rendering_this_template": "An error occurred rendering this template.",
"client": "Client",
"clientID": "Client ID",
"clientIDShort": "Client ID",
"date": "Date",
"deliveryDate": "Delivery Date",
"description": "Description",
"email": "Email",
"error": "Error",
"invoice": "Invoice",
"invoiceDate": "Invoice Date",
"invoiceID": "Invoice ID",
"invoiceIDShort": "Invoice ID",
"invoiceTotal": "Invoice total",
"pay_to": "Pay to",
"phone": "Phone",
"proposal": "Proposal",
"proposalDate": "Proposal date",
"proposalID": "Proposal ID",
"proposalIDShort": "Proposal ID",
"quantity": "Quantity",
"serviceDate": "Service Date",
"subtotal": "Subtotal",
"total": "Total",
"unitPrice": "Unit Price",
"vat": "VAT",
"vatID": "VAT ID",
"taxID": "Tax ID",
"website": "Website",
"invoice_proudly_created_using": "This invoice was proudly created using",
"proposal_proudly_created_using": "This proposal was proudly created using",
"itemNumber": "Item number",
"pay_with_qr_code": "Pay with QR code",
"creditNote": "Credit Note",
"discount": "Discount",
"afterDiscount": "After Discount"
}