#*********************************************************************** #* Rwd/Tinker -- A Ruby program for the RudyWebDialog. #* Copyright (c) 2004, 2005 by Steven Gibson. All Rights Reserved. #* #* This library is free software; you can redistribute it and/or #* modify it under the terms of the GNU General Public #* License as published by the Free Software Foundation; either #* . #* #* These files are distributed in the hope that they will be useful, #* but WITHOUT ANY WARRANTY; without even the implied warranty of #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #* General Public License for more details. #* #* You should have received a copy of the GNU General Public #* License along with these files; if not, write to the Free Software #* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #* #* For further information please contact the author by e-mail #* at "smalllinux@gmail.com". #***********************************************************************/ def runlocalechangercommand $rwdtinkerlog.info "preparing to restart gui" $lang = @a_localechooseinput # pick the language of choice tempdoc = " " Dir.chdir($progdir) # change back to top program directory # build the English Language hash file from the parts require 'lib/rwdtinker/rwdlangdir' tempdoc = " " #go get all the po language file files in english tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,"en") #writes the contents of doc into the languagehashvariable languagehashvariable = tempdoc # END of en Lang building tempdoc = " " Dir.chdir($progdir) # change back to top program directory # build the local Language hash file from the parts # Go get all the po files for the language of choice tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,$lang) # the contents of doc into the variable languagehashvariable = languagehashvariable + tempdoc Dir.chdir($progdir) # change back to top program directory # lets read those po files, first english then the chosen language temp = eval( languagehashvariable ) # build the actual GUI from the gui parts require 'lib/rwdtinker/rwdguidir' tempdoc = RwdtinkerTools.findguifiles(GuiDir) # gui variable is done guiRWD = "" $rwd_gui_tinker = tempdoc $rwdtinkerlog.info "restarting gui now" RWDWindow.new($rwd_gui_tinker, @rwd_window).render("DEFAULT") end