Re: [poedit-users] Getting started
Daniel Carrera <[email protected]> Thu, 21 Jan 2010 23:57:38 +0100
| Newsgroups | gmane.editors.poedit.user |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------040507020303080403000400
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
The attached file is the only file in my program that contains
translation strings. Yes, just one file. Yes, it's a small program.
Is there a kind soul out there who might use their functioning PoEdit to
give me a valid messages.po file I can use so I can start translating?
The source language should be "Monda" and the translation will be to
English.
Thanks.
Daniel.
--------------040507020303080403000400
Content-Type: text/x-c++src;
name="window.cpp"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="window.cpp"
#include "window.h"
// This is the constructor of our frame.
myFrame::myFrame(const wxString & title)
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(500, 250))
{
// Init DB.
g_database = new DB();
// Setup UI.
SetMenus();
SetPanel();
SetIcon(wxIcon(wxT("Monda.png")));
Centre();
}
/* vbox
* +--------------------------------------------+
* | hbox |
* | +----------------------------------------+ |
* | | radioBox | |
* | | +---------+ g_search clearBtn | |
* | | | | +--------------+ +---+ | |
* | | | | +--------------+ +---+ | |
* | | +---------+ | |
* | +----------------------------------------+ |
* | |
* | g_result |
* | +----------------------------------------+ |
* | | | |
* | | | |
* | | | |
* | +----------------------------------------+ |
* +--------------------------------------------+
*/
void myFrame::SetPanel() {
wxPanel *panel = new wxPanel(this, wxID_ANY);
// Sizers.
wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
// Radio box.
wxBoxSizer *radioBox = new wxBoxSizer(wxVERTICAL);
wxRadioButton *r1 = new wxRadioButton(panel, myID_FROM_MONDA, wxT("Monda al Engla"));
wxRadioButton *r2 = new wxRadioButton(panel, myID_TO_MONDA, wxT("Engla al Monda"));
radioBox->Add(r1);
radioBox->Add(r2);
Connect(myID_FROM_MONDA, myEVT_RADIO, myEventHandler(myFrame::OnRadio1));
Connect(myID_TO_MONDA, myEVT_RADIO, myEventHandler(myFrame::OnRadio2));
// Search term and clear button.
g_search = new wxTextCtrl(panel, myID_TEXT);
wxButton *clearBtn = new wxButton(panel, wxID_CLEAR, _("Klari"));
wxButton *editBtn = new wxButton(panel, wxID_EDIT, _("Adici"));
Connect(myID_TEXT, myEVT_TEXT, myEventHandler(myFrame::OnText));
Connect(wxID_CLEAR, myEVT_BUTTON, myEventHandler(myFrame::OnClear));
Connect(wxID_EDIT, myEVT_BUTTON, myEventHandler(myFrame::OnEdit));
// Search results.
g_results = new wxListView(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxLC_REPORT);
g_results->InsertColumn(0, _("Monda"), wxLIST_FORMAT_LEFT, 112);
g_results->InsertColumn(1, _("Traduko"), wxLIST_FORMAT_LEFT, 123);
g_results->InsertColumn(2, _("Komentos"), wxLIST_FORMAT_LEFT, 235);
// Layout.
hbox->Add(radioBox, 0, wxALL, 5); // 5px border all sides
hbox->Add(g_search, 1, wxCENTER | wxALL, 5); // 5px border all sides
hbox->Add(clearBtn, 0, wxCENTER | wxALL, 5); // 5px border all sides
hbox->Add(editBtn, 0, wxCENTER | wxALL, 5); // 5px border all sides
vbox->Add(hbox, 0, wxEXPAND|wxCENTER|wxLEFT|wxRIGHT, 5); // 5px border left+right
vbox->Add(g_results,1,wxEXPAND|wxCENTER|wxALL, 5);
panel->SetSizer(vbox);
}
void myFrame::SetMenus() {
// Declare menus.
wxMenu *fileMenu = new wxMenu;
wxMenu *langMenu = new wxMenu;
wxMenu *helpMenu = new wxMenu;
wxMenu *langProgMenu = new wxMenu; // Program language menu.
wxMenu *langDictMenu = new wxMenu; // Dictionary language menu.
// File menu.
fileMenu->Append(wxID_OPEN, _("&Importi"));
fileMenu->AppendSeparator();
fileMenu->Append(wxID_EXIT, _("&Eliri"));
// Language menu.
langProgMenu->Append(wxID_ANY, wxT("Cina"));
langProgMenu->Append(wxID_ANY, wxT("Engla"));
langProgMenu->Append(wxID_ANY, wxT("Espana"));
langProgMenu->Append(wxID_ANY, wxT("Germana"));
langProgMenu->Append(wxID_ANY, wxT("Portugala"));
langDictMenu->Append(wxID_ANY, wxT("Cina"));
langDictMenu->Append(wxID_ANY, wxT("Engla"));
langDictMenu->Append(wxID_ANY, wxT("Espana"));
langDictMenu->Append(wxID_ANY, wxT("Germana"));
langDictMenu->Append(wxID_ANY, wxT("Portugala"));
langMenu->AppendSubMenu(langDictMenu, _("&Wordlibro"));
langMenu->AppendSubMenu(langProgMenu, _("&Programo"));
// Help menu.
helpMenu->Append(myID_HELP, _("&Enhavo"));
helpMenu->AppendSeparator();
helpMenu->Append(wxID_ABOUT, _("&Pri"));
// Events.
Connect(wxID_OPEN, myEVT_MENU, myEventHandler(myFrame::OnImport));
Connect(wxID_EXIT, myEVT_MENU, myEventHandler(myFrame::OnQuit));
Connect(myID_HELP, myEVT_MENU, myEventHandler(myFrame::OnHelp));
Connect(wxID_ABOUT, myEVT_MENU, myEventHandler(myFrame::OnAbout));
// Menu bar
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(fileMenu, _("&Faylo"));
menuBar->Append(langMenu, _("&Lango"));
menuBar->Append(helpMenu, _("&Helpi"));
SetMenuBar(menuBar);
}
void myFrame::UpdateResults() {
search_results_t results;
record_t cols(3);
unsigned int i;
// Clear the list widget.
g_results->DeleteAllItems();
// Do a new query and re-populate the widget.
results = g_database->Search(g_search->GetValue());
for (i = 0; i < results.size(); i++) {
cols = results.at(i);
g_results->InsertItem(i, cols[0]);
g_results->SetItem(i, 1, cols[1]);
g_results->SetItem(i, 2, cols[2]);
}
}
void myFrame::OnImport(wxCommandEvent & WXUNUSED(event)) {
wxFileDialog * dlg = new wxFileDialog(this, _("Choose a database file"), "", "", "*.wl");
if (dlg->ShowModal() == wxID_OK){
wxString fileName = dlg->GetPath();
wxPuts( wxT("File: ") + fileName);
}
}
void myFrame::OnEdit(wxCommandEvent & WXUNUSED(event)) {
wxPuts("Edit");
}
void myFrame::OnText(wxCommandEvent & WXUNUSED(event)) {
UpdateResults();
}
void myFrame::OnRadio1(wxCommandEvent & WXUNUSED(event)) {
g_database->SetDirection(myFROM_MONDA);
UpdateResults();
}
void myFrame::OnRadio2(wxCommandEvent & WXUNUSED(event)) {
g_database->SetDirection(myTO_MONDA);
UpdateResults();
}
void myFrame::OnClear(wxCommandEvent & WXUNUSED(event)) {
g_search->Clear();
}
void myFrame::HtmlWindow(wxString title, wxString path) {
wxSize dlgSize = wxSize(400,400);
wxDialog dlg(this, wxID_ANY, title, wxDefaultPosition, dlgSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
wxHtmlWindow *html;
html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, dlgSize);
html->LoadPage(path);
dlg.ShowModal();
}
void myFrame::OnHelp(wxCommandEvent & WXUNUSED(event)) {
HtmlWindow( _("Help Contents"), wxT("helpi/en.html") );
}
void myFrame::OnAbout(wxCommandEvent & WXUNUSED(event)) {
// Read license from a file.
wxTextFile file(_("licenso/pri_en.txt"));
wxString s, license;
file.Open();
for (s = file.GetFirstLine(); !file.Eof(); s = file.GetNextLine() )
license = license + s + wxT("\n");
file.Close();
// Dialog contents.
wxAboutDialogInfo info;
info.SetName(_("Wordlibro"));
info.SetVersion(_("0.3 Alpha"));
info.SetLicense(license);
info.SetWebSite(_("http://monda-lango.org"));
info.SetDescription(_("A small dictionary application\nfor the Monda language."));
info.SetCopyright(_("© 2010 Daniel Carrera <[email protected]>"));
info.AddDeveloper("Daniel Carrera");
info.AddTranslator("Daniel Carrera");
info.AddTranslator("Sigrid Carrera");
wxAboutBox(info);
}
void myFrame::OnQuit(wxCommandEvent & WXUNUSED(event)) {
g_database->Close();
Close(true);
}
--------------040507020303080403000400
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
--------------040507020303080403000400
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Poedit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/poedit-users
--------------040507020303080403000400--