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)

libtracker.patch.zip (142.8 KB ) - added by mt 15 years ago.
Patch is so big, so I attched zip file.
localekit.patch (3.8 KB ) - added by mt 15 years ago.
localekit jamfile patch
en.catkeys (26.8 KB ) - added by mt 15 years ago.
Sample catkey file.
libtracker_patch2.patch.zip (113.3 KB ) - added by mt 15 years ago.
en.2.catkeys (19.9 KB ) - added by mt 15 years ago.
Sample catkey file
single.patch.zip (114.0 KB ) - added by mt 15 years ago.
libtracker + localekit patch
opentargetfolderLocalization.patch (2.2 KB ) - added by Karvjorm 15 years ago.
Un updated opentargetfolder localization patch
tracker.patch (181.9 KB ) - added by mt 14 years ago.
PoseView.patch (8.2 KB ) - added by mt 14 years ago.
More PoseView Localization.
FindItem.patch (1.1 KB ) - added by mt 14 years ago.
Replace some FindItem() parameter from translated names to command.
tracker.2.patch (25.5 KB ) - added by mt 14 years ago.
Apply BLayout to TrackerSettingsWindow.
tracker.3.patch (18.2 KB ) - added by mt 14 years ago.
TrackerSettingsWindow patch updated to hrev37977

Download all attachments as: .zip

Change History (52)

by mt, 15 years ago

Attachment: libtracker.patch.zip added

Patch is so big, so I attched zip file.

by mt, 15 years ago

Attachment: localekit.patch added

localekit jamfile patch

by mt, 15 years ago

Attachment: en.catkeys added

Sample catkey file.

comment:1 by anevilyak, 15 years ago

Owner: changed from anevilyak to stippi
Status: newassigned

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 koki, 15 years ago

Cc: koki added

comment:3 by mt, 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 aldeck, 15 years ago

Owner: changed from stippi to aldeck

Thanks a lot, i will try to apply it during the weekend.

by mt, 15 years ago

Attachment: libtracker_patch2.patch.zip added

by mt, 15 years ago

Attachment: en.2.catkeys added

Sample catkey file

comment:5 by nielx, 15 years ago

patch: 1

comment:6 by aldeck, 15 years ago

Status: assignedin-progress

comment:7 by stippi, 15 years ago

Awesome work, mt, and thanks aldeck for taking care of applying!

comment:8 by aldeck, 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

in reply to:  8 comment:9 by mt, 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

by mt, 15 years ago

Attachment: single.patch.zip added

libtracker + localekit patch

comment:10 by Karvjorm, 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 Karvjorm, 15 years ago

Un updated opentargetfolder localization patch

comment:11 by zooey, 14 years ago

Blocked By: 6113 added

comment:12 by aldeck, 14 years ago

Status: in-progressassigned

@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 pulkomandy, 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 aldeck, 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 mt, 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 mt, 14 years ago

Attachment: tracker.patch added

comment:16 by mt, 14 years ago

Sorry, BFilepanel is OK.

comment:17 by aldeck, 14 years ago

Status: assignedin-progress

by mt, 14 years ago

Attachment: PoseView.patch added

More PoseView Localization.

comment:18 by aldeck, 14 years ago

tracker.patch applied (with modifications) in hrev37492. Thanks a lot. See comments in hrev37492 commit message.

comment:19 by aldeck, 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 aldeck, 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 mt, 14 years ago

Aldeck, I have not started BLayout part yet. I will start from TrackerSettingsWindow.

by mt, 14 years ago

Attachment: FindItem.patch added

Replace some FindItem() parameter from translated names to command.

by mt, 14 years ago

Attachment: tracker.2.patch added

Apply BLayout to TrackerSettingsWindow.

comment:22 by aldeck, 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 aldeck, 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 mt, 14 years ago

Hi Aldeck, I updated patch to hrev37977, please review. (I'm on vacation 8/9 - 8/15)

by mt, 14 years ago

Attachment: tracker.3.patch added

TrackerSettingsWindow patch updated to hrev37977

comment:25 by aldeck, 14 years ago

Applied in hrev37978. Thanks for your work and the quick answer, have a nice vacation :-)

comment:26 by diver, 14 years ago

See also #6374.

comment:27 by diver, 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 mt, 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 diver, 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.

in reply to:  27 comment:30 by aldeck, 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 aldeck, 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:32 by diver, 14 years ago

Thanks. Will this break existing tracker translations?

comment:33 by aldeck, 14 years ago

Yes, sorry about that, though the conversion might be scriptable.

comment:34 by diver, 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 diver, 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 mt, 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 diver, 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));

comment:38 by diver, 14 years ago

mt, could you please have a look at #6437?

comment:39 by deejam, 13 years ago

What's the status of this ticket?

comment:40 by pulkomandy, 13 years ago

Resolution: fixed
Status: in-progressclosed

Seems done...

Note: See TracTickets for help on using tickets.