Opened 2 years ago

Last modified 5 weeks ago

#14150 new bug

Finnish catalog clears default language

Reported by: humdinger Owned by: pulkomandy
Priority: normal Milestone: Unscheduled
Component: Kits/Locale Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All


This is hrev51932 (32bit).

As originally reported in the Tipster bugtracker.

Janus found out that if you have an application that has a Finnish localisation, the default English locale is ignored and the next fallback locale is used. For example:

  • Open Locale prefs, choose 1st language "English", 2nd "Deutsch"
  • Start Tipster

Behold: The tips are English as expected, but the GUI (menus) is "Deutsch" instead of English.

As this does not happen with bundled apps like StyledEdit, does using "make bindcatalogs" have something to do with it?

Change History (5)

comment:1 by pulkomandy, 2 years ago

I don't remember what "make bindcatalogs" does. Does it just generate the catkeys, or also embed them in the executable? In the latter case, we should have a look at the embedded resources and check for anything unexpected.

It may be a bug in the way we load catalogs from resources, too.

comment:2 by humdinger, 2 years ago

"make catkeys" generates the en.catkeys, "make bindcatalogs" embeds the catkeys as resources in the executable.
See the the makefile-engine:
for lc in $(LOCALES); do linkcatkeys -o $(TARGET) -s $(APP_MIME_SIG) -tr -l $$lc $(CATKEYS_DIR)/$$lc.catkeys; done

I had a look at Tipster with QuickRes, but don't see anything special with the "fi" resource.

comment:3 by pulkomandy, 2 years ago

Ok, there is probably a problem in the way we try to search for catalogs in resources after not finding an external .catalog file.

comment:4 by irtusb, 15 months ago

as it is a shell script i think is has to do with the fi keyword that marks the end of an if conditional declaration

comment:5 by fatigatti, 5 weeks ago

I took a look at this. What I've found:

1) The locale order is always detected correctly. As long as you have the corresponding .catalog file in the app folder, under the right hierarchy, localization will work as expected.

2) Problem arises when the following conditions are met:

A) Finnish localization is included as a resource. It appears to overwrite the english catalog. B) The english catalog is not present as a separate .catalog file. If you have the file, it will work. C) You have English selected as your first language and at least one other supported language. If the language you have selected is not supported by the application, it will fall back to the strings as they are written in the code (or the default catalog generated from them?), which is English, 99% of the time, so you don't notice.

The previous comment made a lot of sense to me, so I manually linked the catkeys one by one using linkcatkeys. Same result, but I've discovered that if you regenerate the English catalog after you've done the Finnish, everything comes back to normality... for English. Finnish doesn't work anymore. Actually, it behaves exactly as English previously, but in this case, you don't have the original strings from the code to fall back to, and you notice inmediately.

So what seems to be happening is that the English and Finnish catalogs are somehow overlapping into the resources (as said before, everything works fine with .catalog files). Basically, the last one you generate works, the other doesn't. I took a look at linkcatkeys code, which in turn calls WriteToResources function from DefaultCatalog class, but I'm clueless from here.

I'm running 64-bit, can someone on 32-bit take a look at Tipster's english catalog on the resources using QuickRes?

Note: See TracTickets for help on using tickets.