Localization.js

Revision as of 11:16, 2 April 2017 by BrianFreud (talk | contribs) (Created page with "→‎Localization: stratics.f.util.l = (str, lang = stratics.i18n.current) => { let x = stratics.i18n[lang][str.toLowerCase()]; if (x === '?') { x = stratics.i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Localization */
stratics.f.util.l = (str, lang = stratics.i18n.current) => {
    let x = stratics.i18n[lang][str.toLowerCase()];
    if (x === '?') {
        x = stratics.i18n[stratics.i18n.default][str.toLowerCase()];
    }
    return x;
};

stratics.f.util.getLangList = () => {  // Returns a 2D array of [code, name] pairs.
    let list = [];
    for (let x of stratics.i18n.langs) {
        list.push([stratics.i18n[x], stratics.i18n[x]["{language name}"]]);
        list.sort(function (a,b) {
            return a[1].localeCompare(b[1]);
        });
    }
    return list;
};

stratics.f.util.getAllLangs = (str) => {  // Returns an array of all translations for a string
    let list = [];
    for (let x of stratics.i18n.langs) {
        list.push(stratics.i18n[x][str]);
    }
    return list;
};

stratics.f.util.setLang = lang => {
    stratics.i18n.current = lang;
};

stratics.f.util.getLang = lang => stratics.i18n.current;

stratics.i18n = {};
stratics.i18n.langs = [];

stratics.i18n.default = 'en';
stratics.i18n.current = stratics.i18n.default;

stratics.i18n.langs.push('en');
stratics.i18n.en = {
"add an animal lore reading": "Add an Animal Lore reading",
"anatomy": "Anatomy",
"an error has occurred submitting the data. please try again.": "An error has occurred submitting the data. Please try again.",
"arachnid": "Arachnid",
"attributes": "Attributes",
"barding difficulty": "Barding Difficulty",
"base damage": "Base Damage",
"bear": "Bear",
"blackrock stew": "Blackrock Stew",
"bull": "Bull",
"bushido": "Bushido",
"canine": "Canine",
"chivalry": "Chivalry",
"cold damage": "Cold Damage",
"cold resistance": "Cold Resistance",
"combat ratings": "Combat Ratings",
"crops": "Crops",
"daemon": "Daemon",
"damage": "Damage",
"detecting hidden": "Detecting Hidden",
"dexterity": "Dexterity",
"discordance": "Discordance",
"eggs": "Eggs",
"energy damage": "Energy Damage",
"energy resistance": "Energy Resistance",
"equine": "Equine",
"evaluating intelligence": "Evaluating Intelligence",
"feline": "Feline",
"fire damage": "Fire Damage",
"fire resistance": "Fire Resistance",
"fish": "Fish",
"focus": "Focus",
"fruit & vegetables": "Fruit & Vegetables",
"gold": "Gold",
"grain": "Grain",
"hay": "Hay",
"healing": "Healing",
"hiding": "Hiding",
"hit point regeneration": "Hit Point Regeneration",
"hp": "HP",
"hold ctrl to select multiple items.": "Hold CTRL to select multiple items.",
"intelligence": "Intelligence",
"leather": "Leather",
"lore & knowledge": "Lore & Knowledge",
"magery": "Magery",
"mana": "Mana",
"mana regeneration": "Mana Regeneration",
"meat": "Meat",
"meditation": "Meditation",
"metal": "Metal",
"mysticism": "Mysticism",
"necromancy": "Necromancy",
"ninjitsu": "Ninjitsu",
"ostard": "Ostard",
"pack instincts": "Pack Instincts",
"parrying": "Parrying",
"pet slots": "Pet Slots",
"physical damage": "Physical Damage",
"physical resistance": "Physical Resistance",
"poison damage": "Poison Damage",
"poisoning": "Poisoning",
"poison resistance": "Poison Resistance",
"preferred foods": "Preferred Foods",
"resistances": "Resistances",
"resisting spells": "Resisting Spells",
"saved. reloading the page...": "Saved. Reloading the page...",
"spellweaving": "Spellweaving",
"spirit speak": "Spirit Speak",
"stamina": "Stamina",
"stamina regeneration": "Stamina Regeneration",
"strength": "Strength",
"tactics": "Tactics",
"thanks! saving...": "Thanks! Saving...",
"wrestling": "Wrestling",
"{language name}": "{language name}",
"import log files": "Import log files",
"programming": "Programming",
"translation": "Translation",
"see this page for more information.": "See this page for more information.",
"drag and drop log files here to import their data.": "Drag and drop log files here to import their data.",
"please only drop log files for this type of mob.": "Please only drop log files for this type of mob.",
"the files were successfully imported.": "The files were successfully imported.",
"importing, please wait...": "Importing, please wait...",
"import files": "Import files",
"cancel": "Cancel",
"submit": "Submit",
"credits": "Credits",
};
stratics.i18n.langs.push('fr');
stratics.i18n.fr = {
"add an animal lore reading": "?",
"anatomy": "Anatomie",
"an error has occurred submitting the data. please try again.": "?",
"arachnid": "araignée",
"attributes": "caractéristiques",
"barding difficulty": "?",
"base damage": "dégâts de base",
"bear": "ours",
"blackrock stew": "?",
"bull": "taureau",
"bushido": "bushido",
"canine": "chien",
"chivalry": "chevalerie",
"cold damage": "Dégâts froids",
"cold resistance": "résistance au froid",
"combat ratings": "Aptitudes de combat",
"crops": "culture/plantes",
"daemon": "démon",
"damage": "Dégâts",
"detecting hidden": "détection caché",
"dexterity": "dextérité",
"discordance": "discordance",
"eggs": "oeufs",
"energy damage": "dégâts d'énergie",
"energy resistance": "résistance d'énergie",
"equine": "?",
"evaluating intelligence": "Evaluation cérébrale",
"feline": "?",
"fire damage": "dégâts de feu",
"fire resistance": "résistance au feu",
"fish": "poisson",
"focus": "se concentrer",
"fruit & vegetables": "fruit et légumes",
"gold": "or",
"grain": "céréales",
"hay": "foin",
"healing": "Guérison",
"hiding": "Cachette",
"hit point regeneration": "Régénération des points d'impact",
"hp": "points d'impact",
"hold ctrl to select multiple items.": "Tenez la touche CTRL pour sélectionner plusieurs éléments.",
"intelligence": "Intelligence",
"leather": "cuir",
"lore & knowledge": "Savoir & Connaissance",
"magery": "Magie",
"mana": "Mana",
"mana regeneration": "Régénération Mana",
"meat": "viande",
"meditation": "méditation",
"metal": "métal",
"mysticism": "Mysticisme",
"necromancy": "Nécromancie",
"ninjitsu": "Ninjitsu",
"ostard": "Ostard",
"pack instincts": "Instinct troupeau",
"parrying": "Parer",
"pet slots": "?",
"physical damage": "?",
"physical resistance": "?",
"poison damage": "?",
"poisoning": "Empoisonnement",
"poison resistance": "?",
"preferred foods": "?",
"resistances": "?",
"resisting spells": "?",
"saved. reloading the page...": "?",
"spellweaving": "?",
"spirit speak": "Spiritisme",
"stamina": "Endurance",
"stamina regeneration": "Régénération de l'endurance",
"strength": "Force",
"tactics": "Tactique",
"thanks! saving...": "Merci! Enregistrer ..",
"wrestling": "Lutte",
"{language name}": "Français",
"import log files": "importation fichiers de log",
"programming": "programmation",
"translation": "traduction",
"see this page for more information.": "voir cette page pour plus d'information",
"drag and drop log files here to import their data.": "?",
"please only drop log files for this type of mob.": "?",
"the files were successfully imported.": "?",
"importing, please wait...": "?",
"import files": "?",
"cancel": "?",
"submit": "?",
"credits": "?",
};
stratics.i18n.langs.push('de');
stratics.i18n.de = {
"add an animal lore reading": "Füge die Ergebnisse von Animal Lore hinzu",
"anatomy": "Anatomie",
"an error has occurred submitting the data. please try again.": "Ein Fehler ist beim Senden der Daten aufgetreten. Bitte versuche es erneut.",
"arachnid": "Spinnentier",
"attributes": "Attribute",
"barding difficulty": "Bardenschwierigkeit",
"base damage": "Basisschaden",
"bear": "Bär",
"blackrock stew": "Blackrock Eintopf",
"bull": "Bulle",
"bushido": "Bushido",
"canine": "Hundeartige",
"chivalry": "Ritterlichkeit",
"cold damage": "Kälteschaden",
"cold resistance": "Kältewiderstand",
"combat ratings": "Kampffähigkeiten",
"crops": "Saaten",
"daemon": "Dämon",
"damage": "Schaden",
"detecting hidden": "Verstecktes Finden",
"dexterity": "Geschicklichkeit",
"discordance": "Missklang",
"eggs": "Eier",
"energy damage": "Energieschaden",
"energy resistance": "Ernergiewiderstand",
"equine": "Pferdeartige",
"evaluating intelligence": "Intellekt-Beurteilung",
"feline": "Katzenartige",
"fire damage": "Feuerschaden",
"fire resistance": "Feuerwiderstand",
"fish": "Fisch",
"focus": "Fokus",
"fruit & vegetables": "Obst & Gemüse",
"gold": "Gold",
"grain": "Korn",
"hay": "Heu",
"healing": "Heilen",
"hiding": "Verstecken",
"hit point regeneration": "Lebenspunktregeneration",
"hp": "Lebenspunkte",
"hold ctrl to select multiple items.": "Halte Strg um mehrere Einträge auszuwählen.",
"intelligence": "Intelligenz",
"leather": "Leder",
"lore & knowledge": "Legenden & Wissen",
"magery": "Magie",
"mana": "Mana",
"mana regeneration": "Manaregeneration",
"meat": "Fleisch",
"meditation": "Meditation",
"metal": "Metall",
"mysticism": "Mystizismus",
"necromancy": "Nekromantie",
"ninjitsu": "Ninjitsu",
"ostard": "Ostard",
"pack instincts": "Rudelinstinkt",
"parrying": "Parieren",
"pet slots": "Slot-Bedarf des Begleiters",
"physical damage": "Physischer Schaden",
"physical resistance": "Physischer Widerstand",
"poison damage": "Giftschaden",
"poisoning": "Vergiften",
"poison resistance": "Giftwiderstand",
"preferred foods": "bevorzugtes Essen / bevorzugtes Futter(?)",
"resistances": "Widerstände",
"resisting spells": "Zauber Widerstehen",
"saved. reloading the page...": "Geispeichert. Seite wird neugeladen..",
"spellweaving": "Zauberweben",
"spirit speak": "Spiritismus",
"stamina": "Ausdauer",
"stamina regeneration": "Ausdauer Widerherstellung",
"strength": "Stärke",
"tactics": "Taktik",
"thanks! saving...": "Vielen Dank! Speichern..",
"wrestling": "Ringen",
"{language name}": "Deutsch",
"import log files": "Importiere Log-Dateien",
"programming": "Programmierung",
"translation": "Übersetzung",
"see this page for more information.": "Mehr Informationen auf dieser Seite",
"drag and drop log files here to import their data.": "Lege Dateien hier ab, um sie zu übertragen",
"please only drop log files for this type of mob.": "Bitte nur Dateien von genau diesem Monster hier ablegen",
"the files were successfully imported.": "Die Dateien wurden erfolgreich eingelesen",
"importing, please wait...": "Lese Dateien ein, bitte warten...",
"import files": "Dateien übertragen",
"cancel": "Abbrechen",
"submit": "Weiter",
"credits": "Wir danken:",
};
stratics.i18n.langs.push('es');
stratics.i18n.es = {
"add an animal lore reading": "?",
"anatomy": "Anatomía",
"an error has occurred submitting the data. please try again.": "Ha habido un error subiendo la informacion. Intentelo de nuevo",
"arachnid": "Aracnido",
"attributes": "Caracteristicas",
"barding difficulty": "?",
"base damage": "Daño base",
"bear": "Oso",
"blackrock stew": "Sopa de Blackrock (LOL)",
"bull": "Toro",
"bushido": "Bushido",
"canine": "Canino",
"chivalry": "Caballerosidad",
"cold damage": "Daño frio",
"cold resistance": "Resistencia de frio",
"combat ratings": "Nivel de Combate",
"crops": "Cultivos",
"daemon": "Demonio",
"damage": "Daño",
"detecting hidden": "Deteccion de ocultos",
"dexterity": "Destresa",
"discordance": "Discordance/Discordacia",
"eggs": "Huevos",
"energy damage": "Daño Energia",
"energy resistance": "Resistencia de Energia",
"equine": "Equino",
"evaluating intelligence": "Evaluar Inteligencia",
"feline": "Felino",
"fire damage": "Daño fuego",
"fire resistance": "Resistencia de fuego",
"fish": "Pez/Peces",
"focus": "Concentracion",
"fruit & vegetables": "Fruitas y verdura",
"gold": "Oro",
"grain": "Grano",
"hay": "heno/paja",
"healing": "Curación",
"hiding": "Ocultación",
"hit point regeneration": "Regeneracion de vida",
"hp": "Golpes",
"hold ctrl to select multiple items.": "Mantenga CTRL para elegir varios objetos",
"intelligence": "Inteligencia",
"leather": "Cuero",
"lore & knowledge": "Conocimientos",
"magery": "Magia",
"mana": "Mana",
"mana regeneration": "Regeneracion de mana",
"meat": "Carne",
"meditation": "Meditacion",
"metal": "Metal",
"mysticism": "Misticismo",
"necromancy": "Necromancia",
"ninjitsu": "Ninjitsu",
"ostard": "Ostard",
"pack instincts": "Instinto de manada",
"parrying": "Esquivar/Blokear",
"pet slots": "?",
"physical damage": "Daño fisico",
"physical resistance": "Resistencia de fisico",
"poison damage": "Daño de veneno",
"poisoning": "Envenenamiento",
"poison resistance": "Resistencia de veneno",
"preferred foods": "Comidas preferida",
"resistances": "Resistencias",
"resisting spells": "Resistencia a la magia",
"saved. reloading the page...": "Guardado.Recargando la pagina",
"spellweaving": "Spellweaving",
"spirit speak": "Espirtismo",
"stamina": "Stamina",
"stamina regeneration": "Regeneracion de stamina",
"strength": "Fuerza",
"tactics": "Tácticas",
"thanks! saving...": "Gracias! Guardando",
"wrestling": "Lucha",
"{language name}": "español",
"import log files": "?",
"programming": "?",
"translation": "?",
"see this page for more information.": "?",
"drag and drop log files here to import their data.": "?",
"please only drop log files for this type of mob.": "?",
"the files were successfully imported.": "?",
"importing, please wait...": "?",
"import files": "?",
"cancel": "?",
"submit": "?",
"credits": "?",
};
stratics.i18n.langs.push('jp');
stratics.i18n.jp = {
"add an animal lore reading": "?",
"anatomy": "解剖学",
"an error has occurred submitting the data. please try again.": "データ送信時にエラーが発生しました。再度お試しください。",
"arachnid": "アラクニド",
"attributes": "属性",
"barding difficulty": "バード難易度",
"base damage": "ベースダメージ",
"bear": "熊",
"blackrock stew": "ブラックロックシチュー",
"bull": "牛",
"bushido": "武士道",
"canine": "犬",
"chivalry": "騎士道",
"cold damage": "冷気ダメージ",
"cold resistance": "冷気抵抗",
"combat ratings": "戦闘関連",
"crops": "農作物",
"daemon": "デーモン",
"damage": "ダメージ",
"detecting hidden": "探知",
"dexterity": "器用さ",
"discordance": "不調和",
"eggs": "卵",
"energy damage": "エネルギーダメージ",
"energy resistance": "エネルギー抵抗",
"equine": "馬",
"evaluating intelligence": "評価",
"feline": "猫",
"fire damage": "炎ダメージ",
"fire resistance": "炎抵抗",
"fish": "魚",
"focus": "集中",
"fruit & vegetables": "果物と野菜",
"gold": "ゴールド",
"grain": "粒",
"hay": "干し草",
"healing": "治療",
"hiding": "隠蔽",
"hit point regeneration": "ヒットポイント回復",
"hp": "ヒットポイント",
"hold ctrl to select multiple items.": "Ctrlキーを押しながら複数のアイテムを選択する。",
"intelligence": "知性",
"leather": "皮",
"lore & knowledge": "知識と情報",
"magery": "魔法",
"mana": "マナ",
"mana regeneration": "マナ回復",
"meat": "肉",
"meditation": "瞑想",
"metal": "金属",
"mysticism": "神秘",
"necromancy": "ネクロマンシー",
"ninjitsu": "忍術",
"ostard": "オスタード",
"pack instincts": "グループパワー",
"parrying": "受け流し",
"pet slots": "ペットスロット",
"physical damage": "物理ダメージ",
"physical resistance": "物理抵抗",
"poison damage": "毒ダメージ",
"poisoning": "毒",
"poison resistance": "毒抵抗",
"preferred foods": "好物",
"resistances": "抵抗",
"resisting spells": "魔法抵抗",
"saved. reloading the page...": "保存完了。ページをリロード中...",
"spellweaving": "織成呪文",
"spirit speak": "霊話",
"stamina": "スタミナ",
"stamina regeneration": "スタミナ回復",
"strength": "体力",
"tactics": "戦術",
"thanks! saving...": "サンクス! 保存中...",
"wrestling": "格闘",
"{language name}": "日本語",
"import log files": "ログファイルのインポート",
"programming": "プログラミング",
"translation": "翻訳",
"see this page for more information.": "詳細はこちらのページを参照してください。",
"drag and drop log files here to import their data.": "ここにログファイルをドラッグ&ドロップしてデータをインポートします。",
"please only drop log files for this type of mob.": "拡張子が.MOBのログファイルのみ削除してください。",
"the files were successfully imported.": "ファイルは正常にインポートされました。",
"importing, please wait...": "インポート中です、お待ちください...",
"import files": "取り込むファイル",
"cancel": "キャンセル",
"submit": "送信",
"credits": "クレジット",
};