Opened 14 years ago

Closed 14 years ago

#6116 closed enhancement (fixed)

A localization patch fof libbluetooth

Reported by: Karvjorm Owned by: pulkomandy
Priority: normal Milestone: R1
Component: Kits Version: R1/alpha2
Keywords: libbluetooth localization LocaleCatalog Singleton Cc: Karvjorm
Blocked By: Blocking:
Platform: All

Description

Here is a localization patch for libbluetooth. I have created a singleton class LocaleCatalog that includes public BCatalog class. TODO: For another library catalog than libbe there should be some other call than be_locale->GetAppCatalog(&fAppCatalog), I suppose.

This is a try to solve the Ticket #6113 problem: http://dev.haiku-os.org/ticket/6113

Attachments (3)

libbluetoothLocalization.patch (13.5 KB ) - added by Karvjorm 14 years ago.
A localization patch for libbluetooth
LocaleCatalog.h (666 bytes ) - added by Karvjorm 14 years ago.
A header file for the Singleton LocaleCatalog class
LocaleCatalog.cpp (1.3 KB ) - added by Karvjorm 14 years ago.
Singleton LocaleCatalog class for libbluetooth (and other libraries)

Download all attachments as: .zip

Change History (8)

by Karvjorm, 14 years ago

A localization patch for libbluetooth

comment:1 by Karvjorm, 14 years ago

patch: 01

by Karvjorm, 14 years ago

Attachment: LocaleCatalog.h added

A header file for the Singleton LocaleCatalog class

comment:3 by pulkomandy, 14 years ago

Owner: changed from nobody to pulkomandy
Status: newassigned

Hello,

  • Your patch doesn't seem to include your changes to the locale kit,
  • Don't bother too much with that, I took it into account and will design the proper API during the summer. Please wait for two weeks so I can get out of school.

by Karvjorm, 14 years ago

Attachment: LocaleCatalog.cpp added

Singleton LocaleCatalog class for libbluetooth (and other libraries)

in reply to:  3 comment:4 by Karvjorm, 14 years ago

Replying to pulkomandy:

Hello,

  • Your patch doesn't seem to include your changes to the locale kit,
  • Don't bother too much with that, I took it into account and will design the proper API during the summer. Please wait for two weeks so I can get out of school.

No, I do not the touch locale kit, don't panic. But after a slept night I realized that I made this Singleton class a bit wrong. I should have created first a super class named BLibLocaleCatalog, for example. Then I should have created a derived LocaleCatalog class from this super class for the libbluetooth library only. Then we could have one generic class for all libraries and derived library specific classes for each library. I'll try to refactor this libbluetoothLocalization patch by that way.

comment:5 by Karvjorm, 14 years ago

I am wondering if there is a better solution that a super class and a derived class for each library. I wonder, if the source message field can be used to identify the concerned library? Now source field is pointing to libbe, but could it point to other libraries? I'm just thinking how it could be tested...

comment:6 by pulkomandy, 14 years ago

Resolution: fixed
Status: assignedclosed

Applied in hrev37339.

However, you are using B_TRANSLATE_MARK and not calling B_TRANSLATE on the constants later on when they are used.

services[i] should be replaced with B_TRANSLATE(services[i]) so that the replacement of the string is actually done. B_TRANSLATE_MARK will only ensure that the strings themselves will get into the catalog file ; it will not (and cannot) replace them in the executable nor at runtime.

Note: See TracTickets for help on using tickets.