Opened 13 years ago
Closed 12 years ago
#7873 closed bug (fixed)
B_TRANSLATE("String") between #ifdef and #endif not included in catalogs
Reported by: | taos | Owned by: | zooey |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | - General | Version: | R1/Development |
Keywords: | localization, HTA | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
Strings that are prepared for translation by using the translation macros (e.g. B_TRANSLATTE("String")) don't appear on HTA if they are part of #if USE_SSL ... #endif statements.
Example (/src/add-ons/mail_daemon/outbound_protocols/smtp/ConfigView.cpp):
{ #ifdef USE_SSL AddFlavor(B_TRANSLATE("Unencrypted")); AddFlavor(B_TRANSLATE("SSL")); AddFlavor(B_TRANSLATE("STARTTLS")); #endif AddAuthMethod(B_TRANSLATE("None"), false); AddAuthMethod(B_TRANSLATE("ESMTP")); AddAuthMethod(B_TRANSLATE("POP3 before SMTP"), false); [...] }
"None", "ESMTP", and "POP3 before SMTP" are included in the respective catalog files (e.g. sk.catkeys) whereas "Unencrypted", "SSL", and "STARTTLS" are missing from HTA.
Attachments (1)
Change History (12)
comment:1 by , 13 years ago
Summary: | B_TRANSLATE("String") between #if USE_SSL and #endif not included in catalogs → B_TRANSLATE("String") between #ifdef and #endif not included in catalogs |
---|
by , 13 years ago
Attachment: | BeMenu.png added |
---|
comment:2 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
The solution is likely to use B_TRANSLATE_MARK outside the ifdef to mark the strings anyway (so collectcatkeys can find them).
comment:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:5 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:6 by , 12 years ago
BCatalog shouldn't be involved. The problem may be hat B_TRANSLATE_MARK macro doesn't work anymore, or maybe the preprocessor optimizing it away somehow.
The problem is http://cgit.haiku-os.org/haiku/commit/?id=541ff51a6ef4c47f8ab105ba6ff895cdbba83aca , the B_TRANSLATE macros changed meaning and this part of the code was not adjusted.
Are there other places besides Mail add-on SSL and BeMenu ?
comment:7 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Well, fixeed these two in hrev44205. Tell us if you see more.
comment:8 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Thanks for cleaning up after me.
However, I think the fix indicates that switching back to using B_COLLECTING_CATKEYS when collecting the catalog keys is a good idea. With that macro, it wouldn't be necessary to give each string twice (once for marking and once for creating the menu item).
Reopening and taking the ticket, so I won't forget ...
comment:9 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | reopened → assigned |
comment:10 by , 12 years ago
Well, actually it's possible to revert to the scheme used before introduction of B_COLLECTING_CATKEYS :
static const char* kSomeString = B_TRANSLATE_MARK("Some String"); #ifdef FOO // ... new BMenuItem(B_TRANSLATE_NOCOLLECT(kSomeString)); // ... #endif
The problem with this is the string could end up in the binary (didn't check if it actually happens)
So yes, having B_COLLECTING_CATKEYS around might still be helpful. It could be added in the jam rule as a preprocessor option, if we don't want it in an header.
comment:11 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in hrev44546, B_COLLECTING_CATKEYS is now back again.
More examples can be found in /src/apps/deskbar/BeMenu.cpp:
From HTA (and thus from corresponding catkeys and catalog files), "About Haiku" and "Suspend" are missing. If building an image with --distro-compatibility official you'll get a Be Menu entry that's not translated: