feat(overview): add minimum office status label logic and update related translations
This commit is contained in:
@@ -830,7 +830,7 @@ export default {
|
||||
},
|
||||
certificateMinimumStatusValueLabel(type, required) {
|
||||
if (type === 'officePoints') {
|
||||
return this.$t('falukant.overview.certificate.statusValue.office.minimum', { rank: required });
|
||||
return this.certificateMinimumOfficeStatusLabel(required);
|
||||
}
|
||||
if (type === 'nobilityPoints') {
|
||||
const gender = this.falukantUser?.character?.gender || 'male';
|
||||
@@ -848,10 +848,28 @@ export default {
|
||||
certificateHouseStatusLabel(position, fallbackLabel = null) {
|
||||
const value = Number(position || 0);
|
||||
if (!value) return this.$t('falukant.overview.certificate.statusValue.house.none');
|
||||
const key = `falukant.nobility.advance.housePosition.${value}`;
|
||||
const key = `falukant.nobility.housePosition.${value}`;
|
||||
return this.$te(key)
|
||||
? this.$t(key)
|
||||
: (fallbackLabel || this.$t('falukant.nobility.advance.housePosition.fallback', { level: value }));
|
||||
: (fallbackLabel || this.$t('falukant.nobility.housePosition.fallback', { level: value }));
|
||||
},
|
||||
certificateMinimumOfficeStatusLabel(required) {
|
||||
const officesByRank = {
|
||||
1: { political: ['assessor', 'councillor'], church: ['village-priest'] },
|
||||
2: { political: ['council', 'beadle', 'town-clerk', 'master-builder', 'village-major', 'taxman', 'hangman'], church: ['parish-priest'] },
|
||||
3: { political: ['mayor', 'judge', 'bailif', 'sheriff', 'consultant', 'territorial-council'], church: ['dean'] },
|
||||
4: { political: ['treasurer', 'territorial-council-speaker', 'ruler-consultant', 'state-administrator', 'ministry-helper'], church: ['archdeacon'] },
|
||||
5: { political: ['super-state-administrator', 'governor', 'minister'], church: ['bishop'] },
|
||||
};
|
||||
const offices = officesByRank[Number(required)];
|
||||
if (!offices) return this.formatCertificateValue(required);
|
||||
const labels = [
|
||||
...offices.political.map((name) => this.$t(`falukant.politics.offices.${name}`)),
|
||||
...offices.church.map((name) => this.$t(`falukant.church.offices.${name}`)),
|
||||
];
|
||||
return this.$t('falukant.overview.certificate.statusValue.office.minimumList', {
|
||||
offices: labels.join(', '),
|
||||
});
|
||||
},
|
||||
async fetchPotentialHeirs() {
|
||||
this.loadingHeirs = true;
|
||||
|
||||
Reference in New Issue
Block a user