Added two handed message to weapons (#9839)
* Added two handed message to weapons * Added two handed message to content api * Fixed static notes text. Added support for RTL
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import t from '../translation';
|
||||
|
||||
import {weapon as baseWeapon} from './sets/base';
|
||||
|
||||
import {weapon as healerWeapon} from './sets/healer';
|
||||
@@ -22,4 +24,43 @@ let weapon = {
|
||||
armoire: armoireWeapon,
|
||||
};
|
||||
|
||||
// Add Two Handed message to all weapons
|
||||
const rtlLanguages = [
|
||||
'ae', /* Avestan */
|
||||
'ar', /* 'العربية', Arabic */
|
||||
'arc', /* Aramaic */
|
||||
'bcc', /* 'بلوچی مکرانی', Southern Balochi */
|
||||
'bqi', /* 'بختياري', Bakthiari */
|
||||
'ckb', /* 'Soranî / کوردی', Sorani */
|
||||
'dv', /* Dhivehi */
|
||||
'fa', /* 'فارسی', Persian */
|
||||
'glk', /* 'گیلکی', Gilaki */
|
||||
'he', /* 'עברית', Hebrew */
|
||||
'ku', /* 'Kurdî / كوردی', Kurdish */
|
||||
'mzn', /* 'مازِرونی', Mazanderani */
|
||||
'nqo', /* N'Ko */
|
||||
'pnb', /* 'پنجابی', Western Punjabi */
|
||||
'ps', /* 'پښتو', Pashto, */
|
||||
'sd', /* 'سنڌي', Sindhi */
|
||||
'ug', /* 'Uyghurche / ئۇيغۇرچە', Uyghur */
|
||||
'ur', /* 'اردو', Urdu */
|
||||
'yi', /* 'ייִדיש', Yiddish */
|
||||
];
|
||||
for (let key in weapon) {
|
||||
const set = weapon[key];
|
||||
for (let weaponKey in set) {
|
||||
const item = set[weaponKey];
|
||||
const oldnotes = item.notes;
|
||||
item.notes = (lang) => {
|
||||
const twoHandedText = item.twoHanded ? t('twoHandedItem')(lang) : '';
|
||||
|
||||
if (rtlLanguages.indexOf(lang) !== -1) {
|
||||
return `${twoHandedText} ${oldnotes(lang)}`;
|
||||
}
|
||||
|
||||
return `${oldnotes(lang)} ${twoHandedText}`;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = weapon;
|
||||
|
||||
Reference in New Issue
Block a user