working on translation of system messages

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-12-10 08:46:05 +01:00
parent 30add879ad
commit a4f08e13a6
4 changed files with 14 additions and 3 deletions

View File

@@ -125,7 +125,7 @@ CREATE TABLE IF NOT EXISTS {0} (
if (rs.next()) result = Bookmark.of(rs);
rs.close();
if (result != null) return result;
throw UmbrellaException.notFound("No bookmark with urlId {0}",id);
throw UmbrellaException.notFound("no_bookmark_for_urlid",id);
} catch (SQLException e) {
throw new UmbrellaException("Failed to load bookmark");
}

View File

@@ -7,6 +7,8 @@ import static de.srsoftware.tools.jdbc.Query.insertInto;
import static de.srsoftware.tools.jdbc.Query.select;
import static de.srsoftware.umbrella.contact.Constants.*;
import static de.srsoftware.umbrella.core.Constants.*;
import static de.srsoftware.umbrella.core.Errors.FAILED_TO_LOAD_CONTACTS_OF_USER;
import static de.srsoftware.umbrella.core.Errors.FAILED_TO_LOAD_CONTACT_BY_ID;
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.databaseException;
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.notFound;
import static java.text.MessageFormat.format;
@@ -94,9 +96,9 @@ public class SqliteDb extends BaseDb implements ContactDb{
if (rs.next()) contact = Contact.of(rs);
rs.close();
if (contact != null) return contact;
throw notFound("Failed to load contact with id = {0}", contactId);
throw notFound(FAILED_TO_LOAD_CONTACT_BY_ID, contactId);
} catch (SQLException e) {
throw databaseException("Failed to load contacts of user {0}",userId);
throw databaseException(FAILED_TO_LOAD_CONTACTS_OF_USER,userId);
}
}

View File

@@ -0,0 +1,6 @@
package de.srsoftware.umbrella.core;
public class Errors {
public static final String FAILED_TO_LOAD_CONTACT_BY_ID = "failed_to_load_contact_by_id";
public static final String FAILED_TO_LOAD_CONTACTS_OF_USER = "failed_to_load_contacts_of_user";
}

View File

@@ -95,6 +95,8 @@
"failed": "fehlgeschlagen",
"failed_login_attempts" : "Account nach {attempts} fehlgeschlagenen Logins gesperrt bis {release_time}",
"failed_to_load_contact_by_id": "Failed to load contact with id = {0}",
"failed_to_load_contacts_of_user": "Failed to load contacts of user {0}",
"family_name": "Familenname",
"file": "Datei",
"files": "Dateien",
@@ -182,6 +184,7 @@
"new_document_from": "{number} / neues {type}s-Dokument von {sender}",
"new_password": "neues Passwort",
"new_property": "neue Eigenschaft",
"no_bookmark_for_urlid": "No bookmark with urlId {0}",
"no_company": "keine Firma",
"no_project_for_id": "Kein Projekt mit ID {0} gefunden!",
"no_task_for_id": "Keine Aufgabe mit ID {0} gefunden!",