feat(content): Make mystery set strings translatable

Squashed and cleaned up version of
https://github.com/HabitRPG/habitrpg/pull/6367
This commit is contained in:
Nathan Maton
2015-12-12 20:03:17 -08:00
committed by Blade Barringer
parent e638661c71
commit 35a921bf43
4 changed files with 47 additions and 26 deletions

View File

@@ -63,6 +63,34 @@
"timeTravelersPopover": "We see you have a Mystic Hourglass, so we will happily travel back in time for you! Please choose the pet, mount, or Mystery Item Set you would like. You can see a list of the past item sets <a href='http://habitica.wikia.com/wiki/Mystery_Item' target='_blank'>here</a>! If those don't satisfy you, perhaps you'd be interested in one of our fashionably futuristic Steampunk Item Sets?", "timeTravelersPopover": "We see you have a Mystic Hourglass, so we will happily travel back in time for you! Please choose the pet, mount, or Mystery Item Set you would like. You can see a list of the past item sets <a href='http://habitica.wikia.com/wiki/Mystery_Item' target='_blank'>here</a>! If those don't satisfy you, perhaps you'd be interested in one of our fashionably futuristic Steampunk Item Sets?",
"timeTravelersAlreadyOwned": "Congratulations! You already own everything the Time Travelers currently offer. Thanks for supporting the site!", "timeTravelersAlreadyOwned": "Congratulations! You already own everything the Time Travelers currently offer. Thanks for supporting the site!",
"mysticHourglassPopover": "A Mystic Hourglass allows you to purchase certain limited-time items, such as monthly Mystery Item Sets and awards from world bosses, from the past!", "mysticHourglassPopover": "A Mystic Hourglass allows you to purchase certain limited-time items, such as monthly Mystery Item Sets and awards from world bosses, from the past!",
"mysterySet201402": "Winged Messenger Set",
"mysterySet201403": "Forest Walker Set",
"mysterySet201404": "Twilight Butterfly Set",
"mysterySet201405": "Flame Wielder Set",
"mysterySet201406": "Octomage Set",
"mysterySet201407": "Undersea Explorer Set",
"mysterySet201408": "Sun Sorcerer Set",
"mysterySet201409": "Autumn Strider Set",
"mysterySet201410": "Winged Goblin Set",
"mysterySet201411": "Feast and Fun Set",
"mysterySet201412": "Penguin Set",
"mysterySet201501": "Starry Knight Set",
"mysterySet201502": "Winged Enchanter Set",
"mysterySet201503": "Aquamarine Set",
"mysterySet201504": "Busy Bee Set",
"mysterySet201505": "Green Knight Set",
"mysterySet201506": "Neon Snorkeler Set",
"mysterySet201507": "Rad Surfer Set",
"mysterySet201508": "Cheetah Costume Set",
"mysterySet201509": "Werewolf Set",
"mysterySet201510": "Horned Goblin Set",
"mysterySet201511": "Wood Warrior Set",
"mysterySet301404": "Steampunk Standard Set",
"mysterySet301405": "Steampunk Accessories Set",
"mysterySetwondercon": "Wondercon",
"subUpdateCard": "Update Card", "subUpdateCard": "Update Card",
"subUpdateTitle": "Update", "subUpdateTitle": "Update",
"subUpdateDescription": "Update the card to be charged.", "subUpdateDescription": "Update the card to be charged.",

View File

