summaryrefslogtreecommitdiffstats
path: root/remoting/host/continue_window_gtk.cc
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 22:55:00 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 22:55:00 +0000
commit40f42682afc1bd543f9fde452f7f1f20fcf55492 (patch)
tree41ff092c71006e5f7b78d4001d2bf5dba791579c /remoting/host/continue_window_gtk.cc
parent8d9ba45e32071d98ef12d279071cacc09a09f35c (diff)
downloadchromium_src-40f42682afc1bd543f9fde452f7f1f20fcf55492.zip
chromium_src-40f42682afc1bd543f9fde452f7f1f20fcf55492.tar.gz
chromium_src-40f42682afc1bd543f9fde452f7f1f20fcf55492.tar.bz2
Localized Chromoting Host on Mac and Linux.
This CL implements generation of localizable strings from remoting_strings.grd file. Depending on the platform the localized resources are placed to: - Mac: localized .string and .pak resources are added to each application bundle under 'Resources/<locale>.lproj' - Linux: localized .pak files are placed under 'remoting_locales' directory next to the binary locading them. - Windows: .rc resources are generated from .jinja2 templates and embedded into a relevant binary. Chrome l10n and i18n APIs are used to retrieve the current locale and RTL flag (Mac & Linux). The it2me plugin sets the locale to match the locale of the browser. Collateral changes: - UiString is not used any more. - Increased width of disconnect window message on Mac. - The host plugin version is correctly reported on Mac. - Dialogs use RTL templates in case of RTL languages. No more updating the templates dynamically (Windows). - remoting_unittests.ResourcesTest row runs on Mac, LInux and Windows. - '@' is used for variable substitutions by remoting_localize.py. - HOST_PLUGIN_MIME_TYPE is defined in one place now. - Deleted unused commong_resources.grd. Mac installer and preference panel are not localized yet. BUG=155204 Review URL: https://chromiumcodereview.appspot.com/19803010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213997 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/continue_window_gtk.cc')
-rw-r--r--remoting/host/continue_window_gtk.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/remoting/host/continue_window_gtk.cc b/remoting/host/continue_window_gtk.cc
index 238b509..66cde62 100644
--- a/remoting/host/continue_window_gtk.cc
+++ b/remoting/host/continue_window_gtk.cc
@@ -7,14 +7,16 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
+#include "remoting/base/string_resources.h"
#include "remoting/host/continue_window.h"
#include "ui/base/gtk/gtk_signal.h"
+#include "ui/base/l10n/l10n_util.h"
namespace remoting {
class ContinueWindowGtk : public ContinueWindow {
public:
- explicit ContinueWindowGtk(const UiStrings& ui_strings);
+ ContinueWindowGtk();
virtual ~ContinueWindowGtk();
protected:
@@ -32,9 +34,8 @@ class ContinueWindowGtk : public ContinueWindow {
DISALLOW_COPY_AND_ASSIGN(ContinueWindowGtk);
};
-ContinueWindowGtk::ContinueWindowGtk(const UiStrings& ui_strings)
- : ContinueWindow(ui_strings),
- continue_window_(NULL) {
+ContinueWindowGtk::ContinueWindowGtk()
+ : continue_window_(NULL) {
}
ContinueWindowGtk::~ContinueWindowGtk() {
@@ -67,12 +68,12 @@ void ContinueWindowGtk::CreateWindow() {
DCHECK(!continue_window_);
continue_window_ = gtk_dialog_new_with_buttons(
- UTF16ToUTF8(ui_strings().product_name).c_str(),
+ l10n_util::GetStringUTF8(IDR_PRODUCT_NAME).c_str(),
NULL,
static_cast<GtkDialogFlags>(GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR),
- UTF16ToUTF8(ui_strings().stop_sharing_button_text).c_str(),
+ l10n_util::GetStringUTF8(IDR_STOP_SHARING_BUTTON).c_str(),
GTK_RESPONSE_CANCEL,
- UTF16ToUTF8(ui_strings().continue_button_text).c_str(),
+ l10n_util::GetStringUTF8(IDR_CONTINUE_BUTTON).c_str(),
GTK_RESPONSE_OK,
NULL);
@@ -91,7 +92,7 @@ void ContinueWindowGtk::CreateWindow() {
gtk_dialog_get_content_area(GTK_DIALOG(continue_window_));
GtkWidget* text_label =
- gtk_label_new(UTF16ToUTF8(ui_strings().continue_prompt).c_str());
+ gtk_label_new(l10n_util::GetStringUTF8(IDR_CONTINUE_PROMPT).c_str());
gtk_label_set_line_wrap(GTK_LABEL(text_label), TRUE);
// TODO(lambroslambrou): Fix magic numbers, as in disconnect_window_gtk.cc.
gtk_misc_set_padding(GTK_MISC(text_label), 12, 12);
@@ -113,9 +114,8 @@ void ContinueWindowGtk::OnResponse(GtkWidget* dialog, int response_id) {
}
// static
-scoped_ptr<HostWindow> HostWindow::CreateContinueWindow(
- const UiStrings& ui_strings) {
- return scoped_ptr<HostWindow>(new ContinueWindowGtk(ui_strings));
+scoped_ptr<HostWindow> HostWindow::CreateContinueWindow() {
+ return scoped_ptr<HostWindow>(new ContinueWindowGtk());
}
} // namespace remoting