Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3245 > unrolled thread

Switching languages in Sw

Started by"David =?UTF-8?B?4oCYQm9tY" <david.=?utf-8?b?4ocyqm9ty@THRWHITE.remove-dii-this>
First post2011-04-27 15:43 +0000
Last post2011-04-27 15:44 +0000
Articles 6 — 4 participants

Back to article view | Back to comp.lang.java.gui


Contents

  Switching languages in Sw "David =?UTF-8?B?4oCYQm9tY" <david.=?utf-8?b?4ocyqm9ty@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
    Re: Switching languages i "CK" <ck@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
    Re: Switching languages i "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:44 +0000
      Re: Switching languages i "Karsten Lentzsch" <karsten.lentzsch@THRWHITE.remove-dii-this> - 2011-04-27 15:44 +0000
        Re: Switching languages i "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:44 +0000
    Re: Switching languages i "Karsten Lentzsch" <karsten.lentzsch@THRWHITE.remove-dii-this> - 2011-04-27 15:44 +0000

#3245 — Switching languages in Sw

From"David =?UTF-8?B?4oCYQm9tY" <david.=?utf-8?b?4ocyqm9ty@THRWHITE.remove-dii-this>
Date2011-04-27 15:43 +0000
SubjectSwitching languages in Sw
Message-ID<63fjkeF2794tnU1@mid.uni-berlin.de>
  To: comp.lang.java.gui
Hi, everyone.

I'm currently creating a program that will be translated to at least three
different languages. I want it to be possible to change languages on the
fly. So far I've been using Runnables that set the texts on all components
when the language is changed. Is that the way to go or is there something
simpler that I have missed so far?


Thanks,

        David

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#3247 — Re: Switching languages i

From"CK" <ck@THRWHITE.remove-dii-this>
Date2011-04-27 15:43 +0000
SubjectRe: Switching languages i
Message-ID<p9f5t3tck21mc23iptk3fqeh9skb7qkr57@4ax.com>
In reply to#3245
  To: comp.lang.java.gui
Words to the wise, David aBombeA Roden <bombe@pterodactylus.net>
wrote:

>Hi, everyone.
>
>I'm currently creating a program that will be translated to at least three
>different languages. I want it to be possible to change languages on the
>fly. So far I've been using Runnables that set the texts on all components
>when the language is changed. Is that the way to go or is there something
>simpler that I have missed so far?

You could implement a controller which just listens to whether the
language is being changed and which then iterates over all controls
and sets the corresponding string from a resource bundle depending on
the new language string. Whether that is simpler than your solution, I
cannot say.
--
Claus Dragon <clauskick@mpsahotmail.com>
=(UDIC)=
d++ e++ T-- 
K1!2!3!456!7!S a29
"Coffee is a mocker. So, I am going to mock."

- Me, lately.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#3302 — Re: Switching languages i

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 15:44 +0000
SubjectRe: Switching languages i
Message-ID<ma97u39tmqme9ous1tbcql64pmvs826jbd@4ax.com>
In reply to#3245
  To: comp.lang.java.gui
On Sat, 08 Mar 2008 14:45:44 +0100, David aBombeA Roden
<bombe@pterodactylus.net> wrote, quoted or indirectly quoted someone
who said :

>I'm currently creating a program that will be translated to at least three
>different languages. I want it to be possible to change languages on the
>fly. So far I've been using Runnables that set the texts on all components
>when the language is changed. Is that the way to go or is there something
>simpler that I have missed so far?

see http://mindprod.com/jgloss/localisation.html
-- 

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#3310 — Re: Switching languages i

From"Karsten Lentzsch" <karsten.lentzsch@THRWHITE.remove-dii-this>
Date2011-04-27 15:44 +0000
SubjectRe: Switching languages i
Message-ID<fs2kst$lct$03$2@news.t-online.com>
In reply to#3302
  To: comp.lang.java.gui
Roedy Green wrote:

> see http://mindprod.com/jgloss/localisation.html

Just a note about internationalization and localization.
These are not the same. The first is the process of
preparing a system for different locales, where the second
is the concrete work where the prepared system gets support
for a new locale.

-Karsten

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#3365 — Re: Switching languages i

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 15:44 +0000
SubjectRe: Switching languages i
Message-ID<bimov3tj51oeeuidcuhipvkmlh6a8jr38u@4ax.com>
In reply to#3310
  To: comp.lang.java.gui
On Sat, 22 Mar 2008 10:52:33 +0100, Karsten Lentzsch
<karsten@jgoodies.com> wrote, quoted or indirectly quoted someone who
said :

>> see http://mindprod.com/jgloss/localisation.html
>
>Just a note about internationalization and localization.
>These are not the same. The first is the process of
>preparing a system for different locales, where the second
>is the concrete work where the prepared system gets support
>for a new locale.

Thanks. I have added that observation to the entry.
-- 

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#3309 — Re: Switching languages i

From"Karsten Lentzsch" <karsten.lentzsch@THRWHITE.remove-dii-this>
Date2011-04-27 15:44 +0000
SubjectRe: Switching languages i
Message-ID<fs2kos$lct$03$1@news.t-online.com>
In reply to#3245
  To: comp.lang.java.gui
David aBombeA Roden wrote:

> I'm currently creating a program that will be translated to at least three
> different languages. I want it to be possible to change languages on the
> fly. So far I've been using Runnables that set the texts on all components
> when the language is changed. Is that the way to go or is there something
> simpler that I have missed so far?

You don't necessarily need Runnables. You can change
localized texts in the Event-Dispatch-Thread.

A workable approach is to have custom components,
for example an on-the-fly-label that stores a key
for the text lookup, listens to a custom property
that notifies the component when the Locale has changed.
On Locale change, the component can update its text
by re-reading the resource for its key.

Note that Locale has no bound property that can be
observed for that case. So a common approach is to
set a new Locale and then fire a change in a custom
(bean) property somewhere.

-Karsten

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web