From 878cd62bbec00ac896d8569b8c0a064f7bad3b96 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 18 Jan 2023 16:36:29 +0100 Subject: [PATCH] Localization + bugfixes --- Core/Localization/de_DE/account.php | 1 + Core/Localization/de_DE/general.php | 8 +++++--- Core/Localization/en_US/account.php | 1 + Core/Localization/en_US/general.php | 8 +++++--- react/shared/api.js | 14 ++++++++++++-- react/shared/elements/data-table.js | 6 +++--- 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/Core/Localization/de_DE/account.php b/Core/Localization/de_DE/account.php index 238eb6c..a85e6c4 100644 --- a/Core/Localization/de_DE/account.php +++ b/Core/Localization/de_DE/account.php @@ -45,4 +45,5 @@ return [ "gpg_key" => "GPG-Schlüssel", "2fa_token" => "Zwei-Faktor Authentifizierung (2FA)", "profile_picture_of" => "Profilbild von", + "language" => "Sprache", ]; \ No newline at end of file diff --git a/Core/Localization/de_DE/general.php b/Core/Localization/de_DE/general.php index 3fc8c88..c14c71d 100644 --- a/Core/Localization/de_DE/general.php +++ b/Core/Localization/de_DE/general.php @@ -15,6 +15,7 @@ return [ "request" => "Anfordern", "cancel" => "Abbrechen", "confirm" => "Bestätigen", + "ok" => "OK", "language" => "Sprache", "loading" => "Laden", "logout" => "Ausloggen", @@ -22,6 +23,9 @@ return [ "name" => "Name", "type" => "Typ", "size" => "Größe", + "not_supported" => "Nicht unterstützt", + "yes" => "Ja", + "no" => "Nein", # dialog / actions "action" => "Aktion", @@ -36,6 +40,7 @@ return [ "delete" => "Löschen", "info" => "Info", "reload" => "Aktualisieren", + "success" => "Erfolg", # file "choose_file" => "Datei auswählen", @@ -65,7 +70,4 @@ return [ "datefns_time_format_precise" => "HH:mm:ss", "datefns_datetime_format" => "dd.MM.yyyy HH:mm", "datefns_datetime_format_precise" => "dd.MM.yyyy HH:mm:ss", - - # API - "no_api_key_registered" => "Kein gültiger API-Schlüssel registriert", ]; \ No newline at end of file diff --git a/Core/Localization/en_US/account.php b/Core/Localization/en_US/account.php index bf6ae1f..d6d835f 100644 --- a/Core/Localization/en_US/account.php +++ b/Core/Localization/en_US/account.php @@ -45,4 +45,5 @@ return [ "gpg_key" => "GPG Key", "2fa_token" => "Two-Factor Authentication (2FA)", "profile_picture_of" => "Profile Picture of", + "language" => "Language", ]; \ No newline at end of file diff --git a/Core/Localization/en_US/general.php b/Core/Localization/en_US/general.php index 7d850a4..ce24620 100644 --- a/Core/Localization/en_US/general.php +++ b/Core/Localization/en_US/general.php @@ -12,6 +12,9 @@ return [ "name" => "Name", "type" => "Type", "size" => "Size", + "not_supported" => "Not supported", + "yes" => "Yes", + "no" => "No", # dialog / actions "action" => "Action", @@ -24,6 +27,7 @@ return [ "request" => "Request", "cancel" => "Cancel", "confirm" => "Confirm", + "ok" => "OK", "remove" => "Remove", "change" => "Change", "reset" => "Reset", @@ -34,6 +38,7 @@ return [ "delete" => "Delete", "info" => "Info", "reload" => "Reload", + "success" => "Success", # file "choose_file" => "Choose File", @@ -66,7 +71,4 @@ return [ "datefns_time_format_precise" => "pp", "datefns_datetime_format" => "MM/dd/yyyy p", "datefns_datetime_format_precise" => "MM/dd/yyyy pp", - - # API - "no_api_key_registered" => "No valid API-Key registered", ]; \ No newline at end of file diff --git a/react/shared/api.js b/react/shared/api.js index 193b900..8bac1ab 100644 --- a/react/shared/api.js +++ b/react/shared/api.js @@ -326,11 +326,21 @@ export default class API { } async confirmGpgToken(token) { - return this.apiCall("user/confirmGPG", { token: token }); + let res = await this.apiCall("user/confirmGPG", { token: token }); + if (res.success) { + this.user.gpgKey.confirmed = true; + } + + return res; } async removeGPG(password) { - return this.apiCall("user/removeGPG", { password: password }); + let res = await this.apiCall("user/removeGPG", { password: password }); + if (res.success) { + this.user.gpgKey = null; + } + + return res; } async downloadGPG(userId) { diff --git a/react/shared/elements/data-table.js b/react/shared/elements/data-table.js index df476dd..336b21f 100644 --- a/react/shared/elements/data-table.js +++ b/react/shared/elements/data-table.js @@ -215,13 +215,13 @@ export class BoolColumn extends DataColumn { renderData(L, entry, index) { let data = super.renderData(L, entry); - return L(data ? "general.true" : "general.false"); + return L(data ? "general.yes" : "general.no"); } } export class ControlsColumn extends DataColumn { - constructor(buttons = [], params = {}) { - super("general.controls", null, { align: "center", ...params, sortable: false }); + constructor(label, buttons = [], params = {}) { + super(label, null, { align: "center", ...params, sortable: false }); this.buttons = buttons; }