diff --git a/changelog.md b/changelog.md index acf2323..8379841 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2024-12-02 - 1.3.0 - feat(translation) +Add multi-language support for document translations. + +- Implemented translation interface for document labels. +- Added Spanish translations alongside existing English and German. +- Updated content invoice, page header, and page footer elements to utilize language-specific translations. + ## 2024-12-01 - 1.2.0 - feat(core) Enhance document generation capabilities with improved modular structure and extended translation support. diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 8ba00ed..028f411 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@design.estate/dees-document', - version: '1.2.0', + version: '1.3.0', description: 'A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.' } diff --git a/ts/interfaces/translation.ts b/ts/interfaces/translation.ts index b270b93..6ac746c 100644 --- a/ts/interfaces/translation.ts +++ b/ts/interfaces/translation.ts @@ -1,4 +1,19 @@ export interface IDeDocumentTranslations { - "invoice": string; - "quantity": string; + address: string; + bankConnection: string; + contactInfo: string; + description: string; + invoice: string; + itemPos: string; + quantity: string; + registrationInfo: string; + reverseVatNote: string; + totalNetPrice: string; + unitNetPrice: string; + unitType: string; + yourCustomerId: string; + yourVatId: string; + continuesOnPage: string; + finalPageStatement: string; + page: string; } \ No newline at end of file diff --git a/ts/shared/translation.ts b/ts/shared/translation.ts index b2a80e9..68de73c 100644 --- a/ts/shared/translation.ts +++ b/ts/shared/translation.ts @@ -5,18 +5,69 @@ type TTranslationImplementation = { } export const EN_translations: TTranslationImplementation = { + address: 'Address', + bankConnection: 'Bank Connection', + contactInfo: 'Contact Info', + description: 'Description', invoice: 'Invoice', + itemPos: 'Item Pos.', quantity: 'Quantity', + registrationInfo: 'Registration Info', + reverseVatNote: 'VAT arises on a reverse charge basis and is payable by the customer.', + totalNetPrice: 'Total Net Price', + unitNetPrice: 'Unit Net Price', + unitType: 'Unit Type', + yourCustomerId: 'Your Customer ID:', + yourVatId: 'Your vat id on file:', + continuesOnPage: 'Continues on page', + finalPageStatement: 'This is the final page of this document.', + page: 'Page', }; export const DE_translations: TTranslationImplementation = { + address: 'Adresse', + bankConnection: 'Bankverbindung', + contactInfo: 'Kontaktinformationen', + description: 'Beschreibung', invoice: 'Rechnung', + itemPos: 'Pos.', quantity: 'Anzahl', + registrationInfo: 'HRA/HRB Info', + reverseVatNote: 'Umkehr der Umsatzsteuerpflicht: Der Rechnungsempfänger ist für die korrekte Abrechnung der Umsatzsteuer zuständig.', + totalNetPrice: 'Nettopreis Summe', + unitNetPrice: 'Nettopreis', + unitType: 'Einheit', + yourCustomerId: 'Ihre Kundennummer:', + yourVatId: 'Ihre Umsatzsteuer-ID:', + continuesOnPage: 'Fortsetzung auf Seite', + finalPageStatement: 'Diese ist die letzte Seite einer Dokumente.', + page: 'Seite', +}; + +export const ES_translations: TTranslationImplementation = { + address: 'Dirección', + bankConnection: 'Conexión bancaria', + contactInfo: 'Información de contacto', + description: 'Descripción', + invoice: 'Factura', + itemPos: 'Pos.', + quantity: 'Cantidad', + registrationInfo: 'Información de registro', + reverseVatNote: 'La declaración de IVA se aplica en base a la factura de venta, y se paga por el cliente.', + totalNetPrice: 'Precio total neto', + unitNetPrice: 'Precio unitario neto', + unitType: 'Tipo de unidad', + yourCustomerId: 'Su número de cliente:', + yourVatId: 'Su ID de IVA:', + continuesOnPage: 'Continues on page', + finalPageStatement: 'This is the final page of this document.', + page: 'Page', }; export const languageCodeMap = { 'DE': DE_translations, 'EN': EN_translations, + 'ES': ES_translations, }; export type TLanguageCode = keyof typeof languageCodeMap; diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index 8ba00ed..028f411 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@design.estate/dees-document', - version: '1.2.0', + version: '1.3.0', description: 'A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.' } diff --git a/ts_web/elements/contentinvoice.ts b/ts_web/elements/contentinvoice.ts index b3dcf47..f6dc709 100644 --- a/ts_web/elements/contentinvoice.ts +++ b/ts_web/elements/contentinvoice.ts @@ -16,7 +16,7 @@ import { } from '@design.estate/dees-element'; import * as plugins from '../plugins.js'; import * as shared from '../../ts/shared/index.js'; - +import * as interfaces from '../../ts/interfaces/index.js'; declare global { @@ -45,6 +45,12 @@ export class DeContentInvoice extends DeesElement { }) public letterData: plugins.tsclass.business.ILetter; + @property({ + type: Object, + reflect: true, + }) + public documentSettings: interfaces.IDocumentSettings; + constructor() { super(); domtools.DomTools.setupDomTools(); @@ -275,12 +281,12 @@ export class DeContentInvoice extends DeesElement {