herbix / hoi4modutilities

A VSCode extension that contains utilities for Heart of Iron IV mods developers
MIT License
83 stars 10 forks source link

[BUG] Preview event localisation #42

Closed gyhs closed 3 years ago

gyhs commented 3 years ago

Describe the bug I added event loc value (mod), but I can't check mod's localisation

To Reproduce Steps to reproduce the behavior:

  1. Go to your mod and open custom event
  2. Click on Preview HOI4 File
  3. add "#!localisation:localisation/im_localisation_l_english.yml"
  4. See error

Expected behavior this option is for only vanila.

Screenshots If applicable, add screenshots to help explain your problem.

error

herbix commented 3 years ago

@gyhs In events, localization key is title field of country_event, which is from official wiki. Did you miss title field? If it does work without title in game, please let me know. I'll update the extension to support it. image image

gyhs commented 3 years ago

@herbix image image

sadly, I wrote it... I think ext is something wrong

herbix commented 3 years ago

@gyhs Another possible reason is that your localization file is not in correct YAML format. You can open developer tools with command Developer: Toggle Developer Tools and navigate to console tab to check whether there's a YAMLException. image

herbix commented 3 years ago

BTW, vanilla HOI4 localization files are not in correct YAML format too. The number after colon is not supported by YAML format. I'm not sure why it's here. But I did some trick to remove them all. Maybe there're some rules in localization files that I didn't care about.

FEN_heavy_fighter_equipment_3_short:0 "PF-98"

gyhs commented 3 years ago

image I thank you very much, image fixed every lines! but can you support :0 < this format?

gyhs commented 3 years ago

@herbix image ah, and what is this? why can't use korean translation file?

herbix commented 3 years ago

but can you support :0 < this format?

Actually it's supported. I guess there're other format issues that triggered this bug.

why can't use korean translation file?

The extension tries to load translation file from your vscode language configuration, but Korean translation file is not supported by my extension yet. It will fall back to English.

gyhs commented 3 years ago

Ah, i see! Thank you for your advices!