Opened 9 years ago

Closed 9 years ago

#6058 closed enhancement (fixed)

Localization of filepanel, part I

Reported by: Karvjorm Owned by: pulkomandy
Priority: normal Milestone: R1
Component: - General Version: R1/alpha2
Keywords: filepanel localization Cc: Karvjorm
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

Here is a patch for localization of src/bin/filepanel.cpp

I have done some changes:

- moved source code to filepanel subdirectory and created a Jam file for it.
- edited src/bin/Jamfile to find a new subdirectory and to include liblocale.so
- edited also filepanel --help texts by adding some  tabs. Command line texts are localized in many linux applications and developers have no problems to understand foreign text because options are still in English. :)

I was able to build new filepanel and when I tested it by the command ../../../generated/objects/haiku/x86/release/bin/filepanel, it worked fine. But when I tried to test command line options (../../../generated/objects/haiku/x86/release/bin/filepanel --help or ../../../generated/objects/haiku/x86/release/bin/filepanel -h), application crashed always when it tried to read /boot/system/lib/liblocale.so and not that library I had defined in src/bin/filepanel/lib or src/bin/lib directory.

I suppose, that something is still missing in my Jamfiles.

Because files in filepanel subdirectory are not in version control, I will enclose them here with the src/bin patch.

This is only part I of the filepanel localization, because private part is not localized yet. I will try it next.

Attachments (3)

filepanel.cpp (6.9 KB ) - added by Karvjorm 9 years ago.
Localized filepanel.cpp
Jamfile (226 bytes ) - added by Karvjorm 9 years ago.
A new Jamfile for src/bin/filepanel directory
filepanelLocalization.patch (8.3 KB ) - added by Karvjorm 9 years ago.
An updated filepanelLocalization.patch

Download all attachments as: .zip

Change History (13)

by Karvjorm, 9 years ago

Attachment: filepanel.cpp added

Localized filepanel.cpp

by Karvjorm, 9 years ago

Attachment: Jamfile added

A new Jamfile for src/bin/filepanel directory

comment:1 by Karvjorm, 9 years ago

Actually, Part II is not needed. It is already in ticket #5889 (http://dev.haiku-os.org/ticket/5889)

comment:2 by stippi, 9 years ago

Has a Patch: set

comment:3 by pulkomandy, 9 years ago

Owner: changed from nobody to pulkomandy
Status: newassigned

comment:4 by pulkomandy, 9 years ago

Moving the file to a new directory is not needed ; and it means I can't easily see what changed in filepanel.cpp for patch review.

As for translating command line stuff, it's fine for the help text, the idea is to not translate important messages that could be used in some scripts to isolate parts of the data. Such scripts may get lost if the text changes too much, and there is no way to work around it right now (on linux it is always possible to force the C locale for running an app, for example).

Could you provide a patch that doesn't move the file around ?

in reply to:  4 comment:5 by Karvjorm, 9 years ago

Replying to pulkomandy:

Moving the file to a new directory is not needed ; and it means I can't easily see what changed in filepanel.cpp for patch review.

As for translating command line stuff, it's fine for the help text, the idea is to not translate important messages that could be used in some scripts to isolate parts of the data. Such scripts may get lost if the text changes too much, and there is no way to work around it right now (on linux it is always possible to force the C locale for running an app, for example).

Could you provide a patch that doesn't move the file around ?

OK, I'll try to do this tomorrow.

comment:6 by Karvjorm, 9 years ago

Sorry, I'm not able to build filepanel application. I upgraded to revision 37340-x86gcc2 (VMware) and some reason src/bin/badblocks, src/bin/dstcheck and src/bin/filepanel are broken. I deleted src source code and all headers and made svn update and ./configure --target=haiku, but still I have this kind of problems.

comment:7 by Karvjorm, 9 years ago

Badblocks error message:

