i18n -- why not Locales & Bundles?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

i18n -- why not Locales & Bundles?

Jonathan Bennett
Can anyone tell me why JOSM uses the xnap tools for i18n rather than the
standard Java approach of Locales and StringBundles?

My primary reason for asking is that I can't get JOSM to build under
NetBeans -- the latest version of the xnap-commons library lacks the
translation functions used.

I'm willing to start hacking at the code to eliminate this dependency,
but I want to check it won't be wasted effort first...


--
Jonathan (Jonobennett)

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: i18n -- why not Locales & Bundles?

Frederik Ramm
Hi,

I don't know why we're using what we're using; maybe a design decision
by Imi. Anyway whatever reasons were valid then must not necessarily be
valid now.

> My primary reason for asking is that I can't get JOSM to build under
> NetBeans -- the latest version of the xnap-commons library lacks the
> translation functions used.

I believe Petr Nejedly has successfully run JOSM with NetBeans.

> I'm willing to start hacking at the code to eliminate this dependency,
> but I want to check it won't be wasted effort first...

I'm not into i18n that much but if the change you are proposing would
mean that every single class that contains a "tr(...)" or "marktr(...)"
will have to be changed, then I'd like to have a code example beforehand
which also explains how language plugins will work under the new scheme,
and how the work of translators will change.

We have a working system which programmers, translators and users have
grown used to. Replacing that with something else will almost certainly
mean inconvenience for them; so that "something else" must bring solid
benefits to be worth it.

Bye
Frederik


_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: i18n -- why not Locales & Bundles?

Petr Nejedly
Frederik Ramm napsal(a):
> Hi,
>
> I don't know why we're using what we're using; maybe a design decision
> by Imi. Anyway whatever reasons were valid then must not necessarily be
> valid now.
>
>> My primary reason for asking is that I can't get JOSM to build under
>> NetBeans -- the latest version of the xnap-commons library lacks the
>> translation functions used.

You should use the lib/gettext-commons-0.9.jar that is part of the checkout.

> I believe Petr Nejedly has successfully run JOSM with NetBeans.

You can use the following (maybe slightly outdated) patch to turn your JOSM
checkout into a NetBeans project:
http://shell.sh.cvut.cz/~nenik/josm-build.patch


--
Petr "Nenik" Nejedly, NetBeans/Sun Microsystems, http://www.netbeans.org
355/113 -- Not the famous irrational number PI, but an incredible simulation!

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: i18n -- why not Locales & Bundles?

Ulf Lamping
In reply to this post by Frederik Ramm
Hi!

As a slightly related side note:

The current i18n uses the GNU tools which just fails miserably under MS
Windows and SUN JAVA to compile the translation plugins.

I spend some effort months ago to get the build of the language plugins
running under Windows and SUN JAVA, but the GNU tools simply doesn't
support this combination (at least at the time I tried it). IIRC, there
was a strange problem with temporary files.

This effectively hindered me to update the german translation plugin for
JOSM and still hinders me to build the i18n plugins under MS Windows at
all ...

So while the current toolchain is "well established" it also has it's
problems.

Regards, ULFL

P.S: I never did any i18n on JAVA, so this might also be tricky ;-)


Frederik Ramm schrieb:

> Hi,
>
> I don't know why we're using what we're using; maybe a design decision
> by Imi. Anyway whatever reasons were valid then must not necessarily be
> valid now.
>
>> My primary reason for asking is that I can't get JOSM to build under
>> NetBeans -- the latest version of the xnap-commons library lacks the
>> translation functions used.
>
> I believe Petr Nejedly has successfully run JOSM with NetBeans.
>
>> I'm willing to start hacking at the code to eliminate this dependency,
>> but I want to check it won't be wasted effort first...
>
> I'm not into i18n that much but if the change you are proposing would
> mean that every single class that contains a "tr(...)" or "marktr(...)"
> will have to be changed, then I'd like to have a code example beforehand
> which also explains how language plugins will work under the new scheme,
> and how the work of translators will change.
>
> We have a working system which programmers, translators and users have
> grown used to. Replacing that with something else will almost certainly
> mean inconvenience for them; so that "something else" must bring solid
> benefits to be worth it.
>


_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: i18n -- why not Locales & Bundles?

Dirk Stöcker
In reply to this post by Jonathan Bennett
On Tue, 5 Aug 2008, Jonathan Bennett wrote:

> Can anyone tell me why JOSM uses the xnap tools for i18n rather than the
> standard Java approach of Locales and StringBundles?
>
> My primary reason for asking is that I can't get JOSM to build under
> NetBeans -- the latest version of the xnap-commons library lacks the
> translation functions used.
>
> I'm willing to start hacking at the code to eliminate this dependency,
> but I want to check it won't be wasted effort first...

When I remember correctly, Java has no "original string" based
translation method like gettext. Also the GNU gettext toolchain cannot
applied. I did research in this area half a year ago for another project
and although powerfull, the Java internal methods disqualified for a
number of important reasons.

Ciao
--
http://www.dstoecker.eu/ (PGP key available)

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: i18n -- why not Locales & Bundles?

Dirk Stöcker
In reply to this post by Jonathan Bennett
On Tue, 5 Aug 2008, Jonathan Bennett wrote:

> Can anyone tell me why JOSM uses the xnap tools for i18n rather than the
> standard Java approach of Locales and StringBundles?
>
> My primary reason for asking is that I can't get JOSM to build under
> NetBeans -- the latest version of the xnap-commons library lacks the
> translation functions used.
>
> I'm willing to start hacking at the code to eliminate this dependency,
> but I want to check it won't be wasted effort first...

Ok. I now moved all locale deps into
src/org/openstreetmap/josm/tools/I18n.java

So if you want to change anything, you can modify this class to use
another backend.

Ciao
--
http://www.dstoecker.eu/ (PGP key available)

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/listinfo/josm-dev