@@ -1,126 +1,104 @@
import { each } from 'lodash'; import { each } from 'lodash';
let t = require('./translation.js');
let mysterySets = { let mysterySets = {
201402: { 201402: {
start: '2014-02-22', start: '2014-02-22',
end: '2014-02-28', end: '2014-02-28',
text: 'Winged Messenger Set',
}, },
201403: { 201403: {
start: '2014-03-24', start: '2014-03-24',
end: '2014-04-02', end: '2014-04-02',
text: 'Forest Walker Set',
}, },
201404: { 201404: {
start: '2014-04-24', start: '2014-04-24',
end: '2014-05-02', end: '2014-05-02',
text: 'Twilight Butterfly Set',
}, },
201405: { 201405: {
start: '2014-05-21', start: '2014-05-21',
end: '2014-06-02', end: '2014-06-02',
text: 'Flame Wielder Set',
}, },
201406: { 201406: {
start: '2014-06-23', start: '2014-06-23',
end: '2014-07-02', end: '2014-07-02',
text: 'Octomage Set',
}, },
201407: { 201407: {
start: '2014-07-23', start: '2014-07-23',
end: '2014-08-02', end: '2014-08-02',
text: 'Undersea Explorer Set',
}, },
201408: { 201408: {
start: '2014-08-23', start: '2014-08-23',
end: '2014-09-02', end: '2014-09-02',
text: 'Sun Sorcerer Set',
}, },
201409: { 201409: {
start: '2014-09-24', start: '2014-09-24',
end: '2014-10-02', end: '2014-10-02',
text: 'Autumn Strider Set',
}, },
201410: { 201410: {
start: '2014-10-24', start: '2014-10-24',
end: '2014-11-02', end: '2014-11-02',
text: 'Winged Goblin Set',
}, },
201411: { 201411: {
start: '2014-11-24', start: '2014-11-24',
end: '2014-12-02', end: '2014-12-02',
text: 'Feast and Fun Set',
}, },
201412: { 201412: {
start: '2014-12-25', start: '2014-12-25',
end: '2015-01-02', end: '2015-01-02',
text: 'Penguin Set',
}, },
201501: { 201501: {
start: '2015-01-26', start: '2015-01-26',
end: '2015-02-02', end: '2015-02-02',
text: 'Starry Knight Set',
}, },
201502: { 201502: {
start: '2015-02-24', start: '2015-02-24',
end: '2015-03-02', end: '2015-03-02',
text: 'Winged Enchanter Set',
}, },
201503: { 201503: {
start: '2015-03-25', start: '2015-03-25',
end: '2015-04-02', end: '2015-04-02',
text: 'Aquamarine Set',
}, },
201504: { 201504: {
start: '2015-04-24', start: '2015-04-24',
end: '2015-05-02', end: '2015-05-02',
text: 'Busy Bee Set',
}, },
201505: { 201505: {
start: '2015-05-25', start: '2015-05-25',
end: '2015-06-02', end: '2015-06-02',
text: 'Green Knight Set',
}, },
201506: { 201506: {
start: '2015-06-25', start: '2015-06-25',
end: '2015-07-02', end: '2015-07-02',
text: 'Neon Snorkeler Set',
}, },
201507: { 201507: {
start: '2015-07-24', start: '2015-07-24',
end: '2015-08-02', end: '2015-08-02',
text: 'Rad Surfer Set',
}, },
201508: { 201508: {
start: '2015-08-23', start: '2015-08-23',
end: '2015-09-02', end: '2015-09-02',
text: 'Cheetah Costume Set',
}, },
201509: { 201509: {
start: '2015-09-24', start: '2015-09-24',
end: '2015-10-02', end: '2015-10-02',
text: 'Werewolf Set',
}, },
201510: { 201510: {
start: '2015-10-26', start: '2015-10-26',
end: '2015-11-02', end: '2015-11-02',
text: 'Horned Goblin Set',
}, },
201511: { 201511: {
start: '2015-11-25', start: '2015-11-25',
end: '2015-12-02', end: '2015-12-02',
text: 'Wood Warrior Set',
}, },
301404: { 301404: {
start: '3014-03-24', start: '3014-03-24',
end: '3014-04-02', end: '3014-04-02',
text: 'Steampunk Standard Set',
}, },
301405: { 301405: {
start: '3014-04-24', start: '3014-04-24',
end: '3014-05-02', end: '3014-05-02',
text: 'Steampunk Accessories Set',
}, },
// @TODO: Remove wondercon from mystery-sets
wondercon: { wondercon: {
start: '2014-03-24', start: '2014-03-24',
end: '2014-04-01', end: '2014-04-01',
@@ -129,6 +107,7 @@ let mysterySets = {
each(mysterySets, (value, key) => { each(mysterySets, (value, key) => {
value.key = key; value.key = key;
value.text = t(`mysterySet${key}`);
}); });
export default mysterySets; export default mysterySets;

View File

@@ -0,0 +1,14 @@
import {each} from 'lodash';
import {
expectValidTranslationString
} from '../helpers/content.helper';
import mysterySets from '../../common/script/content/mystery-sets';
describe('Mystery Sets', () => {
it('has a valid text string', () => {
each(mysterySets, (set, key) => {
expectValidTranslationString(set.text);
});
});
});

View File

@@ -25,11 +25,11 @@
div(ng-repeat='(item, text) in Content.timeTravelStable["#{type}"]', style='margin-top:0') div(ng-repeat='(item, text) in Content.timeTravelStable["#{type}"]', style='margin-top:0')
button.pet-button(class='#{prepend}{{::item}}', style='margin-top:0', button.pet-button(class='#{prepend}{{::item}}', style='margin-top:0',
ng-if='!user.items["#{type}"][item]', ng-if='!user.items["#{type}"][item]',
popover='{{::text()}}', popover-trigger='mouseenter', popover='{{::text()}}', popover-trigger='mouseenter',
popover-placement='right', popover-append-to-body='true', popover-placement='right', popover-append-to-body='true',
ng-click='clickTimeTravelItem("#{type}",item)') ng-click='clickTimeTravelItem("#{type}",item)')
li.customize-menu.inventory-gear li.customize-menu.inventory-gear
menu.pets-menu(label='{{::set.text}}', ng-repeat='set in Content.timeTravelerStore(user.items.gear.owned)') menu.pets-menu(label='{{::set.text()}}', ng-repeat='set in Content.timeTravelerStore(user.items.gear.owned)')
div(ng-repeat='item in set.items') div(ng-repeat='item in set.items')
button.customize-option(class='shop_{{::item.key}}', button.customize-option(class='shop_{{::item.key}}',
popover='{{::item.notes()}}', popover-title='{{::item.text()}}', popover='{{::item.notes()}}', popover-title='{{::item.text()}}',