2024-12-01 22:04:28 +00:00
|
|
|
import * as interfaces from '../interfaces/index.js';
|
2024-11-30 19:54:15 +00:00
|
|
|
|
|
|
|
type TTranslationImplementation = {
|
|
|
|
[key in keyof interfaces.IDeDocumentTranslations]: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const EN_translations: TTranslationImplementation = {
|
2024-12-02 11:46:28 +00:00
|
|
|
address: 'Address',
|
|
|
|
bankConnection: 'Bank Connection',
|
|
|
|
contactInfo: 'Contact Info',
|
|
|
|
description: 'Description',
|
2024-11-30 19:54:15 +00:00
|
|
|
invoice: 'Invoice',
|
2024-12-02 11:46:28 +00:00
|
|
|
itemPos: 'Item Pos.',
|
2024-11-30 19:54:15 +00:00
|
|
|
quantity: 'Quantity',
|
2024-12-02 11:46:28 +00:00
|
|
|
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',
|
2024-11-30 19:54:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const DE_translations: TTranslationImplementation = {
|
2024-12-02 11:46:28 +00:00
|
|
|
address: 'Adresse',
|
|
|
|
bankConnection: 'Bankverbindung',
|
|
|
|
contactInfo: 'Kontaktinformationen',
|
|
|
|
description: 'Beschreibung',
|
2024-11-30 19:54:15 +00:00
|
|
|
invoice: 'Rechnung',
|
2024-12-02 11:46:28 +00:00
|
|
|
itemPos: 'Pos.',
|
2024-11-30 19:54:15 +00:00
|
|
|
quantity: 'Anzahl',
|
2024-12-02 11:46:28 +00:00
|
|
|
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',
|
2024-11-30 19:54:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const languageCodeMap = {
|
|
|
|
'DE': DE_translations,
|
|
|
|
'EN': EN_translations,
|
2024-12-02 11:46:28 +00:00
|
|
|
'ES': ES_translations,
|
2024-11-30 19:54:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export type TLanguageCode = keyof typeof languageCodeMap;
|
|
|
|
|
|
|
|
export const translate = (languageCode: TLanguageCode, key: string, defaultValue: string) => {
|
|
|
|
const translations = languageCodeMap[languageCode] || EN_translations;
|
|
|
|
if (translations && translations[key]) {
|
|
|
|
return translations[key];
|
|
|
|
} else {
|
|
|
|
return defaultValue;
|
|
|
|
}
|
|
|
|
};
|