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:
parent
424836a749
commit
55785fadc1
10
libs/importer/src/importers/passsordxp/dutch-csv-headers.ts
Normal file
10
libs/importer/src/importers/passsordxp/dutch-csv-headers.ts
Normal 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",
|
||||
};
|
11
libs/importer/src/importers/passsordxp/german-csv-headers.ts
Normal file
11
libs/importer/src/importers/passsordxp/german-csv-headers.ts
Normal 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",
|
||||
};
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user