updated localization

This commit is contained in:
maroy 2005-01-09 11:50:03 +00:00
parent f99bc8bc40
commit b4bae27485
5 changed files with 161 additions and 54 deletions

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.7 $
Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx,v $
------------------------------------------------------------------------------*/
@ -74,19 +74,18 @@ MasterPanelWindow :: MasterPanelWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
onAirWidget.reset(new Gtk::Label("on air"));
radioLogoWidget.reset(new Gtk::Label("radio logo"));
userInfoWidget.reset(new MasterPanelUserInfoWidget(gLiveSupport, bundle));
uploadFileButton.reset(new Gtk::Button("upload file"));
djBagButton.reset(new Gtk::Button("dj bag"));
simplePlaylistMgmtButton.reset(
new Gtk::Button("simple playlist management"));
schedulerButton.reset(new Gtk::Button("scheduler"));
// set up the time label
timeWidget.reset(new Gtk::Label("time"));
// set up the layout, which is a button box
layout.reset(new Gtk::Table());
// set the localized resources
changeLanguage(bundle);
// set up the time label
timeWidget.reset(new Gtk::Label("time"));
// set up the main window, and show everything
// all the localized widgets were set up in changeLanguage()
set_border_width(10);
layout->attach(*lsLogoWidget, 0, 1, 0, 2);
layout->attach(*timeWidget, 1, 2, 0, 2);
@ -96,29 +95,9 @@ MasterPanelWindow :: MasterPanelWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
layout->attach(*onAirWidget, 4, 5, 0, 1);
layout->attach(*radioLogoWidget, 5, 6, 0, 1);
layout->attach(*userInfoWidget, 4, 6, 1, 2);
layout->attach(*uploadFileButton, 0, 1, 2, 3);
layout->attach(*djBagButton, 1, 2, 2, 3);
layout->attach(*simplePlaylistMgmtButton, 2, 3, 2, 3);
layout->attach(*schedulerButton, 3, 4, 2, 3);
add(*layout);
// set the localized resources
changeLanguage(bundle);
// bind events
uploadFileButton->signal_clicked().connect(sigc::mem_fun(*this,
&MasterPanelWindow::onUploadFileButtonClicked));
djBagButton->signal_clicked().connect(sigc::mem_fun(*this,
&MasterPanelWindow::onDjBagButtonClicked));
djBagButton->signal_clicked().connect(sigc::mem_fun(*this,
&MasterPanelWindow::onDjBagButtonClicked));
simplePlaylistMgmtButton->signal_clicked().connect(
sigc::mem_fun(*this,
&MasterPanelWindow::onSimplePlaylistMgmtButtonClicked));
schedulerButton->signal_clicked().connect(sigc::mem_fun(*this,
&MasterPanelWindow::onSchedulerButtonClicked));
// show what's there to see
showAnonymousUI();
@ -147,11 +126,38 @@ MasterPanelWindow :: changeLanguage(Ptr<ResourceBundle>::Ref bundle)
try {
set_title(*getResourceUstring("windowTitle"));
uploadFileButton.reset(new Gtk::Button(
*getResourceUstring("uploadFileButtonLabel")));
djBagButton.reset(new Gtk::Button(
*getResourceUstring("djBagButtonLabel")));
simplePlaylistMgmtButton.reset(new Gtk::Button(
*getResourceUstring("simplePlaylistMgmtButtonLabel")));
schedulerButton.reset(new Gtk::Button(
*getResourceUstring("schedulerButtonLabel")));
} catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl;
}
userInfoWidget->changeLanguage(bundle);
// re-attach the localized widgets to the layout
layout->attach(*uploadFileButton, 0, 1, 2, 3);
layout->attach(*djBagButton, 1, 2, 2, 3);
layout->attach(*simplePlaylistMgmtButton, 2, 3, 2, 3);
layout->attach(*schedulerButton, 3, 4, 2, 3);
// re-bind events to the buttons
uploadFileButton->signal_clicked().connect(sigc::mem_fun(*this,
&MasterPanelWindow::onUploadFileButtonClicked));
djBagButton->signal_clicked().connect(sigc::mem_fun(*this,
&MasterPanelWindow::onDjBagButtonClicked));
simplePlaylistMgmtButton->signal_clicked().connect(
sigc::mem_fun(*this,
&MasterPanelWindow::onSimplePlaylistMgmtButtonClicked));
schedulerButton->signal_clicked().connect(sigc::mem_fun(*this,
&MasterPanelWindow::onSchedulerButtonClicked));
}
@ -214,8 +220,7 @@ MasterPanelWindow :: onUploadFileButtonClicked(void) throw ()
{
Ptr<ResourceBundle>::Ref bundle;
try {
// TODO: add and get the proper resource bundle for the upload window
bundle = getBundle("loginWindow");
bundle = getBundle("uploadFileWindow");
} catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl;
return;

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.2 $
Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx,v $
------------------------------------------------------------------------------*/
@ -98,7 +98,7 @@ SimplePlaylistManagementWindow :: SimplePlaylistManagementWindow (
std::cerr << e.what() << std::endl;
}
statusBar.reset(new Gtk::Label("status bar"));
statusBar.reset(new Gtk::Label(*getResourceUstring("statusBar")));
// set up the layout
layout.reset(new Gtk::Table());

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.3 $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/UploadFileWindow.cxx,v $
------------------------------------------------------------------------------*/
@ -66,15 +66,26 @@ UploadFileWindow :: UploadFileWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
{
this->gLiveSupport = gLiveSupport;
set_title("Upload file window");
chooseFileLabel.reset(new Gtk::Label("choose file"));
fileNameEntry.reset(new Gtk::Entry());
chooseFileButton.reset(new Gtk::Button("choose file"));
nameLabel.reset(new Gtk::Label("clip name"));
nameEntry.reset(new Gtk::Entry());
uploadButton.reset(new Gtk::Button("upload"));
closeButton.reset(new Gtk::Button("close"));
statusBar.reset(new Gtk::Label("status bar"));
try {
set_title(*getResourceUstring("windowTitle"));
chooseFileLabel.reset(new Gtk::Label(
*getResourceUstring("chooseFileLabel")));
fileNameEntry.reset(new Gtk::Entry());
chooseFileButton.reset(new Gtk::Button(
*getResourceUstring("chooseFileButtonLabel")));
nameLabel.reset(new Gtk::Label(
*getResourceUstring("nameLabel")));
nameEntry.reset(new Gtk::Entry());
uploadButton.reset(new Gtk::Button(
*getResourceUstring("uploadButtonLabel")));
closeButton.reset(new Gtk::Button(
*getResourceUstring("closeButtonLabel")));
statusBar.reset(new Gtk::Label(
*getResourceUstring("statusBar")));
} catch (std::invalid_argument &e) {
// TODO: signal error
std::cerr << e.what() << std::endl;
}
// set up the layout, which is a button box
layout.reset(new Gtk::Table());
@ -113,8 +124,9 @@ UploadFileWindow :: onChooseFileButtonClicked(void) throw ()
{
Ptr<Gtk::FileChooserDialog>::Ref dialog;
dialog.reset(new Gtk::FileChooserDialog("Please choose a file",
Gtk::FILE_CHOOSER_ACTION_OPEN));
dialog.reset(new Gtk::FileChooserDialog(
*getResourceUstring("fileChooserDialogTitle"),
Gtk::FILE_CHOOSER_ACTION_OPEN));
dialog->set_transient_for(*this);
@ -148,9 +160,14 @@ UploadFileWindow :: onUploadButtonClicked(void) throw ()
audioClip = gLiveSupport->uploadFile(title, fileName);
// display success in the status bar
Glib::ustring statusText("uploaded clip ");
statusText += *audioClip->getTitle();
statusBar->set_text(statusText);
Ptr<UnicodeString>::Ref uTitle = ustringToUnicodeString(
audioClip->getTitle());
Formattable arguments[] = { *uTitle };
Ptr<Glib::ustring>::Ref statusText = formatMessageUstring(
"clipUploadedMessage",
arguments,
1);
statusBar->set_text(*statusText);
// clean the entry fields
nameEntry->set_text("");

View File

@ -3,8 +3,12 @@ hu:table
windowTitle:string { "LiveSupport Fő Panel" }
notLoggedInMsg:string { "Nincs bejelentkezve" }
loggedInMsg:string { "Bejelentkezve {0} felhasználóként" }
loginButtonLabel:string { "Bejelentkezés" }
logoutButtonLabel:string { "Kijelentkezés" }
loginButtonLabel:string { "bejelentkezés" }
logoutButtonLabel:string { "kijelentkezés" }
uploadFileButtonLabel:string { "file feltöltés" }
djBagButtonLabel:string { "dj táska" }
simplePlaylistMgmtButtonLabel:string { "egyszerű playlist kezelés" }
schedulerButtonLabel:string { "időzítő" }
loginWindow:table
{
@ -12,7 +16,7 @@ hu:table
loginLabel:string { "azonositó:" }
passwordLabel:string { "jelszó:" }
okButtonLabel:string { "Belépés" }
okButtonLabel:string { "belépés" }
}
audioClipListWindow:table
@ -24,7 +28,21 @@ hu:table
uriColumnLabel:string { "URI" }
tokenColumnLabel:string { "token" }
closeButtonLabel:string { "Bezár" }
closeButtonLabel:string { "bezár" }
}
djBagWindow:table
{
windowTitle:string { "LiveSupport Dj Táska" }
typeColumnLabel:string { "típus" }
titleColumnLabel:string { "cím" }
closeButtonLabel:string { "bezár" }
removeMenuItem:string { "_Eltávolít" }
addToPlaylistMenuItem:string { "_Hozzáad Playlist-hez" }
schedulePlaylistMenuItem:string { "_Playlist időzítése" }
deleteMenuItem:string { "_Töröl" }
}
playlistListWindow:table
@ -41,5 +59,52 @@ hu:table
closeButtonLabel:string { "Bezár" }
}
uploadFileWindow:table
{
windowTitle:string { "File Feltőltés Ablak" }
chooseFileLabel:string { "file: " }
chooseFileButtonLabel:string { "tallóz..." }
nameLabel:string { "hang file név: " }
uploadButtonLabel:string { "feltölt" }
closeButtonLabel:string { "bezár" }
statusBar:string { "állapotsor" }
fileChooserDialogTitle:string { "File Választás" }
clipUploadedMessage:string { "hang file {0} feltöltve" }
}
simplePlaylistManagementWindow:table
{
windowTitle:string { "LiveSupport Egyszerű Playlist Szerkesztő Ablak" }
titleColumnLabel:string { "cím" }
nameLabel:string { "név" }
saveButtonLabel:string { "elment" }
closeButtonLabel:string { "bezár" }
statusBar:string { "állapotsor" }
}
schedulerWindow:table
{
windowTitle:string { "LiveSupport Időzítő Ablak" }
startColumnLabel:string { "kezdet" }
titleColumnLabel:string { "cím" }
endColumnLabel:string { "vég" }
closeButtonLabel:string { "bezár" }
}
schedulePlaylistWindow:table
{
windowTitle:string { "LiveSupport Playlist Időzítő Ablak" }
hourLabel:string { "óra: " }
minuteLabel:string { "perc: " }
scheduleButtonLabel:string { "időzít" }
closeButtonLabel:string { "bezár" }
}
}

