feat(MessagesDialog, StatusBar, i18n): enhance character death notifications and UI updates
- Added support for displaying character death notifications with detailed information including age, region, and relationships in both German and English. - Updated MessagesDialog to format additional parameters such as region, spouses, children, and lovers based on the locale. - Enhanced StatusBar to show the character's name dynamically, improving user experience. - Modified i18n files to include new notification messages for character deaths, ensuring accurate translations for both languages.
This commit is contained in:
@@ -219,6 +219,8 @@ export default {
|
||||
|
||||
formatParams(params) {
|
||||
const formatted = {};
|
||||
const locale = this.$i18n?.locale || 'de';
|
||||
const isGerman = String(locale).startsWith('de');
|
||||
|
||||
// Geldbeträge formatieren
|
||||
if (params.amount !== undefined) {
|
||||
@@ -246,6 +248,26 @@ export default {
|
||||
if (params.storage_destruction_percent !== undefined) {
|
||||
formatted.destructionPercent = ` Lager zerstört: ${params.storage_destruction_percent.toFixed(1)}%.`;
|
||||
}
|
||||
if (params.regionLabel) {
|
||||
formatted.regionLabel = isGerman
|
||||
? ` Ort: ${params.regionLabel}.`
|
||||
: ` Location: ${params.regionLabel}.`;
|
||||
}
|
||||
if (params.spouses) {
|
||||
formatted.spouses = isGerman
|
||||
? ` Ehepartner: ${params.spouses}.`
|
||||
: ` Spouses: ${params.spouses}.`;
|
||||
}
|
||||
if (params.children) {
|
||||
formatted.children = isGerman
|
||||
? ` Kinder: ${params.children}.`
|
||||
: ` Children: ${params.children}.`;
|
||||
}
|
||||
if (params.lovers) {
|
||||
formatted.lovers = isGerman
|
||||
? ` Geliebte: ${params.lovers}.`
|
||||
: ` Lovers: ${params.lovers}.`;
|
||||
}
|
||||
|
||||
// Alle anderen Parameter übernehmen
|
||||
for (const [key, value] of Object.entries(params)) {
|
||||
@@ -304,6 +326,30 @@ export default {
|
||||
if (n.amount !== undefined) {
|
||||
params.amount = n.amount;
|
||||
}
|
||||
|
||||
if (n.deceased && typeof n.deceased === 'object') {
|
||||
if (n.deceased.display_name) {
|
||||
params.characterName = n.deceased.display_name;
|
||||
}
|
||||
if (n.deceased.region_label) {
|
||||
params.regionLabel = n.deceased.region_label;
|
||||
}
|
||||
if (n.deceased.age_years !== undefined && n.deceased.age_years !== null) {
|
||||
params.ageYears = n.deceased.age_years;
|
||||
}
|
||||
}
|
||||
|
||||
if (n.linked && typeof n.linked === 'object') {
|
||||
if (Array.isArray(n.linked.spouses) && n.linked.spouses.length > 0) {
|
||||
params.spouses = n.linked.spouses.join(', ');
|
||||
}
|
||||
if (Array.isArray(n.linked.children) && n.linked.children.length > 0) {
|
||||
params.children = n.linked.children.join(', ');
|
||||
}
|
||||
if (Array.isArray(n.linked.lovers) && n.linked.lovers.length > 0) {
|
||||
params.lovers = n.linked.lovers.join(', ');
|
||||
}
|
||||
}
|
||||
|
||||
return this.formatParams(params);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user