Opened 9 years ago

Closed 8 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:
Has a Patch: yes 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 9 years ago.
Patch is so big, so I attched zip file.
localekit.patch (3.8 KB) - added by mt 9 years ago.
localekit jamfile patch
en.catkeys (26.8 KB) - added by mt 9 years ago.
Sample catkey file.
libtracker_patch2.patch.zip (113.3 KB) - added by mt 9 years ago.
en.2.catkeys (19.9 KB) - added by mt 9 years ago.
Sample catkey file
single.patch.zip (114.0 KB) - added by mt 9 years ago.
libtracker + localekit patch
opentargetfolderLocalization.patch (2.2 KB) - added by Karvjorm 9 years ago.
Un updated opentargetfolder localization patch
tracker.patch (181.9 KB) - added by mt 9 years ago.
PoseView.patch (8.2 KB) - added by mt 9 years ago.
More PoseView Localization.
FindItem.patch (1.1 KB) - added by mt 9 years ago.
Replace some FindItem() parameter from translated names to command.
tracker.2.patch (25.5 KB) - added by mt 9 years ago.
Apply BLayout to TrackerSettingsWindow.
tracker.3.patch (18.2 KB) - added by mt 9 years ago.
TrackerSettingsWindow patch updated to hrev37977

Download all attachments as: .zip

Change History (52)

Changed 9 years ago by mt

Attachment: libtracker.patch.zip added

Patch is so big, so I attched zip file.

Changed 9 years ago by mt

Attachment: localekit.patch added

localekit jamfile patch

Changed 9 years ago by mt

Attachment: en.catkeys added

Sample catkey file.

comment:1 Changed 9 years ago by anevilyak

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 Changed 9 years ago by koki

Cc: koki added

comment:3 Changed 9 years ago by mt

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 Changed 9 years ago by aldeck

Owner: changed from stippi to aldeck

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

Changed 9 years ago by mt

Attachment: libtracker_patch2.patch.zip added

Changed 9 years ago by mt

Attachment: en.2.catkeys added

Sample catkey file

comment:5 Changed 9 years ago by nielx

Has a Patch: set

comment:6 Changed 9 years ago by aldeck

Status: assignedin-progress

comment:7 Changed 9 years ago by stippi

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

comment:8 Changed 9 years ago by aldeck

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 in reply to:  8 Changed 9 years ago by mt

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

Changed 9 years ago by mt

Attachment: single.patch.zip added

libtracker + localekit patch

comment:10 Changed 9 years ago by Karvjorm

Ticket #6058 (http://dev.haiku-os.org/ticket/6058) completes this patch by adding localization of src/bin/filepanel to the same filepanel.

Changed 9 years ago by Karvjorm

Un updated opentargetfolder localization patch

comment:11 Changed 9 years ago by zooey

Blocked By: 6113 added

comment:12 Changed 9 years ago by aldeck

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 Changed 9 years ago by pulkomandy

#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 Changed 9 years ago by aldeck

@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 Changed 9 years ago by mt

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 ?

Changed 9 years ago by mt

Attachment: tracker.patch added

comment:16 Changed 9 years ago by mt

Sorry, BFilepanel is OK.

comment:17 Changed 9 years ago by aldeck

Status: assignedin-progress

Changed 9 years ago by mt

Attachment: PoseView.patch added

More PoseView Localization.

comment:18 Changed 9 years ago by aldeck

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

comment:19 Changed 9 years ago by aldeck

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 Changed 9 years ago by aldeck

@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 Changed 9 years ago by mt

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

Changed 9 years ago by mt

Attachment: FindItem.patch added

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

Changed 9 years ago by mt

Attachment: tracker.2.patch added

Apply BLayout to TrackerSettingsWindow.

comment:22 Changed 9 years ago by aldeck

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 Changed 9 years ago by aldeck

@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 Changed 9 years ago by mt

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

Changed 9 years ago by mt

Attachment: tracker.3.patch added

TrackerSettingsWindow patch updated to hrev37977

comment:25 Changed 9 years ago by aldeck

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

comment:26 Changed 9 years ago by diver

See also #6374.

comment:27 Changed 9 years ago by diver

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 Changed 9 years ago by mt

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 Changed 9 years ago by diver

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 in reply to:  27 Changed 9 years ago by aldeck

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 Changed 9 years ago by aldeck

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 Changed 9 years ago by diver

Thanks. Will this break existing tracker translations?

comment:33 Changed 9 years ago by aldeck

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

comment:34 Changed 9 years ago by diver

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 Changed 9 years ago by diver

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 Changed 9 years ago by mt

I think the GUI should be translatable as possible. Some language may use these expressions, and some language may not use it.

comment:37 Changed 9 years ago by diver

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 Changed 9 years ago by diver

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

comment:39 Changed 8 years ago by deejam

What's the status of this ticket?

comment:40 Changed 8 years ago by pulkomandy

Resolution: fixed
Status: in-progressclosed

Seems done...

Note: See TracTickets for help on using tickets.