Skip to content

Fix for region macro localization#2553

Merged
KABoissonneault merged 1 commit intoInterkarma:masterfrom
Jagget:fix_localize_region_macro
Feb 6, 2024
Merged

Fix for region macro localization#2553
KABoissonneault merged 1 commit intoInterkarma:masterfrom
Jagget:fix_localize_region_macro

Conversation

@Jagget
Copy link
Copy Markdown
Collaborator

@Jagget Jagget commented Dec 16, 2023

The ____place_ macro was not fully localized.

Before:
Screenshot 2023-12-16 001904

After:
Screenshot 2023-12-16 001823

The text of the letter that is on screenshot:

Message:  1011
  %pcf,
<ce>
  Картографы поручили мне сопровождать вас
  в поисках пути в ____place_.
  Давайте встретимся в ___place_, чтобы мы могли пойти
  вместе. Пунктом назначения будет __home_,
  и упражнение должно быть выполнено не позже,
  чем через =timer_ дней, чтобы поддержать
  вашу репутацию в ассоциации.
<ce>
                _qg_
                Исследователь, полевой офицер
                Ассоциация Картографов
                ___place_, ____place_

@Interkarma
Copy link
Copy Markdown
Owner

The code you changed is the fallback when region index is not set in older saves. It shouldn't be changed. There will be another reason your text isn't localized. This PR shouldn't be accepted as now.

I actually found and fixed one of these recently for 0.16.2. Is that the version you're testing on? Quest will need to be recompiled to pick up region index correctly.

@Interkarma Interkarma closed this Dec 16, 2023
@Jagget
Copy link
Copy Markdown
Collaborator Author

Jagget commented Dec 16, 2023

I actually found and fixed one of these recently for 0.16.2. Is that the version you're testing on? Quest will need to be recompiled to pick up region index correctly.

@Interkarma

I'm running the master branch. And this quest started while I was running the Unity Player.

@Interkarma
Copy link
Copy Markdown
Owner

Interkarma commented Dec 16, 2023

OK, that's the core problem then. A quest that compiles on a recent version should never reach that code. It's only there as a handler for old saves, like the comment above it describes.

The proper fix will be to determine why region index isn't set by that point when quest compiled.

Edit: Perhaps the fallback logic itself is triggering problem here. Was this quest actually compiled in Dragontail or Alik'r?

@Jagget
Copy link
Copy Markdown
Collaborator Author

Jagget commented Dec 16, 2023

@Interkarma

2 questions then:

  1. What's wrong with translating fallback for old quests?
  2. When is the quest compiled? On the game starts or on the quest starts?

@Interkarma
Copy link
Copy Markdown
Owner

I'm happy to work with you, but what's the answer to my question above? Did this quest actually compile in Dragontail or Alik'r? That's important for me to determine how the code reached fallback in the first place.

To answer your questions: quests are compiled when the quest starts, and fallbacks are typically isolated from the localization system by design. That may be OK to rework in this case, but the problem you're trying to fix here actually indicates something else is happening. I want to dig into that before a fix is implemented.

@Jagget
Copy link
Copy Markdown
Collaborator Author

Jagget commented Dec 17, 2023

I'm happy to work with you, but what's the answer to my question above? Did this quest actually compile in Dragontail or Alik'r? That's important for me to determine how the code reached fallback in the first place.

OK, I'll try to explain how I got there. It is "Cartographer Guild" quest line from JayH. I started this quest line in Daggerfall. I don't really know if the game compiles consequent quests, but this exact quest has been auto started (I got the letter) in Dragontail region.

That may be OK to rework in this case, but the problem you're trying to fix here actually indicates something else is happening.

Actually, I started a new game and tested it for longer. After some time, I got a quest that uses ____place_ macro, and in case of new game I didn't get the untranslated region.

@Interkarma
Copy link
Copy Markdown
Owner

Actually, I started a new game and tested it for longer. After some time, I got a quest that uses ___place macro, and in case of new game I didn't get the untranslated region.

Excellent. Yeah, I believe this should already be fixed in 0.16.2, I missed setting one index case previously that I fixed in below PR.

e6bb5cc

But the quest has to recompile for index to be passed down, which for long-running quests can be unclear when that happens. In the first case, quest was probably already compiled to QuestMachine and running with the missing index, so it went through to fallback.

My reasoning for isolating fallback from the localization system is that if something has already failed to localize for some reason, we shouldn't try and fallback to the system that already failed in the first place. But I will say your solution is self-contained and will probably be OK. It's just doing a region name lookup in TextManager to retry the index, then getting the localized name. After some more thought, I think this will be fine.

I'll reopen and change can be reviewed as a better fallback method.

@Interkarma Interkarma reopened this Dec 17, 2023
@Jagget
Copy link
Copy Markdown
Collaborator Author

Jagget commented Dec 17, 2023

Great! Thank you very much!

@KABoissonneault
Copy link
Copy Markdown
Collaborator

The change is only fixing a data fixup for old saves, but it can't hurt to have. It should never affect new saves, and could help someone playing on an older save with a new version. Worth just getting in

@KABoissonneault KABoissonneault added this to the DFU 1.0.1 milestone Feb 4, 2024
@KABoissonneault KABoissonneault merged commit 4bce88a into Interkarma:master Feb 6, 2024
@Jagget Jagget deleted the fix_localize_region_macro branch February 6, 2024 22:59
@KABoissonneault KABoissonneault mentioned this pull request Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants