From ad7e01d87e885b2a159bbb3015bb548254a36076 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Mon, 21 Sep 2015 17:35:27 -0500 Subject: [PATCH] Move translator to helpers.js --- common/script/content/index.coffee | 2 +- common/script/src/content/backgrounds.js | 2 +- common/script/src/content/eggs/drops.js | 2 +- common/script/src/content/eggs/quest.js | 2 +- common/script/src/content/faq.js | 2 +- common/script/src/content/food/base.js | 2 +- common/script/src/content/food/birthday.js | 2 +- common/script/src/content/food/fall.js | 2 +- common/script/src/content/food/index.js | 2 +- common/script/src/content/food/saddle.js | 2 +- common/script/src/content/gear/armor.js | 2 +- common/script/src/content/gear/back.js | 2 +- common/script/src/content/gear/body.js | 2 +- common/script/src/content/gear/eyewear.js | 2 +- common/script/src/content/gear/head-accessory.js | 2 +- common/script/src/content/gear/head.js | 2 +- common/script/src/content/gear/index.js | 2 +- common/script/src/content/gear/sets/armoire.js | 2 +- common/script/src/content/gear/sets/base.js | 2 +- common/script/src/content/gear/sets/healer.js | 2 +- common/script/src/content/gear/sets/mystery.js | 2 +- common/script/src/content/gear/sets/rogue.js | 2 +- common/script/src/content/gear/sets/special.js | 2 +- common/script/src/content/gear/sets/warrior.js | 2 +- common/script/src/content/gear/sets/wizard.js | 2 +- common/script/src/content/gear/shield.js | 2 +- common/script/src/content/gear/weapon.js | 2 +- common/script/src/content/hatching-potions.js | 2 +- .../script/src/content/{helpers/translator.js => helpers.js} | 5 ++--- common/script/src/content/quests/gold-purchasable.js | 2 +- common/script/src/content/quests/holiday.js | 2 +- common/script/src/content/quests/index.js | 2 +- common/script/src/content/quests/pet.js | 2 +- common/script/src/content/quests/unlockable.js | 2 +- common/script/src/content/quests/world.js | 2 +- common/script/src/content/spells/healer.js | 2 +- common/script/src/content/spells/index.js | 2 +- common/script/src/content/spells/rogue.js | 2 +- common/script/src/content/spells/special.js | 2 +- common/script/src/content/spells/spell-helper.js | 2 +- common/script/src/content/spells/warrior.js | 2 +- common/script/src/content/spells/wizard.js | 2 +- common/script/src/content/time-traveler-stable.js | 2 +- common/script/src/content/user-defaults.js | 2 +- 44 files changed, 45 insertions(+), 46 deletions(-) rename common/script/src/content/{helpers/translator.js => helpers.js} (72%) diff --git a/common/script/content/index.coffee b/common/script/content/index.coffee index d93babf71c..7cd5797d72 100644 --- a/common/script/content/index.coffee +++ b/common/script/content/index.coffee @@ -3,7 +3,7 @@ api = module.exports _ = require 'lodash' moment = require 'moment' -t = require('../../dist/scripts/content/helpers/translator') +t = require('../../dist/scripts/content/helpers').translator ### --------------------------------------------------------------- diff --git a/common/script/src/content/backgrounds.js b/common/script/src/content/backgrounds.js index f54d1c63eb..b7b32b7ab2 100644 --- a/common/script/src/content/backgrounds.js +++ b/common/script/src/content/backgrounds.js @@ -1,7 +1,7 @@ import {each} from 'lodash'; import camelCase from 'lodash.camelcase'; import capitalize from 'lodash.capitalize'; -import t from './helpers/translator'; +import {translator as t} from './helpers'; let sets = { '062014': ['beach', 'fairy_ring', 'forest'], diff --git a/common/script/src/content/eggs/drops.js b/common/script/src/content/eggs/drops.js index 8e3ead1f9b..fa0f5a8f0a 100644 --- a/common/script/src/content/eggs/drops.js +++ b/common/script/src/content/eggs/drops.js @@ -1,5 +1,5 @@ import {each, defaults} from 'lodash'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; const DROP_EGGS = [ 'Wolf', diff --git a/common/script/src/content/eggs/quest.js b/common/script/src/content/eggs/quest.js index 28c9ec0af1..60c01414ec 100644 --- a/common/script/src/content/eggs/quest.js +++ b/common/script/src/content/eggs/quest.js @@ -1,5 +1,5 @@ import {each, defaults} from 'lodash'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; const QUEST_EGGS = [ 'Gryphon', diff --git a/common/script/src/content/faq.js b/common/script/src/content/faq.js index 08175a9d0e..3be4054c45 100644 --- a/common/script/src/content/faq.js +++ b/common/script/src/content/faq.js @@ -1,4 +1,4 @@ -import t from './helpers/translator'; +import {translator as t} from './helpers'; const NUMBER_OF_QUESTIONS = 12; diff --git a/common/script/src/content/food/base.js b/common/script/src/content/food/base.js index a8b1d89fd8..0d523d296d 100644 --- a/common/script/src/content/food/base.js +++ b/common/script/src/content/food/base.js @@ -1,5 +1,5 @@ import {each, defaults} from 'lodash'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; const CAN_BUY = true; const CAN_DROP = true; diff --git a/common/script/src/content/food/birthday.js b/common/script/src/content/food/birthday.js index 6b025f8d43..816fc89598 100644 --- a/common/script/src/content/food/birthday.js +++ b/common/script/src/content/food/birthday.js @@ -1,7 +1,7 @@ import {each, defaults} from 'lodash'; import capitalize from 'lodash.capitalize'; import camelCase from 'lodash.camelcase'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; const CAN_BUY = false; const CAN_DROP = false; diff --git a/common/script/src/content/food/fall.js b/common/script/src/content/food/fall.js index 5281e0634e..d90e47f99b 100644 --- a/common/script/src/content/food/fall.js +++ b/common/script/src/content/food/fall.js @@ -1,7 +1,7 @@ import {each, defaults} from 'lodash'; import capitalize from 'lodash.capitalize'; import camelCase from 'lodash.camelcase'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; const CAN_BUY = false; const CAN_DROP = false; diff --git a/common/script/src/content/food/index.js b/common/script/src/content/food/index.js index e80d064761..09485d3124 100644 --- a/common/script/src/content/food/index.js +++ b/common/script/src/content/food/index.js @@ -1,5 +1,5 @@ import {each, defaults, assign} from 'lodash'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import baseFood from './base'; import saddle from './saddle'; diff --git a/common/script/src/content/food/saddle.js b/common/script/src/content/food/saddle.js index 2354a95236..261425150d 100644 --- a/common/script/src/content/food/saddle.js +++ b/common/script/src/content/food/saddle.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; let saddle = { Saddle: { diff --git a/common/script/src/content/gear/armor.js b/common/script/src/content/gear/armor.js index b388383b50..cf86dae1e7 100644 --- a/common/script/src/content/gear/armor.js +++ b/common/script/src/content/gear/armor.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import events from '../events'; import {armor as baseArmor} from './sets/base'; diff --git a/common/script/src/content/gear/back.js b/common/script/src/content/gear/back.js index a4576f193d..b8f5a47047 100644 --- a/common/script/src/content/gear/back.js +++ b/common/script/src/content/gear/back.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import events from '../events'; let back = { diff --git a/common/script/src/content/gear/body.js b/common/script/src/content/gear/body.js index 1d64cf4632..3b921b7192 100644 --- a/common/script/src/content/gear/body.js +++ b/common/script/src/content/gear/body.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import events from '../events'; let body = { diff --git a/common/script/src/content/gear/eyewear.js b/common/script/src/content/gear/eyewear.js index 2d4bdfd250..a0f9ccc405 100644 --- a/common/script/src/content/gear/eyewear.js +++ b/common/script/src/content/gear/eyewear.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import events from '../events'; let eyewear = { diff --git a/common/script/src/content/gear/head-accessory.js b/common/script/src/content/gear/head-accessory.js index fcd9e97090..0243066180 100644 --- a/common/script/src/content/gear/head-accessory.js +++ b/common/script/src/content/gear/head-accessory.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import events from '../events'; let headAccessory = { diff --git a/common/script/src/content/gear/head.js b/common/script/src/content/gear/head.js index a80ff06ffb..d8cb6ef301 100644 --- a/common/script/src/content/gear/head.js +++ b/common/script/src/content/gear/head.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import events from '../events'; let head = { diff --git a/common/script/src/content/gear/index.js b/common/script/src/content/gear/index.js index 964805b40c..697edc8681 100644 --- a/common/script/src/content/gear/index.js +++ b/common/script/src/content/gear/index.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import events from '../events'; import weapon from './weapon'; diff --git a/common/script/src/content/gear/sets/armoire.js b/common/script/src/content/gear/sets/armoire.js index c145746ee9..064a62c8fb 100644 --- a/common/script/src/content/gear/sets/armoire.js +++ b/common/script/src/content/gear/sets/armoire.js @@ -1,4 +1,4 @@ -import t from '../../helpers/translator'; +import {translator as t} from '../../helpers'; import events from '../../events'; export var armor = { diff --git a/common/script/src/content/gear/sets/base.js b/common/script/src/content/gear/sets/base.js index ab56ae2343..110ac64a2d 100644 --- a/common/script/src/content/gear/sets/base.js +++ b/common/script/src/content/gear/sets/base.js @@ -1,4 +1,4 @@ -import t from '../../helpers/translator'; +import {translator as t} from '../../helpers'; export var armor = { 0: { diff --git a/common/script/src/content/gear/sets/healer.js b/common/script/src/content/gear/sets/healer.js index e63c4e3e97..48ee229c6a 100644 --- a/common/script/src/content/gear/sets/healer.js +++ b/common/script/src/content/gear/sets/healer.js @@ -1,4 +1,4 @@ -import t from '../../helpers/translator'; +import {translator as t} from '../../helpers'; import events from '../../events'; export var armor = { diff --git a/common/script/src/content/gear/sets/mystery.js b/common/script/src/content/gear/sets/mystery.js index 7146958954..bf327fa9c7 100644 --- a/common/script/src/content/gear/sets/mystery.js +++ b/common/script/src/content/gear/sets/mystery.js @@ -1,4 +1,4 @@ -import t from '../../helpers/translator'; +import {translator as t} from '../../helpers'; import events from '../../events'; export var armor = { diff --git a/common/script/src/content/gear/sets/rogue.js b/common/script/src/content/gear/sets/rogue.js index bd2b840fd1..0959526945 100644 --- a/common/script/src/content/gear/sets/rogue.js +++ b/common/script/src/content/gear/sets/rogue.js @@ -1,4 +1,4 @@ -import t from '../../helpers/translator'; +import {translator as t} from '../../helpers'; import events from '../../events'; export var armor = { diff --git a/common/script/src/content/gear/sets/special.js b/common/script/src/content/gear/sets/special.js index d775b4473c..7ae9b1932c 100644 --- a/common/script/src/content/gear/sets/special.js +++ b/common/script/src/content/gear/sets/special.js @@ -1,4 +1,4 @@ -import t from '../../helpers/translator'; +import {translator as t} from '../../helpers'; import events from '../../events'; export var armor = { diff --git a/common/script/src/content/gear/sets/warrior.js b/common/script/src/content/gear/sets/warrior.js index a5ee62616c..7ce3a65a08 100644 --- a/common/script/src/content/gear/sets/warrior.js +++ b/common/script/src/content/gear/sets/warrior.js @@ -1,4 +1,4 @@ -import t from '../../helpers/translator'; +import {translator as t} from '../../helpers'; import events from '../../events'; export var armor = { diff --git a/common/script/src/content/gear/sets/wizard.js b/common/script/src/content/gear/sets/wizard.js index c3e974547d..483b23230a 100644 --- a/common/script/src/content/gear/sets/wizard.js +++ b/common/script/src/content/gear/sets/wizard.js @@ -1,4 +1,4 @@ -import t from '../../helpers/translator'; +import {translator as t} from '../../helpers'; import events from '../../events'; export var armor = { diff --git a/common/script/src/content/gear/shield.js b/common/script/src/content/gear/shield.js index 6b96cfe45a..51fc546937 100644 --- a/common/script/src/content/gear/shield.js +++ b/common/script/src/content/gear/shield.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import events from '../events'; let shield = { diff --git a/common/script/src/content/gear/weapon.js b/common/script/src/content/gear/weapon.js index ec0f0ed96a..571b0d3e1d 100644 --- a/common/script/src/content/gear/weapon.js +++ b/common/script/src/content/gear/weapon.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import events from '../events'; let weapon = { diff --git a/common/script/src/content/hatching-potions.js b/common/script/src/content/hatching-potions.js index 83c346aa52..bbdab5e872 100644 --- a/common/script/src/content/hatching-potions.js +++ b/common/script/src/content/hatching-potions.js @@ -1,5 +1,5 @@ import {each, defaults} from 'lodash'; -import t from './helpers/translator'; +import {translator as t} from './helpers'; let hatchingPotions = { Base: { diff --git a/common/script/src/content/helpers/translator.js b/common/script/src/content/helpers.js similarity index 72% rename from common/script/src/content/helpers/translator.js rename to common/script/src/content/helpers.js index 48da48d63d..945d5abc5b 100644 --- a/common/script/src/content/helpers/translator.js +++ b/common/script/src/content/helpers.js @@ -1,7 +1,7 @@ require('coffee-script'); -import i18n from '../../../../script/i18n.coffee'; +import i18n from '../../../script/i18n.coffee'; -var t = function(string, vars) { +export function translator(string, vars) { var func = function(lang) { if (vars == null) { vars = { @@ -16,4 +16,3 @@ var t = function(string, vars) { return func; }; -export default t; diff --git a/common/script/src/content/quests/gold-purchasable.js b/common/script/src/content/quests/gold-purchasable.js index 7a38491675..54c4ace86f 100644 --- a/common/script/src/content/quests/gold-purchasable.js +++ b/common/script/src/content/quests/gold-purchasable.js @@ -1,7 +1,7 @@ import {each, defaults, assign} from 'lodash'; import capitalize from 'lodash.capitalize'; import camelCase from 'lodash.camelcase'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; let dilatoryDistressSeries = { dilatoryDistress1: { diff --git a/common/script/src/content/quests/holiday.js b/common/script/src/content/quests/holiday.js index 364bed8d52..ecfacccba1 100644 --- a/common/script/src/content/quests/holiday.js +++ b/common/script/src/content/quests/holiday.js @@ -1,6 +1,6 @@ import {each, defaults} from 'lodash'; import capitalize from 'lodash.capitalize'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; let holidayQuests = { evilsanta: { diff --git a/common/script/src/content/quests/index.js b/common/script/src/content/quests/index.js index 63c523f65f..162d631418 100644 --- a/common/script/src/content/quests/index.js +++ b/common/script/src/content/quests/index.js @@ -1,7 +1,7 @@ import {each, assign, defaults, sortBy} from 'lodash'; import capitalize from 'lodash.capitalize'; import camelCase from 'lodash.camelcase'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import worldQuests from './world'; import holidayQuests from './holiday'; diff --git a/common/script/src/content/quests/pet.js b/common/script/src/content/quests/pet.js index 335329fdad..b038571987 100644 --- a/common/script/src/content/quests/pet.js +++ b/common/script/src/content/quests/pet.js @@ -1,7 +1,7 @@ import {each, defaults} from 'lodash'; import capitalize from 'lodash.capitalize'; import camelCase from 'lodash.camelcase'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; let petQuests = { gryphon: { diff --git a/common/script/src/content/quests/unlockable.js b/common/script/src/content/quests/unlockable.js index 2017df13b7..b11e71b5c6 100644 --- a/common/script/src/content/quests/unlockable.js +++ b/common/script/src/content/quests/unlockable.js @@ -1,5 +1,5 @@ import {each, defaults, assign} from 'lodash'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; let inviteFriends = { basilist: { diff --git a/common/script/src/content/quests/world.js b/common/script/src/content/quests/world.js index 99a3d3fed2..075c6a3bc5 100644 --- a/common/script/src/content/quests/world.js +++ b/common/script/src/content/quests/world.js @@ -1,6 +1,6 @@ import {each, defaults} from 'lodash'; import capitalize from 'lodash.capitalize'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; let worldQuests = { dilatory: { diff --git a/common/script/src/content/spells/healer.js b/common/script/src/content/spells/healer.js index 89278d4424..7f6449dc11 100644 --- a/common/script/src/content/spells/healer.js +++ b/common/script/src/content/spells/healer.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import {diminishingReturns, calculateBonus, setSpellDefaults} from './spell-helper'; import {each} from 'lodash'; diff --git a/common/script/src/content/spells/index.js b/common/script/src/content/spells/index.js index 5a0dc9f35e..163cd59f2d 100644 --- a/common/script/src/content/spells/index.js +++ b/common/script/src/content/spells/index.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import {diminishingReturns, calculateBonus} from './spell-helper'; import wizard from './wizard'; diff --git a/common/script/src/content/spells/rogue.js b/common/script/src/content/spells/rogue.js index 045c7fc17f..cd7b966258 100644 --- a/common/script/src/content/spells/rogue.js +++ b/common/script/src/content/spells/rogue.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import {diminishingReturns, calculateBonus, setSpellDefaults} from './spell-helper'; import {each} from 'lodash'; diff --git a/common/script/src/content/spells/special.js b/common/script/src/content/spells/special.js index 1e933bff0a..c1e21af12f 100644 --- a/common/script/src/content/spells/special.js +++ b/common/script/src/content/spells/special.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import {diminishingReturns, calculateBonus, setSpellDefaults} from './spell-helper'; import {each} from 'lodash'; diff --git a/common/script/src/content/spells/spell-helper.js b/common/script/src/content/spells/spell-helper.js index 7e43d6d27d..2ae7d640fc 100644 --- a/common/script/src/content/spells/spell-helper.js +++ b/common/script/src/content/spells/spell-helper.js @@ -1,6 +1,6 @@ import {each, defaults} from 'lodash'; import capitalize from 'lodash.capitalize'; -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; export function diminishingReturns(bonus, max, halfway=max/2) { return max * (bonus / (bonus + halfway)); diff --git a/common/script/src/content/spells/warrior.js b/common/script/src/content/spells/warrior.js index 1ae904d922..9a83f5e042 100644 --- a/common/script/src/content/spells/warrior.js +++ b/common/script/src/content/spells/warrior.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import {diminishingReturns, calculateBonus, setSpellDefaults} from './spell-helper'; import {each} from 'lodash'; diff --git a/common/script/src/content/spells/wizard.js b/common/script/src/content/spells/wizard.js index 0e13a0972e..10e13828ab 100644 --- a/common/script/src/content/spells/wizard.js +++ b/common/script/src/content/spells/wizard.js @@ -1,4 +1,4 @@ -import t from '../helpers/translator'; +import {translator as t} from '../helpers'; import {diminishingReturns, calculateBonus, setSpellDefaults} from './spell-helper'; import {each} from 'lodash'; diff --git a/common/script/src/content/time-traveler-stable.js b/common/script/src/content/time-traveler-stable.js index 2aaeb1bce4..7f3178effa 100644 --- a/common/script/src/content/time-traveler-stable.js +++ b/common/script/src/content/time-traveler-stable.js @@ -1,4 +1,4 @@ -import t from './helpers/translator'; +import {translator as t} from './helpers'; let stable = { pets: { diff --git a/common/script/src/content/user-defaults.js b/common/script/src/content/user-defaults.js index 84c1a88756..b09bad06b9 100644 --- a/common/script/src/content/user-defaults.js +++ b/common/script/src/content/user-defaults.js @@ -1,4 +1,4 @@ -import t from './helpers/translator'; +import {translator as t} from './helpers'; let habits = [ {