From 3765b41ea83d528c237a07f8184ed8f1e77bf503 Mon Sep 17 00:00:00 2001 From: Ornstein <6075693+SlayerOrnstein@users.noreply.github.com> Date: Tue, 17 Dec 2024 19:58:35 -0500 Subject: [PATCH] feat: add 1999 calendar langs (#588) --- data/languages.json | 84 ++++++++++++++++++++++++++++++ test/utilities/translation.spec.js | 16 ++++++ tools/translation.js | 25 +++++++++ 3 files changed, 125 insertions(+) diff --git a/data/languages.json b/data/languages.json index d5980e0005f..6d8f9416c7f 100644 --- a/data/languages.json +++ b/data/languages.json @@ -18854,5 +18854,89 @@ }, "/Lotus/Types/Gameplay/NarmerSorties/ArchonCrystalAmarMythic": { "value": "Tauforged Crimson Archon Shard" + }, + "/Lotus/Types/Challenges/Calendar1999/CalendarKillEximusEasy": { + "value": "EX-EXIMUS", + "desc": "Kill 10 Eximus" + }, + "/Lotus/Upgrades/Calendar/MagazineCapacity": { + "value": "Heavy Mags", + "desc": "Increase magazine capacity by 25%" + }, + "/Lotus/Upgrades/Calendar/Armor": { + "value": "Thick Skin", + "desc": "Gain +250 Armor." + }, + "/Lotus/Upgrades/Calendar/EnergyRestoration": { + "value": "Espresso Shots", + "desc": "Increase energy restoration by 2/s." + }, + "/Lotus/Types/Challenges/Calendar1999/CalendarKillScaldraEnemiesEasy": { + "value": "Punish Scaldra", + "desc": "Kill 250 Scaldra Troops" + }, + "/Lotus/StoreItems/Types/BoosterPacks/CalendarMajorArtifactPack": { + "value": "Arcane Enhancements: Double Pack" + }, + "/Lotus/StoreItems/Types/Gameplay/NarmerSorties/ArchonCrystalGreen": { + "value": "Emerald Archon Shard" + }, + "/Lotus/StoreItems/Types/Recipes/Components/WeaponUtilityUnlockerBlueprint": { + "value": "Exilus Weapon Adapter Blueprint" + }, + "/Lotus/Types/StoreItems/Packages/Calendar/CalendarKuvaBundleSmall": { + "value": "2000 x Kuva" + }, + "/Lotus/Types/Challenges/Calendar1999/CalendarKillEnemiesWithAbilitiesMedium": { + "value": "Demonstration of power", + "desc": "Kill 300 Enemies with Abilities" + }, + "/Lotus/Types/Challenges/Calendar1999/CalendarKillScaldraEnemiesWithMeleeMedium": { + "value": "Make it personal", + "desc": "Kill 300 Scaldra Troops with Melee Weapons" + }, + "/Lotus/Upgrades/Calendar/CompanionsBuffNearbyPlayer": { + "value": "More the Merrier", + "desc": "Non-Tenno Allies within 20m all gain +5% Melee Attack Speed and +20% Fire Rate for each one in range." + }, + "/Lotus/Upgrades/Calendar/OrbsDuplicateOnPickup": { + "value": "Targeted Medicine", + "desc": "Shoot Health Orbs to pick them up. Health orbs now have 25% chance to duplicate when picked up." + }, + "/Lotus/Upgrades/Calendar/FinisherChancePerComboMultiplier": { + "value": "Combo Killer", + "desc": "Combo Multiplier increases the chance of enemies being susceptible to finishers after a melee hit. 5% per Multiplier Max 65% with Venka Prime." + }, + "/Lotus/StoreItems/Types/BoosterPacks/CalendarArtifactPack": { + "value": "Arcane Enhancements" + }, + "/Lotus/Types/Challenges/Calendar1999/CalendarKillTechrotEnemiesHard": { + "value": "Purge the infection", + "desc": "Kill 1,000 Techrot" + }, + "/Lotus/StoreItems/Types/Items/MiscItems/WeaponSecondaryArcaneUnlocker": { + "value": "Secondary Arcane Adapter" + }, + "/Lotus/StoreItems/Upgrades/Mods/FusionBundles/CircuitSilverSteelPathFusionBundle": { + "value": "6,000 Endo" + }, + "/Lotus/Types/Challenges/Calendar1999/CalendarDestroyPropsMedium": { + "value": "Starve the beast", + "desc": "Destroy 150 Containers" + }, + "/Lotus/StoreItems/Types/Items/MiscItems/WeaponUtilityUnlocker": { + "value": "Exilus Weapon Adapter" + }, + "/Lotus/Upgrades/Calendar/EnergyOrbToAbilityRange": { + "value": "Broadened Horizons", + "desc": "On Energy Pickup increase ability range by 10% for 10s." + }, + "/Lotus/Upgrades/Calendar/MeleeAttackSpeed": { + "value": "No Quarter", + "desc": "+25% Melee Attack Speed." + }, + "/Lotus/Upgrades/Calendar/CompanionDamage": { + "value": "Got Your Back", + "desc": "Specters and companions gain +250% damage." } } \ No newline at end of file diff --git a/test/utilities/translation.spec.js b/test/utilities/translation.spec.js index c4231407428..7189c076118 100644 --- a/test/utilities/translation.spec.js +++ b/test/utilities/translation.spec.js @@ -24,8 +24,10 @@ import { sortieModifier, syndicate, toTitleCase, + translateCalendarEvent, translateFocus, translatePolarity, + translateSeason, upgrade, } from '../../tools/translation.js'; @@ -280,6 +282,20 @@ describe('translation', () => { archonShardUpgradeType('notfound', 'notfound').should.equal('notfound'); }); }); + describe('translateCalendarEvent()', () => { + it('should return a translation of the key', () => { + translateCalendarEvent('CET_CHALLENGE').should.equal('To Do'); + }); + it("should return the key if it's not found in the data", () => { + translateCalendarEvent('None').should.equal('None'); + }); + }); + describe('translateSeason()', () => { + it('should return a readable version of a season string', () => { + translateSeason('CST_WINTER').should.equal('Winter'); + translateSeason('None').should.equal('None'); + }); + }); }); describe('supports overriding locale', () => { diff --git a/tools/translation.js b/tools/translation.js index 7f0c177050e..b424c178025 100644 --- a/tools/translation.js +++ b/tools/translation.js @@ -309,6 +309,27 @@ const polarityMap = { */ export const translatePolarity = (pol = '') => valMapping(pol, polarityMap); +const eventTypeMap = { + CET_CHALLENGE: 'To Do', + CET_UPGRADE: 'Override', + CET_REWARD: 'Big Prize!', + CET_PLOT: 'Birthday', +}; + +/** + * Translate the given event key + * @param {string} key Unique event type + * @returns {string} + */ +export const translateCalendarEvent = (key) => valMapping(key, eventTypeMap); + +/** + * Translate the given season name to a non-unique string + * @param {string} season Unique season name + * @returns {string} + */ +export const translateSeason = (season) => toTitleCase(season.replace('CST_', '')); + /** * An object containing functions to convert in-game names to their localizations * @typedef {Record} Translator @@ -338,6 +359,8 @@ export const translatePolarity = (pol = '') => valMapping(pol, polarityMap); * @property {function} archonShard - Converts archon shard names * @property {function} archonShardColor - Converts archon shard names to in-game color values * @property {function} archonShardUpgradeType - Convert archon shard upgrade type + * @property {function} translateCalendarEvent - Translate the given event key + * @property {function} translateSeason - Translate the given season name to a non-unique string */ export default { faction, @@ -368,4 +391,6 @@ export default { archonShard, archonShardColor, archonShardUpgradeType, + translateCalendarEvent, + translateSeason, };