Skip to content

Commit

Permalink
feat: add 1999 calendar langs (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayerOrnstein authored Dec 18, 2024
1 parent b220c2a commit 3765b41
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
84 changes: 84 additions & 0 deletions data/languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
16 changes: 16 additions & 0 deletions test/utilities/translation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ import {
sortieModifier,
syndicate,
toTitleCase,
translateCalendarEvent,
translateFocus,
translatePolarity,
translateSeason,
upgrade,
} from '../../tools/translation.js';

Expand Down Expand Up @@ -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', () => {
Expand Down
25 changes: 25 additions & 0 deletions tools/translation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, function>} Translator
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -368,4 +391,6 @@ export default {
archonShard,
archonShardColor,
archonShardUpgradeType,
translateCalendarEvent,
translateSeason,
};

0 comments on commit 3765b41

Please sign in to comment.