1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-03-12 13:39:14 +01:00

Introduce files with the language header translations

This commit is contained in:
Daniel James Smith 2024-12-05 17:40:35 +01:00
parent 424836a749
commit 55785fadc1
No known key found for this signature in database
GPG Key ID: DA2E2EC600E1289B
3 changed files with 25 additions and 16 deletions

View File

@ -0,0 +1,10 @@
export const dutchHeaderTranslations: { [key: string]: string } = {
Titel: "Title",
Gebruikersnaam: "Username",
Wachtwoord: "Password",
Gewijzigd: "Modified",
Gemaakt: "Created",
"Verloopt op": "Expire on",
Beschrijving: "Description",
"Gewijzigd door": "Modified by",
};

View File

@ -0,0 +1,11 @@
export const germanHeaderTranslations: { [key: string]: string } = {
Titel: "Title",
Benutzername: "Username",
Konto: "Account",
Passwort: "Password",
"Geändert am": "Modified",
"Erstellt am": "Created",
"Läuft ab am": "Expire on",
Beschreibung: "Description",
"Geändert von": "Modified by",
};

View File

@ -6,6 +6,8 @@ import { BaseImporter } from "../base-importer";
import { Importer } from "../importer";
const _mappedColumns = new Set(["Title", "Username", "URL", "Password", "Description"]);
import { dutchHeaderTranslations } from "./dutch-csv-headers";
import { germanHeaderTranslations } from "./german-csv-headers";
/* Translates the headers from non-English to English
* This is necessary because the parser only maps English headers to ciphers
@ -13,24 +15,10 @@ const _mappedColumns = new Set(["Title", "Username", "URL", "Password", "Descrip
*/
function translateIntoEnglishHeaders(header: string): string {
const translations: { [key: string]: string } = {
Titel: "Title",
// The header column 'User name' is parsed by the parser, but cannot be used as a variable. This converts it to a valid variable name, prior to parsing.
"User name": "Username",
Benutzername: "Username",
Gebruikersnaam: "Username",
Konto: "Account",
Passwort: "Password",
Wachtwoord: "Password",
"Geändert am": "Modified",
Gewijzigd: "Modified",
"Erstellt am": "Created",
Gemaakt: "Created",
"Läuft ab am": "Expire on",
"Verloopt op": "Expire on",
Beschreibung: "Description",
Beschrijving: "Description",
"Geändert von": "Modified by",
"Gewijzigd door": "Modified by",
...germanHeaderTranslations,
...dutchHeaderTranslations,
};
return translations[header] || header;