godotengine / godotengine/godot
Translations are not updated when dynamically loading PCK
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in 4.4.dev [ef8d981267702de38ffc24136f9d823d31781c60]
### System information
Windows 11 (10.0.22631)
### Issue description
When including updated translation files as part of an exported PCK file that's meant to be dynamically loaded at runtime, you currently have to manually load each `*.translation` file after having loaded the PCK in order for the updated translations to actually have any effect.
The expected behavior would be for the updated translations to be loaded as part of loading the PCK.
### Steps to reproduce
(The MRP includes a `patch.pck` file that was exported using the patch system introduced in #97118, where the translation with key `HELLO` was changed from "Hello" to "Howdy" before exporting.)
1. Open the MRP.
2. Run the main scene.
3. Note how the label says "Hello".
4. Uncomment the `ResourceLoader.load` line in `main.gd`.
5. Run the main scene again.
6. Note how the label now says "Howdy".
### Minimal reproduction project (MRP)
[localization-patching.zip](https://github.com/user-attachments/files/17600771/localization-patching.zip)
Contributor guide
Research direction
Open the linked localization-patching.zip reproduction and inspect main.gd, patch.pck, and the included *.translation files. Run the project with and without the ResourceLoader.load line to confirm the current behavior; done means updated translations take effect after loading the PCK without manually loading each translation file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- localization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100