feat(MoneyHistoryView): enhance activity translation for tax and reputation actions
All checks were successful
Deploy to production / deploy (push) Successful in 2m7s
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:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user