Opened 5 years ago
Closed 5 years ago
#15904 closed bug (fixed)
Localization: ignored translations on some controls (catalog: x-vnd.Haiku-libbe)
Reported by: | dsjonny | Owned by: | nielx |
---|---|---|---|
Priority: | high | Milestone: | R1/beta2 |
Component: | Kits/Interface Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Some translations looks like ignored (ColorControl, Dragger, ...) on Haiku, however these are translated on Pootle and the catalogs are there: https://git.haiku-os.org/haiku/tree/data/catalogs/kits
This is hrev54088 x86_gcc2
Attachments (1)
Change History (14)
by , 5 years ago
Attachment: | MissingTranslations.png added |
---|
comment:1 by , 5 years ago
Component: | Kits → Kits/Interface Kit |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 5 years ago
It looks like the rule is defined in src/kits/Jamfile:
DoCatalogs libbe.so : x-vnd.Haiku-libbe : AboutMenuItem.cpp AboutWindow.cpp ColorControl.cpp Dragger.cpp Menu.cpp PrintJob.cpp StringForSize.cpp TextView.cpp ZombieReplicantView.cpp ;
So there is another neason why the translations are not applied.
comment:3 by , 5 years ago
The translations in libbe require special handling to load the gSystemCatalog (this can't be done like normal catalogs, however I don't remember exactly why). This is normally called from src/kits/app/InitTerminateLibBe.cpp, is that method still called at the right time?
Since when is this broken?
comment:4 by , 5 years ago
I'm not sure if it was worked ever. :/ I checked the images in the documentation (unfortunatelly I have no time to update all images) and on "old" image, for example the Backgrounds the ColorControl was not translated. This is the same for the replicant's menu.
comment:5 by , 5 years ago
I'm sure it worked when I wrote this code, but that was 10 years ago. And I admit I didn't keep a close look on it, being mostly bilingual now I don't even notice what's French and what's English :/
comment:6 by , 5 years ago
How it is supposed to work is like this:
- initialize_after() calls https://git.haiku-os.org/haiku/tree/src/kits/locale/InitLocaleKit.cpp#n116 call initialize_locale_kit()
- which in turn calls MutableLocaleRoster::LoadSystemCatalog().
- it tries to find the signature of libbe.so by going through all the images and checking which one defines the be_app symbol.
I will add by putting some debugging to see whether this function is successful. Without being an expert, my hunch is that this way of matching a symbol's address to one in the elf binary might not work because of Position Independent Code (pic).
comment:7 by , 5 years ago
PIC is not a problem here. The library may be loaded at a different place every time, but we still know which library is where. In fact, all other catalog strings also use this to find the place B_TRANSLATE is called from, except they use the "locale stub" which generates a symbol of its own instead of using be_app or some other generic symbol.
I would think that there is a problem in the init sequence. Either this code is called too early and other parts of libroot/libbe aren't ready yet, or maybe it isn't called at all.
comment:8 by , 5 years ago
I can confirm that the initialization code is goes through the steps, and indeed loads a catalog. Next up would be to identify what actually loads.
follow-up: 10 comment:9 by , 5 years ago
I cannot find related catalogs in the /boot/system/data/locale/catalogs folder. Maybe the translation files are only missing from the Haiku image?
comment:10 by , 5 years ago
Replying to dsjonny:
I cannot find related catalogs in the /boot/system/data/locale/catalogs folder. Maybe the translation files are only missing from the Haiku image?
I think you're on to something here, they are in the source tree (under data/catalogs/kits) but they do not seem to be compiled and added to the image.
comment:11 by , 5 years ago
That's strange, the DoCatalogs rule seems properly invoked in src/kits/Jamfile for libbe. But indeed the catalogs are not in generated/objects/catalogs/kits.
But I ran "jam -q catalogs" and they were generated, and I'd have thought that is the target that the build depends on to generate them.
comment:12 by , 5 years ago
Milestone: | Unscheduled → R1/beta2 |
---|---|
Priority: | normal → high |
Looks like there is no DoCatalogs rule in src/kits/interface/Jamfile