...found 25346 target(s)...
...updating 2167 target(s)...
...can't find 1 target(s)...
...can't make 22 target(s)...
Cc ../../generated/objects/haiku/x86/release/bin/badblocks.o 
/Blank_BFS/haiku/src/bin/badblocks.c:13: initializer element is not constant
/Blank_BFS/haiku/src/bin/badblocks.c:16: warning: no previous prototype for `scan_device'
/Blank_BFS/haiku/src/bin/badblocks.c: In function `scan_device':
/Blank_BFS/haiku/src/bin/badblocks.c:24: warning: implicit declaration of function `malloc'
/Blank_BFS/haiku/src/bin/badblocks.c:48: warning: comparison between signed and unsigned
/Blank_BFS/haiku/src/bin/badblocks.c:53: warning: int format, long int arg (arg 6)
/Blank_BFS/haiku/src/bin/badblocks.c:57: warning: implicit declaration of function `strerror'
/Blank_BFS/haiku/src/bin/badblocks.c:57: warning: format argument is not a pointer (arg 4)
/Blank_BFS/haiku/src/bin/badblocks.c:72: warning: format argument is not a pointer (arg 4)
/Blank_BFS/haiku/src/bin/badblocks.c:74: warning: unknown conversion type character `b' in format
/Blank_BFS/haiku/src/bin/badblocks.c:74: warning: too many arguments for format
/Blank_BFS/haiku/src/bin/badblocks.c:81: warning: implicit declaration of function `free'
/Blank_BFS/haiku/src/bin/badblocks.c:85: warning: label `err2' defined but not used
/Blank_BFS/haiku/src/bin/badblocks.c: At top level:
/Blank_BFS/haiku/src/bin/badblocks.c:92: warning: no previous prototype for `usage'
/Blank_BFS/haiku/src/bin/badblocks.c: In function `main':
/Blank_BFS/haiku/src/bin/badblocks.c:102: `INT64_MAX' undeclared (first use in this function)
/Blank_BFS/haiku/src/bin/badblocks.c:102: (Each undeclared identifier is reported only once
/Blank_BFS/haiku/src/bin/badblocks.c:102: for each function it appears in.)
/Blank_BFS/haiku/src/bin/badblocks.c:109: warning: implicit declaration of function `atoi'
/Blank_BFS/haiku/src/bin/badblocks.c:133: warning: implicit declaration of function `atoll'

And after commenting out badblocks.c from Jamfile I was able to build up to dstcheck:

Link ../../generated/objects/haiku/x86/release/bin/dstcheck 
../../generated/objects/haiku/x86/release/bin/dstcheck.o: In function `TimedAlert::GetLabel(BString &)':
dstcheck.cpp:(.text+0x2a1): undefined reference to `BCatalogStub::GetCatalog(void)'
dstcheck.cpp:(.text+0x2a7): undefined reference to `BCatalog::GetString(char const *, char const *, char const *)'
dstcheck.cpp:(.text+0x2dd): undefined reference to `be_locale_roster'
dstcheck.cpp:(.text+0x2e5): undefined reference to `BLocaleRoster::GetDefaultCountry(BCountry **) const'
dstcheck.cpp:(.text+0x32c): undefined reference to `BCatalogStub::GetCatalog(void)'
dstcheck.cpp:(.text+0x332): undefined reference to `BCatalog::GetString(char const *, char const *, char const *)'
../../generated/objects/haiku/x86/release/bin/dstcheck.o: In function `main':
dstcheck.cpp:(.text+0x4f0): undefined reference to `BCatalogStub::GetCatalog(void)'
dstcheck.cpp:(.text+0x4f6): undefined reference to `BCatalog::GetString(char const *, char const *, char const *)'
dstcheck.cpp:(.text+0x50f): undefined reference to `BCatalogStub::GetCatalog(void)'
dstcheck.cpp:(.text+0x515): undefined reference to `BCatalog::GetString(char const *, char const *, char const *)'
dstcheck.cpp:(.text+0x528): undefined reference to `BCatalogStub::GetCatalog(void)'
dstcheck.cpp:(.text+0x52e): undefined reference to `BCatalog::GetString(char const *, char const *, char const *)'
dstcheck.cpp:(.text+0x5dc): undefined reference to `BCatalogStub::GetCatalog(void)'
dstcheck.cpp:(.text+0x5e2): undefined reference to `BCatalog::GetString(char const *, char const *, char const *)'
dstcheck.cpp:(.text+0x5f5): undefined reference to `BCatalogStub::GetCatalog(void)'
dstcheck.cpp:(.text+0x5fb): undefined reference to `BCatalog::GetString(char const *, char const *, char const *)'
dstcheck.cpp:(.text+0x60e): undefined reference to `BCatalogStub::GetCatalog(void)'
dstcheck.cpp:(.text+0x614): undefined reference to `BCatalog::GetString(char const *, char const *, char const *)'
collect2: ld returned 1 exit status

comment:8 by anevilyak, 9 years ago

badblocks build fixed in hrev37408. Can't reproduce problems building dstcheck though, that looks like liblocalestub is missing, but it's correctly declared in the jamfiles, and builds correctly here.

comment:9 by pulkomandy, 9 years ago

Are you sure your build of liblocale.so is up to date ? It looks like there's a problem there. Try 'jam -q liblocale.so' to see if it helps.

by Karvjorm, 9 years ago

Attachment: filepanelLocalization.patch added

An updated filepanelLocalization.patch

comment:10 by pulkomandy, 9 years ago

Resolution: fixed
Status: assignedclosed

Applied in hrev37458.

Note: See TracTickets for help on using tickets.