mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Move translator to helpers.js
This commit is contained in:
@@ -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'],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {each, defaults} from 'lodash';
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
|
||||
const DROP_EGGS = [
|
||||
'Wolf',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {each, defaults} from 'lodash';
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
|
||||
const QUEST_EGGS = [
|
||||
'Gryphon',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from './helpers/translator';
|
||||
import {translator as t} from './helpers';
|
||||
|
||||
const NUMBER_OF_QUESTIONS = 12;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
|
||||
let saddle = {
|
||||
Saddle: {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
import events from '../events';
|
||||
|
||||
let back = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
import events from '../events';
|
||||
|
||||
let body = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
import events from '../events';
|
||||
|
||||
let eyewear = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
import events from '../events';
|
||||
|
||||
let headAccessory = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
import events from '../events';
|
||||
|
||||
let head = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
import events from '../events';
|
||||
|
||||
import weapon from './weapon';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../../helpers/translator';
|
||||
import {translator as t} from '../../helpers';
|
||||
import events from '../../events';
|
||||
|
||||
export var armor = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../../helpers/translator';
|
||||
import {translator as t} from '../../helpers';
|
||||
|
||||
export var armor = {
|
||||
0: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../../helpers/translator';
|
||||
import {translator as t} from '../../helpers';
|
||||
import events from '../../events';
|
||||
|
||||
export var armor = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../../helpers/translator';
|
||||
import {translator as t} from '../../helpers';
|
||||
import events from '../../events';
|
||||
|
||||
export var armor = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../../helpers/translator';
|
||||
import {translator as t} from '../../helpers';
|
||||
import events from '../../events';
|
||||
|
||||
export var armor = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../../helpers/translator';
|
||||
import {translator as t} from '../../helpers';
|
||||
import events from '../../events';
|
||||
|
||||
export var armor = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../../helpers/translator';
|
||||
import {translator as t} from '../../helpers';
|
||||
import events from '../../events';
|
||||
|
||||
export var armor = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../../helpers/translator';
|
||||
import {translator as t} from '../../helpers';
|
||||
import events from '../../events';
|
||||
|
||||
export var armor = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
import events from '../events';
|
||||
|
||||
let shield = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
import events from '../events';
|
||||
|
||||
let weapon = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {each, defaults} from 'lodash';
|
||||
import t from './helpers/translator';
|
||||
import {translator as t} from './helpers';
|
||||
|
||||
let hatchingPotions = {
|
||||
Base: {
|
||||
|
||||
@@ -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;
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {each, defaults, assign} from 'lodash';
|
||||
import t from '../helpers/translator';
|
||||
import {translator as t} from '../helpers';
|
||||
|
||||
let inviteFriends = {
|
||||
basilist: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from './helpers/translator';
|
||||
import {translator as t} from './helpers';
|
||||
|
||||
let stable = {
|
||||
pets: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import t from './helpers/translator';
|
||||
import {translator as t} from './helpers';
|
||||
|
||||
let habits = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user