Translate constant strings at run-time
This commit is contained in:
parent
3925694f1d
commit
380c2ad706
|
@ -26,7 +26,7 @@
|
||||||
#include <Desktop.h>
|
#include <Desktop.h>
|
||||||
#include "Panel/applet.h"
|
#include "Panel/applet.h"
|
||||||
#define _(string) gettext(string)
|
#define _(string) gettext(string)
|
||||||
#define N_(string) (string)
|
#define N_(string) string
|
||||||
|
|
||||||
#if !GTK_CHECK_VERSION(3, 0, 0)
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
||||||
# define gdk_error_trap_pop_ignored() gdk_error_trap_pop()
|
# define gdk_error_trap_pop_ignored() gdk_error_trap_pop()
|
||||||
|
|
12
src/helper.c
12
src/helper.c
|
@ -211,8 +211,8 @@ static void _logout_dialog_on_response(GtkWidget * widget, gint response);
|
||||||
|
|
||||||
static void _panel_helper_logout_dialog(Panel * panel)
|
static void _panel_helper_logout_dialog(Panel * panel)
|
||||||
{
|
{
|
||||||
const char * message = _("This will log you out of the current session,"
|
const char message[] = N_("This will log you out of the current session"
|
||||||
" therefore closing any application currently opened"
|
", therefore closing any application currently opened"
|
||||||
" and losing any unsaved data.\n"
|
" and losing any unsaved data.\n"
|
||||||
"Do you really want to proceed?");
|
"Do you really want to proceed?");
|
||||||
GtkWidget * widget;
|
GtkWidget * widget;
|
||||||
|
@ -229,7 +229,7 @@ static void _panel_helper_logout_dialog(Panel * panel)
|
||||||
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(
|
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(
|
||||||
panel->lo_window),
|
panel->lo_window),
|
||||||
#endif
|
#endif
|
||||||
"%s", message);
|
"%s", _(message));
|
||||||
#if GTK_CHECK_VERSION(2, 10, 0)
|
#if GTK_CHECK_VERSION(2, 10, 0)
|
||||||
gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(panel->lo_window),
|
gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(panel->lo_window),
|
||||||
gtk_image_new_from_icon_name("gnome-logout",
|
gtk_image_new_from_icon_name("gnome-logout",
|
||||||
|
@ -386,12 +386,12 @@ enum { RES_CANCEL, RES_REBOOT, RES_SHUTDOWN };
|
||||||
static void _panel_helper_shutdown_dialog(Panel * panel)
|
static void _panel_helper_shutdown_dialog(Panel * panel)
|
||||||
{
|
{
|
||||||
#ifdef EMBEDDED
|
#ifdef EMBEDDED
|
||||||
const char * message = _("This will shutdown your device,"
|
const char message[] = N_("This will shutdown your device,"
|
||||||
" therefore closing any application currently opened"
|
" therefore closing any application currently opened"
|
||||||
" and losing any unsaved data.\n"
|
" and losing any unsaved data.\n"
|
||||||
"Do you really want to proceed?");
|
"Do you really want to proceed?");
|
||||||
#else
|
#else
|
||||||
const char * message = _("This will shutdown your computer,"
|
const char message[] = N_("This will shutdown your computer,"
|
||||||
" therefore closing any application currently opened"
|
" therefore closing any application currently opened"
|
||||||
" and losing any unsaved data.\n"
|
" and losing any unsaved data.\n"
|
||||||
"Do you really want to proceed?");
|
"Do you really want to proceed?");
|
||||||
|
@ -410,7 +410,7 @@ static void _panel_helper_shutdown_dialog(Panel * panel)
|
||||||
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(
|
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(
|
||||||
panel->sh_window),
|
panel->sh_window),
|
||||||
#endif
|
#endif
|
||||||
"%s", message);
|
"%s", _(message));
|
||||||
#if GTK_CHECK_VERSION(2, 10, 0)
|
#if GTK_CHECK_VERSION(2, 10, 0)
|
||||||
gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(panel->sh_window),
|
gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(panel->sh_window),
|
||||||
gtk_image_new_from_icon_name("gnome-shutdown",
|
gtk_image_new_from_icon_name("gnome-shutdown",
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "panel.h"
|
#include "panel.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#define _(string) gettext(string)
|
#define _(string) gettext(string)
|
||||||
#define N_(string) (string)
|
#define N_(string) string
|
||||||
|
|
||||||
/* constants */
|
/* constants */
|
||||||
#ifndef PROGNAME
|
#ifndef PROGNAME
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#define _(string) gettext(string)
|
#define _(string) gettext(string)
|
||||||
#define N_(string) (string)
|
#define N_(string) string
|
||||||
|
|
||||||
/* constants */
|
/* constants */
|
||||||
#ifndef PROGNAME
|
#ifndef PROGNAME
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "../src/panel.h"
|
#include "../src/panel.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#define _(string) gettext(string)
|
#define _(string) gettext(string)
|
||||||
|
#define N_(string) string
|
||||||
|
|
||||||
/* constants */
|
/* constants */
|
||||||
#ifndef PROGNAME
|
#ifndef PROGNAME
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "../src/panel.h"
|
#include "../src/panel.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#define _(string) gettext(string)
|
#define _(string) gettext(string)
|
||||||
|
#define N_(string) string
|
||||||
|
|
||||||
#ifndef PROGNAME
|
#ifndef PROGNAME
|
||||||
# define PROGNAME "panel-test"
|
# define PROGNAME "panel-test"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user