Opened 15 years ago
Closed 13 years ago
#5889 closed enhancement (fixed)
[Patch] Tracker localization
Reported by: | mt | Owned by: | aldeck |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Kits/libtracker.so | Version: | R1/alpha1 |
Keywords: | tracker localize | Cc: | |
Blocked By: | #6113 | Blocking: | |
Platform: | All |
Description
Tracker localizing, more test and code review needed.
- Localize GUI strings only, BLayout is not applyed.
- Some coding style fix.
ISSUE:
- BFilePanel can't be applyed BLayout because some application customize it.
- Tracker goes to debugger when restart / shutdown. (in ~BCatlog ?)
TODO:
- Apply BLayout (FindWindow, InfoWindow, OpenWithWindow, StatusWindow, TrackerSettingsWindow etc.)
- Adjust width of CountView for localized strings.
- Adjust width of Columns in PoseView for localized strings.
- Localize file created / modified date.
Attachments (12)
Change History (52)
by , 15 years ago
Attachment: | libtracker.patch.zip added |
---|
comment:1 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Reassigning to stippi for review since my experience with the Locale Kit is currently near nonexistent, and I'm somewhat swamped at work at the moment.
comment:2 by , 15 years ago
Cc: | added |
---|
comment:3 by , 15 years ago
Second patch, No BLayout change.
- Change TR() macro to B_TRANSLATE()
- Unify B_TRANSLATE_CONTEXT to "libTracker" to reduce catkey file.
- Change bs_printf() to BString::ReplaceFirst()
(from Michael Pfeiffer's suggestion http://www.freelists.org/post/haiku-development/Patch-reviews-help-needed,12)
comment:4 by , 15 years ago
Owner: | changed from | to
---|
Thanks a lot, i will try to apply it during the weekend.
by , 15 years ago
Attachment: | libtracker_patch2.patch.zip added |
---|
comment:5 by , 15 years ago
patch: | → 1 |
---|
comment:6 by , 15 years ago
Status: | assigned → in-progress |
---|
follow-up: 9 comment:8 by , 15 years ago
If only i knew how it's supposed to work :-} The patch applied cleanly, but all the string show up empty and it crashes on accessing those when opening a menu. So i guess i'm missing something. Maybe a simple build issue. Another problem for me is that i've no similar example of localizing a lib (libtracker here). From what i understand it's using the same technique introduced recently for libbe and BColorControl localization, but the commit messages refers to a different concern. Also it looks strange to me, will we have to rebuild locale kit each time Tracker's strings change?
regards
@mt: if possible provide a single patch file relative to the haiku source root dir:
svn diff src/kits/tracker src/kits/locale
comment:9 by , 15 years ago
Replying to aldeck:
Thanks aldeck for applying patch.
If only i knew how it's supposed to work :-} The patch applied cleanly, but all the string show up empty and it crashes on accessing those when opening a menu. So i guess i'm missing something.
I think catalog files in /boot/system/data/locale/catalogs/system need to update.
@mt: if possible provide a single patch file relative to the haiku source root dir:
svn diff src/kits/tracker src/kits/locale
I will add single.patch.zip
comment:10 by , 15 years ago
Ticket #6058 (http://dev.haiku-os.org/ticket/6058) completes this patch by adding localization of src/bin/filepanel to the same filepanel.
by , 15 years ago
Attachment: | opentargetfolderLocalization.patch added |
---|
Un updated opentargetfolder localization patch
comment:11 by , 14 years ago
Blocked By: | 6113 added |
---|
comment:12 by , 14 years ago
Status: | in-progress → assigned |
---|
@mt: Oliver Tappe (zooey) just explained a few things to me, and the "gLocaleBackend technique" is just a solution to a circular dependency problem specific to libbe. A proper way to localize libraries and let them have their own catalog will be developed (soon hopefully). cf #6113. You'll then be able to localize strings in libtracker.so just like any other app.
I'll keep an eye on this, though for now i'm removing the in-progress status until #6113 is implemented. Regards :)
comment:13 by , 14 years ago
#6113 done. You can get rid of instanciating the catalog yourself ; basically the macros will take care of everything.
You just have to make sure the lib has a mimetype, as that's still what we use for identifying the catalog.
comment:14 by , 14 years ago
@mt: Since #6113 has been implemented would you like to update your patch? Also if possible can you put the unrelated style fixes in a separate patch (don't worry, i understand it might be too late :-) This way it's easier to review. Thanks!
comment:15 by , 14 years ago
Hi, I updated patch, please review and test.
- Apply new locale macros.
- Remove style change to reduce patch size.
- No BLayout change.
Problem:
- BFilepanel seems not localized.
- libTracker's signature "application/x-vnd.Haiku-libTracker" is ok ?
by , 14 years ago
Attachment: | tracker.patch added |
---|
comment:17 by , 14 years ago
Status: | assigned → in-progress |
---|
comment:18 by , 14 years ago
comment:19 by , 14 years ago
PoseView.patch applied in hrev37494.
Concerning the tracker.patch, be sure to svn update your working copy if you have yet more patches coming as your working copy must differ quite a bit now. I could have asked you to modify it on your side, but i didn't anticipate the amount of work and i also didn't want to discourage you :)
comment:20 by , 14 years ago
@mt: As part of #4996, i've started converting ContainerWindow and PoseView (and derivates) to the layout kit. Are you interested / have you started working on it already? You could do for example InfoWindow, StatusWindow, TrackerSettingsWindow.
comment:21 by , 14 years ago
Aldeck, I have not started BLayout part yet. I will start from TrackerSettingsWindow.
by , 14 years ago
Attachment: | FindItem.patch added |
---|
Replace some FindItem() parameter from translated names to command.
comment:22 by , 14 years ago
Thanks mt, i'll have a look as soon as possible. To keep you (and others) informed, i've been working fulltime on a clean BLayout conversion of PoseView and ContainerWindow, the changes are massive and i can't step back nor make incremental commits, i hope to have something in svn by the end of the week.
comment:23 by , 14 years ago
@mt: Hi, i wanted to apply your patches but there are two problems. First, after applying the first patch, i noticed that your second patch also includes the changes from the first (misleading description). Secondly, i'm sorry but unfortunately another dev made changes to TrackerSettings (localized dates) and the patch doesn't apply cleanly anymore. Would you like to update your patch? Best regards.
FindItem.patch has been commited in hrev37974
comment:24 by , 14 years ago
Hi Aldeck, I updated patch to hrev37977, please review. (I'm on vacation 8/9 - 8/15)
by , 14 years ago
Attachment: | tracker.3.patch added |
---|
TrackerSettingsWindow patch updated to hrev37977
comment:25 by , 14 years ago
Applied in hrev37978. Thanks for your work and the quick answer, have a nice vacation :-)
follow-up: 30 comment:27 by , 14 years ago
BTW, is there any reason why B_TRANSLATE_CONTEXT is "libtracker" everywhere? See hrev37492.
There are several identical strings (e.g. All disks) and sometimes it's hard to distinguish between them in the same context.
comment:28 by , 14 years ago
Hi, diver, thanks to pointing out. It was changed to simply reduce the size of catkeys. (Please see the http://dev.haiku-os.org/ticket/5889#comment:3.) If you have any problems when translating catkeys, please let me know.
comment:29 by , 14 years ago
For example see http://hta.polytect.org/catalogs/view/75/en, it's not that obvious from context where specific string would be in the GUI.
comment:30 by , 14 years ago
Replying to diver:
BTW, is there any reason why B_TRANSLATE_CONTEXT is "libtracker" everywhere?
No, this has been overlooked. Working on it.
comment:31 by , 14 years ago
Done in hrev38691. I named the context after the cpp file names as it sounds practical to me, feel free to convince me otherwise. (in some cases i'd prefer renaming the cpp files instead :)
comment:34 by , 14 years ago
A tiny issue: there is an extra space in "The mount server could not be-> <-contacted." See http://dev.haiku-os.org/browser/haiku/trunk/src/kits/tracker/AutoMounterSettings.cpp?rev=37492#L338
comment:35 by , 14 years ago
Are there any reasons in translating those strings:
ContainerWindow.cpp: item = new BMenuItem(B_TRANSLATE("32 x 32"), message); ContainerWindow.cpp: item = new BMenuItem(B_TRANSLATE("40 x 40"), message); ContainerWindow.cpp: item = new BMenuItem(B_TRANSLATE("48 x 48"), message); ContainerWindow.cpp: item = new BMenuItem(B_TRANSLATE("64 x 64"), message); DeskWindow.cpp: BMenuItem* item = new BMenuItem(B_TRANSLATE("32 x 32"), message); DeskWindow.cpp: item = new BMenuItem(B_TRANSLATE("40 x 40"), message); DeskWindow.cpp: item = new BMenuItem(B_TRANSLATE("48 x 48"), message); DeskWindow.cpp: item = new BMenuItem(B_TRANSLATE("64 x 64"), message);
comment:36 by , 14 years ago
I think the GUI should be translatable as possible. Some language may use these expressions, and some language may not use it.
comment:37 by , 14 years ago
Is it possible to somehow distinguish between those strings in .catkeys file?
Maybe additional B_TRANSLATE_CONTEXT is needed here?
FindPanel.cpp:2390: B_TRANSLATE_MARK("is not"), FindPanel.cpp:2713: submenu->AddItem(new BMenuItem(B_TRANSLATE("is not"), message));
Patch is so big, so I attched zip file.