View File

@ -3,8 +3,12 @@ root:table
windowTitle:string { "LiveSupport Master Panel" }
notLoggedInMsg:string { "Not logged in" }
loggedInMsg:string { "Logged in as {0}" }
loginButtonLabel:string { "Log in" }
loginButtonLabel:string { "log in" }
logoutButtonLabel:string { "log out" }
uploadFileButtonLabel:string { "upload file" }
djBagButtonLabel:string { "dj bag" }
simplePlaylistMgmtButtonLabel:string { "simple playlist management" }
schedulerButtonLabel:string { "scheduler" }
loginWindow:table
{
@ -56,14 +60,30 @@ root:table
closeButtonLabel:string { "close" }
}
uploadFileWindow:table
{
windowTitle:string { "Upload File Window" }
chooseFileLabel:string { "file: " }
chooseFileButtonLabel:string { "browse..." }
nameLabel:string { "audio clip name: " }
uploadButtonLabel:string { "upload" }
closeButtonLabel:string { "close" }
statusBar:string { "status bar" }
fileChooserDialogTitle:string { "Choose a File" }
clipUploadedMessage:string { "uploaded clip {0}" }
}
simplePlaylistManagementWindow:table
{
windowTitle:string { "LiveSupport Dj Bag" }
windowTitle:string { "LiveSupport Simple Playlist Management Window" }
titleColumnLabel:string { "title" }
nameLabel:string { "name" }
saveButtonLabel:string { "save" }
closeButtonLabel:string { "close" }
statusBar:string { "status bar" }
}
schedulerWindow:table