[passepartout] localize the print dialog
- From: Sven Herzberg <herzi src gnome org>
- To: svn-commits-list gnome org
- Subject: [passepartout] localize the print dialog
- Date: Sat, 2 May 2009 09:30:21 -0400 (EDT)
commit 5e1ea8b4e2a3024070264c1e3ed082a5a6ec66a5
Author: Sven Herzberg <herzi lanedo com>
Date: Sat May 2 01:19:25 2009 +0200
localize the print dialog
* po/POTFILES.in,
* src/pptout/printdialog.cc: the print dialog is properly translatable now
---
po/POTFILES.in | 1 +
src/pptout/printdialog.cc | 42 ++++++++++++++++++++++++++----------------
2 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 685fec0..edd7674 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -10,6 +10,7 @@ src/pptout/document/textframe.cc
src/pptout/imagemeta.cc
src/pptout/main.cc
src/pptout/preferencesdialog.cc
+src/pptout/printdialog.cc
src/pptout/propertiesdialog.cc
src/pptout/rastermeta.cc
src/pptout/streamdialog.cc
diff --git a/src/pptout/printdialog.cc b/src/pptout/printdialog.cc
index 6c6a9e1..e0b5328 100644
--- a/src/pptout/printdialog.cc
+++ b/src/pptout/printdialog.cc
@@ -22,21 +22,26 @@
#include "document/document.h"
#include "widget/errordialog.h"
+#include <glib/gi18n.h>
+
namespace {
enum {F_PS = 0, F_EPS, F_PDF};
}
PrintDialog::PrintDialog(Gtk::Window &parent,
DocumentView &_document_view):
- DialogWrap("Print", parent),
- using_button("Print _using:", true), file_button("Print _to file:", true),
- all_button("_All", true), current_button("Cu_rrent", true),
- from_button("Fro_m:", true),
- fonts_button("_Include fonts", true),
- gray_button("_Grayscale", true),
- from_spinner(0, false), to_spinner(0, false),
+ DialogWrap (_("Print"), parent),
+ using_button (_("Print _using:"), true),
+ file_button (_("Print _to file:"), true),
+ all_button (_("_All"), true),
+ current_button (_("Cu_rrent"), true),
+ from_button (_("Fro_m:"), true),
+ fonts_button (_("_Include fonts"), true),
+ gray_button (_("_Grayscale"), true),
+ from_spinner (0, false),
+ to_spinner(0, false),
document_view(_document_view),
- file_entry("Print To File")
+ file_entry (_("Print To File"))
{
set_resizable(false);
@@ -57,13 +62,13 @@ PrintDialog::PrintDialog(Gtk::Window &parent,
sizegroup->add_widget(file_button);
Gtk::HBox *format_menu_box = manage(new Gtk::HBox(false, double_space));
- Gtk::Label *format_menu_label = manage(new Gtk::Label("_Format: ",
- 0.0, 0.5, true));
+ Gtk::Label *format_menu_label = manage(new Gtk::Label (_("_Format: "),
+ 0.0, 0.5, true));
format_menu_label->set_mnemonic_widget(format_menu);
format_menu_box->pack_start(*format_menu_label, Gtk::PACK_SHRINK);
- format_menu.append_text("PostScript");
- format_menu.append_text("Encapsulated PostScript (EPS)");
- format_menu.append_text("Portable Document Format (PDF)");
+ format_menu.append_text (_("PostScript"));
+ format_menu.append_text (_("Encapsulated PostScript (EPS)"));
+ format_menu.append_text (_("Portable Document Format (PDF)"));
format_menu.set_active(F_PS);
format_menu.signal_changed().connect
(sigc::mem_fun(*this, &PrintDialog::update));
@@ -80,11 +85,11 @@ PrintDialog::PrintDialog(Gtk::Window &parent,
Gtk::HBox *from_to_box = manage(new Gtk::HBox(false, double_space));
from_to_box->pack_start(from_button, Gtk::PACK_SHRINK);
from_to_box->pack_start(from_spinner, Gtk::PACK_SHRINK);
- from_to_box->pack_start(*manage(new Gtk::Label("to:")),
+ from_to_box->pack_start(*manage(new Gtk::Label (_("to:"))),
Gtk::PACK_SHRINK);
from_to_box->pack_start(to_spinner, Gtk::PACK_SHRINK);
- SubPanel *pages_box = manage(new SubPanel("Pages"));
+ SubPanel *pages_box = manage(new SubPanel (_("Pages")));
this->pages_box = pages_box;
pages_box->pack_start(all_button, Gtk::PACK_SHRINK);
pages_box->pack_start(current_button, Gtk::PACK_SHRINK);
@@ -272,7 +277,9 @@ void PrintDialog::restore_state() {
format_menu.set_active(saved_format);
}
-void PrintDialog::update() {
+void
+PrintDialog::update (void)
+{
using_entry.set_sensitive(using_button.get_active());
file_entry.set_sensitive(file_button.get_active());
from_spinner.set_sensitive(from_button.get_active());
@@ -284,8 +291,11 @@ void PrintDialog::update() {
gray_button.set_sensitive(format != F_PDF);
// eps format always prints the current page only
pages_box->set_sensitive(format != F_EPS);
+
+ // FIXME: this smells like a hidden switch/case indicating lack of OO
std::string suffix = ".ps";
if(format == F_PDF) suffix = ".pdf";
else if(format == F_EPS) suffix = ".eps";
file_entry.entry.set_text(no_suffix(file_entry.entry.get_text()) + suffix);
}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]