diff --git a/capplets/localization/ChangeLog b/capplets/localization/ChangeLog new file mode 100644 index 000000000..5f8fff7e5 --- /dev/null +++ b/capplets/localization/ChangeLog @@ -0,0 +1,3 @@ +2007-11-02 Rodrigo Moya + + Started localization capplet. diff --git a/capplets/localization/Makefile.am b/capplets/localization/Makefile.am new file mode 100644 index 000000000..f1d86a988 --- /dev/null +++ b/capplets/localization/Makefile.am @@ -0,0 +1,26 @@ +# This is used in GNOMECC_CAPPLETS_CFLAGS +cappletname = localization +bin_PROGRAMS = gnome-localization-properties + +gnome_localization_properties_SOURCES = main.c +gnome_localization_properties_LDFLAGS = -export-dynamic +gnome_localization_properties_LDADD = \ + $(CAPPLET_LIBS) + +@INTLTOOL_DESKTOP_RULE@ + +desktopdir = $(datadir)/applications +Desktop_in_files = localization.desktop.in +desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) + +gladedir = $(pkgdatadir)/glade +dist_glade_DATA = localization.glade + +INCLUDES = \ + $(CAPPLET_CFLAGS) \ + $(GNOMECC_CAPPLETS_CFLAGS) \ + -DGNOMECC_GLADEDIR="\"$(gladedir)\"" \ + -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \ + -DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" + +CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(Desktop_in_files) $(desktop_DATA) \ No newline at end of file diff --git a/capplets/localization/localization.desktop.in.in b/capplets/localization/localization.desktop.in.in new file mode 100644 index 000000000..6b410c515 --- /dev/null +++ b/capplets/localization/localization.desktop.in.in @@ -0,0 +1,15 @@ +[Desktop Entry] +Encoding=UTF-8 +_Name=Language and Culture +_Comment=Set your language and culture preferences +Exec=gnome-localization-properties +Icon=localization-capplet +Terminal=false +Type=Application +StartupNotify=true +Categories=GNOME;GTK;Application;Settings;DesktopSettings; +OnlyShowIn=GNOME; +X-GNOME-Bugzilla-Bugzilla=GNOME +X-GNOME-Bugzilla-Product=control-center +X-GNOME-Bugzilla-Component=Localization +X-GNOME-Bugzilla-Version=@VERSION@ diff --git a/capplets/localization/localization.glade b/capplets/localization/localization.glade new file mode 100644 index 000000000..a6f6f836d --- /dev/null +++ b/capplets/localization/localization.glade @@ -0,0 +1,337 @@ + + + + + + + 5 + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Localization Preferences + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + True + False + preferences-desktop-locale + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + gtk-help + True + GTK_RELIEF_NORMAL + True + -11 + + + + + + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + 0 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 12 + True + False + 18 + + + + True + False + 6 + + + + True + gtk-dialog-info + 5 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + 280 + True + <i>Region and language changes take effect the next time you log in.</i> + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 12 + + + + True + Region: + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + True + True + + True + GTK_RELIEF_NORMAL + True + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 6 + + + + True + Selected languages: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + True + 1 + 2 + False + 0 + 3 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + 100 + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + False + False + True + False + False + False + + + + + 0 + 1 + 0 + 1 + expand|shrink|fill + expand|shrink|fill + + + + + + True + GTK_BUTTONBOX_START + 3 + + + + True + True + True + gtk-add + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + True + + + + + 1 + 2 + 0 + 1 + + fill + + + + + 0 + True + True + + + + + + True + GTK_BUTTONBOX_END + 6 + + + 0 + False + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + diff --git a/capplets/localization/main.c b/capplets/localization/main.c new file mode 100644 index 000000000..70f0e3e27 --- /dev/null +++ b/capplets/localization/main.c @@ -0,0 +1,62 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * Copyright (C) 2007 Rodrigo Moya + * + * Licensed under the GNU General Public License Version 2 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include + +static GtkWidget * +create_dialog (void) +{ + GladeXML *xml; + GtkWidget *dialog; + + xml = glade_xml_new (GNOMECC_GLADEDIR "/localization.glade", "i18n_dialog", NULL); + dialog = glade_xml_get_widget (xml, "i18n_dialog"); + + return dialog; +} + +int +main (int argc, char *argv[]) +{ + GnomeProgram *program; + GtkWidget *dialog; + + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + program = gnome_program_init ("gnome-localization-properties", VERSION, + LIBGNOMEUI_MODULE, argc, argv, + GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR, + NULL); + + /* open main dialog */ + dialog = create_dialog (); + g_signal_connect (G_OBJECT (dialog), "response", gtk_main_quit, NULL); + gtk_widget_show (dialog); + + gtk_main (); + g_object_unref (program); + + return 0; +}