Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Switching 2 languages in a guide
Date: Thu, 12 Mar 2009 13:06:39 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <gpb1cv$gcu$1@fred.mathworks.com>
References: <gpareg$dve$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1236863199 16798 172.30.248.35 (12 Mar 2009 13:06:39 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 12 Mar 2009 13:06:39 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1747939
Xref: news.mathworks.com comp.soft-sys.matlab:524308


"MRR" <mario_ruz@hotmail.com> wrote in message <gpareg$dve$1@fred.mathworks.com>...
> Hi everybody,
> 
> Is it possible to switch two languages in a guide? I know the easiest way would be to have two different guides, and execute one of them. But what i want to do is to have a menu in which you select the language, and then the guide changes  automatically all the strings displayed (all the uicontrols change its strings). Any suggestion?
> 
> Kind regards,
> 
> Mario

Why not contain all the strings you use (labels, lists, text etc.) within two cell arrays where each cell correponds to one label in the GUI and all GUI commands for text reference to that cell array location. Then set your language UIcontrol callback to switch which cell array you pass to the gui and redraw it?

Hope this work - it could get complicated but it is the most elegant solution I can think of off the top of my head - also easily extensible to multiple languages.