Skip to content

Commit

Permalink
Updated translations
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoAbove committed Mar 28, 2024
1 parent 823f188 commit 336d934
Show file tree
Hide file tree
Showing 16 changed files with 38,547 additions and 36,703 deletions.
9 changes: 1 addition & 8 deletions dataScripts/full_parse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ read -p "Do you want to copy the files to the data directory? (y/N) " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -r ./src/out/gen # Not needed - need manual updates since these are templates
mv -f ./src/out/spells.h ../src/services/SeedInfo/noita_random/src/spells.h

# Rename locales
mv ./src/locales/es-es ./src/locales/es
mv ./src/locales/fr-fr ./src/locales/fr
mv ./src/locales/pt-br ./src/locales/pt
mv ./src/locales/zh-cn ./src/locales/zh
rm -r ./src/locales/es-es ./src/locales/fr-fr ./src/locales/pt-br ./src/locales/zh-cn
mv ./src/locales ../public/locales
mv ./src/out/locales ../public/locales

cp -rf ./src/out/* ../src/services/SeedInfo/data/
fi
Expand Down
27 changes: 19 additions & 8 deletions dataScripts/src/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const noitaData = path.resolve(__dirname, "../../noita-data/");

const translationFile = path.resolve(__dirname, "../noita-data/translations/common.csv");

const translationCSV = fs.readFileSync(translationFile).toString();
Expand All @@ -19,9 +17,21 @@ const translation: { [locale: string]: { [id: string]: string } } = {};
// first col is id
// eslint-disable-next-line no-sparse-arrays
const locales = [, "en", "ru", "pt-br", "es-es", "de", "fr-fr", "it", "pl", "zh-cn", "jp", "ko"];

const localeMap = {
en: "en",
ru: "ru",
"pt-br": "pt",
"es-es": "es",
de: "de",
"fr-fr": "fr",
it: "it",
pl: "pl",
"zh-cn": "zh",
jp: "jp",
ko: "ko",
};
const records: any[] = parse(translationCSV, {
columns: true,
// columns: true,
skip_empty_lines: true,
});

Expand All @@ -40,7 +50,7 @@ records.forEach((row, i) => {
if (!translation[locale]) {
translation[locale] = {};
}
translation[locale]["$" + row.id] = row[locale];
translation[locale]["$" + row[0]] = row[i];
}
});

Expand All @@ -50,10 +60,11 @@ for (let i = 1; i < locales.length; i++) {
if (!locale) {
continue;
}
fs.mkdirSync(path.resolve(__dirname, `./out/locales/${locale}`));
fs.writeFileSync(path.resolve(__dirname, `./out/locales/${locale}/app.json`), JSON.stringify({}, null, 2));
const localeName = localeMap[locale];
fs.mkdirSync(path.resolve(__dirname, `./out/locales/${localeName}`), { recursive: true });
fs.writeFileSync(path.resolve(__dirname, `./out/locales/${localeName}/app.json`), JSON.stringify({}, null, 2));
fs.writeFileSync(
path.resolve(__dirname, `./out/locales/${locale}/materials.json`),
path.resolve(__dirname, `./out/locales/${localeName}/materials.json`),
JSON.stringify(translation[locale], null, 2),
);
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

177 changes: 164 additions & 13 deletions public/locales/de/materials.json

Large diffs are not rendered by default.

165 changes: 158 additions & 7 deletions public/locales/en/materials.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$": "en",
"$current_language": "English",
"$booktitle00": "Emerald Tablet - volume I",
"$bookdesc00": "Tis true without lying, certain and most true.\\nThat which is below is like that which is above\\nand that which is above is like that which is below\\nto do the miracles of one only thing.\\nAnd as all things have been and arose from one by the mediation of one: \\nso all things have their birth from this one thing by adaptation.",
Expand Down Expand Up @@ -1690,7 +1691,7 @@
"$action_divide_10": "Divide by 10",
"$actiondesc_divide_10": "Casts the next spell 10 times, but with reduced damage",
"$action_all_nukes": "Spells to nukes",
"$actiondesc_all_nukes": "Transforms every projectile currently in the air into a nuke; not a good idea",
"$actiondesc_all_nukes": "Transforms every projectile currently in the air into a nuke",
"$action_all_discs": "Spells to giga sawblades",
"$actiondesc_all_discs": "Transforms every projectile currently in the air into a giant sawblade",
"$action_all_blackholes": "Spells to black holes",
Expand Down Expand Up @@ -1925,7 +1926,7 @@
"$item_key": "Crystal key",
"$itemdesc_key_0": "The key is voiceless.",
"$itemdesc_key_1": "The key hums, but something is missing...",
"$itemdesc_key_2": "The key whispers secrets and promises; it is ready.",
"$itemdesc_key_2": "The key whispers secrets and promises",
"$item_description_potion_usage": "\\n$0 on item - drink",
"$item_jar": "Jar",
"$item_description_jar": "Equip and spray or throw",
Expand Down Expand Up @@ -2082,6 +2083,7 @@
"$menu_newgame_modschangedrestart": "The game will restart due to mod changes.",
"$menu_progress_new": "Progress ($0 new)",
"$menu_streamermode": "Streamer mode: $0",
"$menu_slider_percentage": "$0%",
"$menu_streaming_description": "Let stream viewers interact with your game through the Twitch chat.",
"$menu_streaming_description_details": "Chat messages “1”, “2”, “3” and “4” will be counted as votes towards\\nvarious events that are selected from a random pool.",
"$menu_streaming_connect": "Connect",
Expand Down Expand Up @@ -3043,7 +3045,7 @@
"$streamingeventdesc_holiday_mood": "Let it be snow",
"$streamingeventdesc_holiday_mood_2": "Let it snow",
"$perk_contact_damage": "Contact Damage",
"$perkdesc_contact_damage": "Enemies near you take damage; the damage is higher the lower your health gets.",
"$perkdesc_contact_damage": "Enemies near you take damage",
"$mat_metal_sand": "Metal dust",
"$mat_metal_sand_molten": "Molten metal",
"$item_evil_eye": "Paha Silmä",
Expand Down Expand Up @@ -3370,9 +3372,9 @@
"$animal_fungus_tiny_perk": "Sappitatti",
"$reward_sun": "Benign sunshine!",
"$action_sun": "Summon A Sun",
"$actiondesc_sun": "Creates an immensely powerful entity; Can be cast only once",
"$actiondesc_sun": "Creates an immensely powerful entity",
"$action_darksun": "Summon A Dark Sun",
"$actiondesc_darksun": "Creates an immensely powerful entity; Can be cast only once",
"$actiondesc_darksun": "Creates an immensely powerful entity",
"$achievement_excavationsite": "Reached Coal Pits",
"$achievementdesc_excavationsite": "Reached Coal Pits",
"$achievement_snowcave": "Reached Snowy Depths",
Expand Down Expand Up @@ -3469,10 +3471,159 @@
"$mat_meat_done": "Fully-cooked meat",
"$mat_meat_burned": "Burned meat",
"$mat_peasoup_concentrate": "Pea soup concentrate",
"$mat_mammi": "Mämmi",
"$mat_mammi": "mämmi",
"$mat_juhannussima": "Juhannussima",
"$item_hernekeittopurkki": "Hernekeittopurkki",
"$item_kaljapullo": "Kaljapullo",
"$perk_iron_stomach": "Iron Stomach",
"$perkdesc_iron_stomach": "You no longer suffer from negative effects of eating."
"$perkdesc_iron_stomach": "You no longer suffer from negative effects of eating.",
"$NEWTEXTSINCE20210423": "",
"$animal_wand_ghost_charmed": "Taikasauva",
"$gold_wand_statue": "Golden statue",
"$inventory_dmg_melee": "Dmg. Melee",
"$mat_material_confusion": "flummoxium",
"$animal_thunderburst_thundermage": "Ukko",
"$animal_thunderburst": "Ukko",
"$action_bounce_small_explosion": "Sparkly bounce",
"$actiondesc_bounce_small_explosion": "Makes a projectile release damaging sparks as it bounces",
"$action_bounce_lightning": "Lightning bounce",
"$actiondesc_bounce_lightning": "Makes a projectile release powerful lightning as it bounces",
"$action_bounce_hole": "Vacuum bounce",
"$actiondesc_bounce_hole": "Makes a projectile remove earth as it bounces",
"$action_zero_damage": "Null shot",
"$actiondesc_zero_damage": "Increases a projectile's duration dramatically but removes all damage & explosion from it",
"$action_caster_cast": "Inner spell",
"$actiondesc_caster_cast": "Causes a projectile to be cast from where the caster is standing",
"$animal_shotgunner_hell": "Hornahiisi",
"$animal_sniper_hell": "Hornasnipuhiisi",
"$action_white_hole_big": "Giga white hole",
"$actiondesc_white_hole_big": "A growing orb of positive energy that destroys everything in its reach",
"$action_true_orbit": "True Orbit",
"$actiondesc_true_orbit": "Makes a projectile rotate around the caster like an orbiting planet",
"$action_hook": "Hookbolt",
"$actiondesc_hook": "A glowing hook that pulls the caster towards itself upon collision",
"$action_anti_homing": "Anti Homing",
"$actiondesc_anti_homing": "Makes a projectile accelerate away from your foes",
"$action_fish": "Summon fish",
"$actiondesc_fish": "FISH!",
"$action_sea_swamp": "Summon Swamp",
"$actiondesc_sea_swamp": "Summons a large swamp below the caster",
"$item_leukaluu": "Hauen leukaluu",
"$action_homing_wand": "Wand Homing",
"$actiondesc_homing_wand": "Makes a projectile accelerate towards wands",
"$item_leukaluu_kantele": "Kantele hauen leukaluusta",
"$damage_holy": "holy",
"$magic_liquid_weakness": "diminution",
"$status_weakness": "Weakness",
"$statusdesc_weakness": "You feel weakened.",
"$mat_static_magic_material": "australium",
"$mat_magic_gas_midas": "gas of midas",
"$mat_magic_gas_worm_blood": "worm gas",
"$animal_miner_hell": "Hornantappurahiisi",
"$animal_meatmaggot": "Mätäryömijä",
"$mat_pus": "pus",
"$action_quad_shot": "Quplicate Spell",
"$actiondesc_quad_shot": "Casts copies of a projectile in a tetragonal pattern, but the copies still cost mana",
"$action_i_shot": "Iplicate Spell",
"$actiondesc_i_shot": "Casts a copy of a projectile behind you, but the copy still cost mana",
"$action_t_shot": "Tiplicate Spell",
"$actiondesc_t_shot": "Casts copies of a projectile above and below you, but the copies still cost mana",
"$action_w_shot": "Wuplicate Spell",
"$actiondesc_w_shot": "Casts copies of a projectile in a trifurcated pattern, but the copies still cost mana",
"$action_y_shot": "Yplicate Spell",
"$actiondesc_y_shot": "Casts a copy of a projectile in a bifurcated pattern, but the copy still cost mana",
"$action_penta_shot": "Peplicate Spell",
"$actiondesc_penta_shot": "Casts 5 copies of a projectile in a pentagonal pattern, but the copies still cost mana",
"$action_hexa_shot": "Heplicate Spell",
"$actiondesc_hexa_shot": "Casts 6 copies of a projectile in a hexagonal pattern, but the copies still cost mana",
"$biome_meat": "Meat realm",
"$action_antiheal": "Deadly heal",
"$actiondesc_antiheal": "A projectile that at first deals damage, then heals over time",
"$animal_windshaman": "Tuulikainen",
"$action_clustermod": "Clusterbolt",
"$actiondesc_clustermod": "Makes a projectile release a cluster of explosive bolts upon hitting a wall",
"$action_turretmod": "Sentinel Spirit",
"$actiondesc_turretmod": "Releases a spirit that fires copies of a projectile towards targets",
"$animal_boss_meat": "Kolmisilmän sydän",
"$item_utility_box": "Utility box",
"$animal_tentaclemass": "Sätkijä",
"$perk_bigger": "Become huger",
"$perkdesc_bigger": "Your projectile and explosive resistances increase, but you're easier to hit.",
"$perk_smaller": "Become tinier",
"$perkdesc_smaller": "You're harder to hit, but take more projectile and explosive damage.",
"$animal_islandspirit": "Tapion vasalli",
"$perk_lich": "Lich form",
"$perkdesc_lich": "You take on a hideous new form!",
"$action_holy": "Holy Lance",
"$actiondesc_holy": "A fast-flying, penetrating lance that glows with power",
"$inventory_dmg_holy": "Dmg. Holy",
"$animal_shaman_wind": "Valhe",
"$mat_magic_gas_polymorph": "polymorphine cloud",
"$mat_magic_gas_weakness": "diminution cloud",
"$mat_magic_gas_teleport": "teleportatium cloud",
"$mat_magic_gas_fungus": "funky cloud",
"$mat_magic_liquid_death": "instant deathium",
"$animal_berserkspirit": "Viha-Aave",
"$animal_confusespirit": "Utu-Aave",
"$animal_weakspirit": "Kaamo-Aave",
"$animal_slimespirit": "Neva-Aave",
"$mat_magic_gas_confuse": "flummoxium cloud",
"$mat_magic_gas_berserk": "berserkium cloud",
"$mat_magic_gas_charm": "pheromone cloud",
"$DO_NOT_USE_actiondesc_curse_wither_projectile": "Target hit by a projectile takes 25% extra projectile damage for a time. Doesn't work on targets immune to projectile damage",
"$DO_NOT_USE_actiondesc_curse_wither_explosion": "Target hit by a projectile takes 25% extra explosion damage for a time. Doesn't work on targets immune to explosive damage",
"$DO_NOT_USE_actiondesc_curse_wither_melee": "Target hit by a projectile takes 25% extra melee damage for a time. Doesn't work on targets immune to melee damage",
"$DO_NOT_USE_actiondesc_curse_wither_electricity": "Target hit by a projectile takes 25% extra electricity damage for a time. Doesn't work on targets immune to electric damage",
"$animal_longleg_huge": "Suurhämis",
"$perkdesc_vampirism": "You lose 25% maximum health, but can replenish health by drinking blood.\\nBlood doesn't affect satiation level and you no longer suffer from food poisoning.",
"$status_mammi_eater": "The Loathsome Mämmi Eater",
"$statusdesc_mammi_eater": "You have gained a persistent nickname.",
"$action_touch_piss": "Touch of Gold?",
"$actiondesc_touch_piss": "Transmutes everything in a short radius into urine, including walls, creatures... and you",
"$action_mass_polymorph": "Muodonmuutos",
"$actiondesc_mass_polymorph": "Baa",
"$action_touch_grass": "Touch of Grass",
"$actiondesc_touch_grass": "Transmutes everything in a short radius into Earth, including walls, creatures... and you. Unless…",
"$action_cessation": "Cessation",
"$actiondesc_cessation": "The caster enters the realm of no realm",
"$item_chainsaw": "Saha",
"$action_white_hole": "White hole",
"$actiondesc_white_hole": "An orb of positive energy that destroys everything in its path",
"$action_white_hole_giga": "Omega white hole",
"$actiondesc_white_hole_giga": "A massive orb of positive energy that destroys everything in its reach",
"$ui_longleg_love": "Press $0 to pet",
"$ui_longleg_love_msg1": "The Hämis is happy!",
"$ui_longleg_love_msg2": "The Hämis is EXTREMELY happy!",
"$log_boss_meat_death": "A curse has been lifted!",
"$logdesc_boss_meat_death": "The air feels easier to breathe",
"$animal_mimic_potion": "Henkevä potu",
"$animal_boss_sky2": "Lohkare",
"$animal_boss_sky": "Kivi",
"$action_sea_mimic": "Sea of Mimicium",
"$actiondesc_sea_mimic": "Summons a large body of mimicium under the caster",
"$mat_mimic_liquid": "mimicium",
"$item_potion_mimic": "Potion (100% full)",
"$biome_labyrinth": "Labyrinth",
"$mat_grass_holy": "Divine Ground",
"$biome_potion_mimics": "Henkevä Temple",
"$biome_boss_sky2": "Lohkare Temple",
"$biome_boss_sky": "Kivi Temple",
"$biome_barren": "Barren Temple",
"$biome_darkness": "Ominous Temple",
"$biome_watchtower": "Watchtower",
"$bookdesc_barren": "Those who attain the fruit of the House above the Triadic Tomb shall hold this truth:\\nThe Holiest Ground is most fertile when touched by Our Water.",
"$booktitle_barren": "Adept’s Note",
"$fast_travel_boom": "Fast Travel Explosion",
"$perkdesc_fast_travel_boom": "Some explosions can be amplified to vast proportions through the use of additional perks.",
"$mat_beer": "beer",
"$mat_milk": "milk",
"$mat_molut": "molut",
"$mat_ice_beer": "frozen beer",
"$mat_ice_milk": "frozen milk",
"$mat_ice_molut": "frozen molut",
"$mat_ice_vomit": "frozen vomit",
"$log_gods_looking": "The Gods are looking for you",
"$logdesc_gods_looking": "The Gods are looking for you",
"$log_gods_looking2": "The Gods cannot find you",
"$logdesc_gods_looking2": "The Gods cannot find you"
}
Loading

0 comments on commit 336d934

Please sign in to comment.