allow customised text and translations for notifications for gaining/losing gold/xp/mana/health (#9049)
This commit is contained in:
@@ -141,12 +141,13 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
message () {
|
||||
let direction = this.negative === 'negative' ? 'lost' : 'gained';
|
||||
|
||||
if (this.notification.type === 'hp') return `You ${direction} some ${this.$t('health')}`;
|
||||
if (this.notification.type === 'mp') return `You ${direction} some ${this.$t('mana')}`;
|
||||
if (this.notification.type === 'xp') return `You ${direction} some exp`;
|
||||
if (this.notification.type === 'gp') return `You ${direction} some ${this.$t('gold')}`;
|
||||
let localeKey = this.negative === 'negative' ? 'lost' : 'gained';
|
||||
if (this.notification.type === 'hp') localeKey += 'Health';
|
||||
if (this.notification.type === 'mp') localeKey += 'Mana';
|
||||
if (this.notification.type === 'xp') localeKey += 'Experience';
|
||||
if (this.notification.type === 'gp') localeKey += 'Gold';
|
||||
return this.$t(localeKey);
|
||||
// This requires eight translatable strings, but that gives the translators the most flexibility for matching gender/number and for using idioms for lost/spent/used/gained.
|
||||
},
|
||||
negative () {
|
||||
return this.notification.sign === '-' ? 'negative' : 'positive';
|
||||
|
||||
@@ -166,6 +166,14 @@
|
||||
"youCastTarget": "You cast <%= spell %> on <%= target %>.",
|
||||
"youCastParty": "You cast <%= spell %> for the party.",
|
||||
"critBonus": "Critical Hit! Bonus: ",
|
||||
"gainedGold": "You gained some Gold",
|
||||
"gainedMana": "You gained some Mana",
|
||||
"gainedHealth": "You gained some Health",
|
||||
"gainedExperience": "You gained some Experience",
|
||||
"lostGold": "You spent some Gold",
|
||||
"lostMana": "You used some Mana",
|
||||
"lostHealth": "You lost some Health",
|
||||
"lostExperience": "You lost some Experience",
|
||||
"displayNameDescription1": "This is what appears in messages you post in the Tavern, guilds, and party chat, along with what is displayed on your avatar. To change it, click the Edit button above. If instead you want to change your login name, go to",
|
||||
"displayNameDescription2": "Settings->Site",
|
||||
"displayNameDescription3": "and look in the Registration section.",
|
||||
|
||||
Reference in New Issue
Block a user