feat(FalukantService, i18n): enhance household tension handling and localization updates
All checks were successful
Deploy to production / deploy (push) Successful in 1m55s
All checks were successful
Deploy to production / deploy (push) Successful in 1m55s
- Added functionality to refresh and update household tension scores and reasons in the FalukantService, improving user experience by reflecting real-time household dynamics. - Updated localization strings across multiple languages (Cebuano, German, English, Spanish, French) to include new office rank terminology and improved marriage crisis descriptions, enhancing clarity and context for users. - Introduced a new office rank tier structure in localization files, providing better categorization and understanding of office ranks in the game.
This commit is contained in:
@@ -4956,7 +4956,12 @@ class FalukantService extends BaseService {
|
||||
};
|
||||
}
|
||||
|
||||
const tensionRefresh = await this.refreshHouseholdTensionState(falukantUser, falukantUser.character);
|
||||
const plainHouse = userHouse.get({ plain: true });
|
||||
if (tensionRefresh) {
|
||||
plainHouse.householdTensionScore = tensionRefresh.score;
|
||||
plainHouse.householdTensionReasonsJson = tensionRefresh.reasons;
|
||||
}
|
||||
plainHouse.servantSummary = this.buildServantSummary(plainHouse, falukantUser.character);
|
||||
plainHouse.debtorsPrison = await this.getDebtorsPrisonStateForUser(falukantUser);
|
||||
return plainHouse;
|
||||
|
||||
@@ -624,8 +624,8 @@
|
||||
"reputation": "Popularidad bisan {amount}",
|
||||
"house_position": "Kinahanglan ang lebel sa panimalay: {label}",
|
||||
"house_condition": "Kahimtang sa balay bisan {quality}",
|
||||
"office_rank_any": "Pinakataas nga politikal o simbahan nga opisina bisan ranggo {amount}",
|
||||
"office_rank_political": "Pinakataas nga politikal nga opisina bisan ranggo {amount}",
|
||||
"office_rank_any": "Pinakataas nga politikal o simbahan nga opisina bisan ranggo nga “{rankName}”",
|
||||
"office_rank_political": "Pinakataas nga politikal nga opisina bisan ranggo nga “{rankName}”",
|
||||
"lover_count_min": "Bisan {amount} ka minyo o pinalabi",
|
||||
"lover_count_max": "Dili molapas sa {amount} ka minyo o pinalabi",
|
||||
"unknown": "{type}: {amount}"
|
||||
@@ -650,6 +650,15 @@
|
||||
"usable": "gamiton pa"
|
||||
},
|
||||
"houseConditionPercent": "{pct}%",
|
||||
"officeRankTier": {
|
||||
"1": "sulod nga opisina sa lungsod",
|
||||
"2": "konseho ug espesyalista nga opisina",
|
||||
"3": "nag-unang lokal nga opisina",
|
||||
"4": "tunga-tunga nga administrasyon sa estado",
|
||||
"5": "taas nga opisina sa estado",
|
||||
"6": "pinakataas nga imperyal nga opisina",
|
||||
"fallback": "ranggo {tier}"
|
||||
},
|
||||
"officeWithRank": "{label} (ranggo {rank})",
|
||||
"advance": {
|
||||
"confirm": "Hangyo og pag-uswag",
|
||||
@@ -1037,7 +1046,7 @@
|
||||
"loverChild": "Bata gikan sa usa ka uyab",
|
||||
"disorder": "Disorder sa ang balay",
|
||||
"tooFewServants": "Too few sulugoons",
|
||||
"marriageCrisis": "Kasal crisis"
|
||||
"marriageCrisis": "Ubos nga kasal satisfaction (makapasakit sa kalinaw sa balay)"
|
||||
}
|
||||
},
|
||||
"marriageActions": {
|
||||
|
||||
@@ -699,7 +699,7 @@
|
||||
"loverChild": "Kind aus Liebschaft",
|
||||
"disorder": "Unordnung im Haus",
|
||||
"tooFewServants": "Zu wenig Diener",
|
||||
"marriageCrisis": "Ehekrise"
|
||||
"marriageCrisis": "Niedrige Ehezufriedenheit (belastet den Hausfrieden)"
|
||||
}
|
||||
},
|
||||
"marriageActions": {
|
||||
@@ -1134,8 +1134,8 @@
|
||||
"reputation": "Beliebtheit mindestens {amount}",
|
||||
"house_position": "Hausstand mindestens: {label}",
|
||||
"house_condition": "Hauszustand mindestens {quality}",
|
||||
"office_rank_any": "Höchstes politisches oder kirchliches Amt mindestens Rang {amount}",
|
||||
"office_rank_political": "Höchstes politisches Amt mindestens Rang {amount}",
|
||||
"office_rank_any": "Höchstes politisches oder kirchliches Amt mindestens Rang „{rankName}“",
|
||||
"office_rank_political": "Höchstes politisches Amt mindestens Rang „{rankName}“",
|
||||
"lover_count_min": "Mindestens {amount} Liebhaber oder Mätressen",
|
||||
"lover_count_max": "Höchstens {amount} Liebhaber oder Mätressen",
|
||||
"unknown": "{type}: {amount}"
|
||||
@@ -1160,6 +1160,15 @@
|
||||
"usable": "brauchbar"
|
||||
},
|
||||
"houseConditionPercent": "{pct} %",
|
||||
"officeRankTier": {
|
||||
"1": "Gemeinde- und Grundämter",
|
||||
"2": "Ratsherrschaft und Fachämter",
|
||||
"3": "leitende Kommunalämter",
|
||||
"4": "mittlere Staatsebene",
|
||||
"5": "hohe Staatsämter",
|
||||
"6": "höchstes Reichsamt",
|
||||
"fallback": "Stufe {tier}"
|
||||
},
|
||||
"officeWithRank": "{label} (Rang {rank})",
|
||||
"advance": {
|
||||
"confirm": "Aufsteigen beantragen",
|
||||
|
||||
@@ -559,8 +559,8 @@
|
||||
"reputation": "Popularity at least {amount}",
|
||||
"house_position": "Household at least: {label}",
|
||||
"house_condition": "House condition at least {quality}",
|
||||
"office_rank_any": "Highest political or church office at least rank {amount}",
|
||||
"office_rank_political": "Highest political office at least rank {amount}",
|
||||
"office_rank_any": "Highest political or church office at least rank “{rankName}”",
|
||||
"office_rank_political": "Highest political office at least rank “{rankName}”",
|
||||
"lover_count_min": "At least {amount} lovers or favorites",
|
||||
"lover_count_max": "At most {amount} lovers or favorites",
|
||||
"unknown": "{type}: {amount}"
|
||||
@@ -585,6 +585,15 @@
|
||||
"usable": "adequate"
|
||||
},
|
||||
"houseConditionPercent": "{pct}%",
|
||||
"officeRankTier": {
|
||||
"1": "entry-level municipal offices",
|
||||
"2": "council and specialist offices",
|
||||
"3": "leading local offices",
|
||||
"4": "mid-level state administration",
|
||||
"5": "senior state offices",
|
||||
"6": "highest imperial office",
|
||||
"fallback": "tier {tier}"
|
||||
},
|
||||
"officeWithRank": "{label} (rank {rank})",
|
||||
"advance": {
|
||||
"confirm": "Request advancement",
|
||||
@@ -928,7 +937,7 @@
|
||||
"loverChild": "Child from an affair",
|
||||
"disorder": "Disorder in the house",
|
||||
"tooFewServants": "Too few servants",
|
||||
"marriageCrisis": "Marriage crisis"
|
||||
"marriageCrisis": "Low marriage satisfaction (strains household peace)"
|
||||
}
|
||||
},
|
||||
"marriageActions": {
|
||||
|
||||
@@ -699,7 +699,7 @@
|
||||
"loverChild": "Hijo de una relación",
|
||||
"disorder": "Desorden en la casa",
|
||||
"tooFewServants": "Muy pocos sirvientes",
|
||||
"marriageCrisis": "Crisis matrimonial"
|
||||
"marriageCrisis": "Baja satisfacción conyugal (tensa el ambiente en casa)"
|
||||
}
|
||||
},
|
||||
"marriageActions": {
|
||||
@@ -1134,8 +1134,8 @@
|
||||
"reputation": "Popularidad mínima {amount}",
|
||||
"house_position": "Hogar al menos: {label}",
|
||||
"house_condition": "Estado de la casa al menos {quality}",
|
||||
"office_rank_any": "Cargo político o eclesiástico más alto al menos rango {amount}",
|
||||
"office_rank_political": "Cargo político más alto al menos rango {amount}",
|
||||
"office_rank_any": "Cargo político o eclesiástico más alto al menos rango «{rankName}»",
|
||||
"office_rank_political": "Cargo político más alto al menos rango «{rankName}»",
|
||||
"lover_count_min": "Al menos {amount} amantes o favoritos",
|
||||
"lover_count_max": "Como máximo {amount} amantes o favoritos",
|
||||
"unknown": "{type}: {amount}"
|
||||
@@ -1160,6 +1160,15 @@
|
||||
"usable": "aceptable"
|
||||
},
|
||||
"houseConditionPercent": "{pct} %",
|
||||
"officeRankTier": {
|
||||
"1": "oficios municipales de base",
|
||||
"2": "consejo y oficios especializados",
|
||||
"3": "oficios locales directivos",
|
||||
"4": "administración regional intermedia",
|
||||
"5": "altos cargos estatales",
|
||||
"6": "máximo cargo imperial",
|
||||
"fallback": "nivel {tier}"
|
||||
},
|
||||
"officeWithRank": "{label} (rango {rank})",
|
||||
"advance": {
|
||||
"confirm": "Solicitar ascenso",
|
||||
|
||||
@@ -697,7 +697,7 @@
|
||||
"loverChild": "Enfant d'amour",
|
||||
"disorder": "Encombrement dans la maison",
|
||||
"tooFewServants": "Trop peu de serviteurs",
|
||||
"marriageCrisis": "Crise conjugale"
|
||||
"marriageCrisis": "Faible satisfaction du couple (tension au foyer)"
|
||||
}
|
||||
},
|
||||
"marriageActions": {
|
||||
@@ -1123,8 +1123,8 @@
|
||||
"reputation": "Popularité d'au moins {amount}",
|
||||
"house_position": "Ménage au moins : {label}",
|
||||
"house_condition": "État de la maison au moins {quality}",
|
||||
"office_rank_any": "Fonction politique ou ecclésiastique la plus élevée au moins rang {amount}",
|
||||
"office_rank_political": "Fonction politique la plus élevée, au moins rang {amount}",
|
||||
"office_rank_any": "Fonction politique ou ecclésiastique la plus élevée au moins rang « {rankName} »",
|
||||
"office_rank_political": "Fonction politique la plus élevée, au moins rang « {rankName} »",
|
||||
"lover_count_min": "Au moins {amount} amants ou maîtresses",
|
||||
"lover_count_max": "Au maximum {amount} amants ou maîtresses",
|
||||
"unknown": "{type} : {amount}"
|
||||
@@ -1149,6 +1149,15 @@
|
||||
"usable": "utile"
|
||||
},
|
||||
"houseConditionPercent": "{pct} %",
|
||||
"officeRankTier": {
|
||||
"1": "fonctions municipales d’entrée",
|
||||
"2": "conseil et fonctions spécialisées",
|
||||
"3": "fonctions locales dirigeantes",
|
||||
"4": "administration d’État intermédiaire",
|
||||
"5": "hautes fonctions d’État",
|
||||
"6": "plus haute fonction impériale",
|
||||
"fallback": "niveau {tier}"
|
||||
},
|
||||
"officeWithRank": "{label} (rang {rank})",
|
||||
"advance": {
|
||||
"confirm": "Postuler pour un avancement",
|
||||
|
||||
@@ -196,6 +196,15 @@
|
||||
const quality = this.formatHouseCondition(numericValue);
|
||||
return this.$t('falukant.nobility.requirement.house_condition', { quality });
|
||||
}
|
||||
if (type === 'office_rank_any' || type === 'office_rank_political') {
|
||||
const rankName = this.officeRankTierLabel(numericValue);
|
||||
const key = `falukant.nobility.requirement.${type}`;
|
||||
const translated = this.$t(key, { rankName });
|
||||
if (translated && translated !== key) {
|
||||
return translated;
|
||||
}
|
||||
return this.$t('falukant.nobility.requirement.unknown', { type, amount: rankName });
|
||||
}
|
||||
const key = `falukant.nobility.requirement.${type}`;
|
||||
const translated = this.$t(key, { amount });
|
||||
if (translated && translated !== key) {
|
||||
@@ -210,6 +219,18 @@
|
||||
&& String(u.required) === String(req.requirementValue)
|
||||
);
|
||||
},
|
||||
officeRankTierLabel(tierRaw) {
|
||||
const tier = Math.round(Number(tierRaw));
|
||||
if (!Number.isFinite(tier) || tier < 1) {
|
||||
return this.$t('falukant.nobility.officeRankTier.fallback', { tier: tierRaw });
|
||||
}
|
||||
const capped = Math.min(6, tier);
|
||||
const k = `falukant.nobility.officeRankTier.${capped}`;
|
||||
if (this.$te(k)) {
|
||||
return this.$t(k);
|
||||
}
|
||||
return this.$t('falukant.nobility.officeRankTier.fallback', { tier: capped });
|
||||
},
|
||||
formatOfficeInfo(info, source) {
|
||||
if (!info?.name) {
|
||||
return this.$t('falukant.nobility.none');
|
||||
|
||||
Reference in New Issue
Block a user