feat(MoneyHistoryView): enhance activity translation for tax and reputation actions
All checks were successful
Deploy to production / deploy (push) Successful in 2m7s

- Added translation logic for activities related to tax from sales branches and reputation actions in the MoneyHistoryView component.
- Updated internationalization files to include new strings for these activities in multiple languages.
This commit is contained in:
Torsten Schulz (local)
2026-04-30 15:41:00 +02:00
parent c6ffdd10f7
commit 3365f1dd2a
16 changed files with 126 additions and 22 deletions

View File

@@ -95,6 +95,31 @@ export default {
}
},
translateActivity(activity) {
if (typeof activity === 'string') {
const taxMatch = activity.match(/^tax from sales branch\s+(\d+)$/i);
if (taxMatch) {
return this.$t('falukant.moneyHistory.activities.taxFromSalesBranch', {
branchId: taxMatch[1],
});
}
const reputationMatch = activity.match(/^reputation action:\s*(.+)$/i);
if (reputationMatch) {
const actionKey = String(reputationMatch[1] || '').trim();
let actionLabel = actionKey;
if (actionKey) {
const reputationKey = `falukant.reputation.actions.type.${actionKey}`;
const reputationTranslation = this.$t(reputationKey);
if (reputationTranslation !== reputationKey) {
actionLabel = reputationTranslation;
}
}
return this.$t('falukant.moneyHistory.activities.reputationAction', {
action: actionLabel,
});
}
}
const candidates = [activity];
if (typeof activity === 'string') {