diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2018-10-16 19:46:01 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2018-10-16 19:46:01 +0900 |
commit | a6710817b3d29d6a522f108f96ffe64d2f5367fe (patch) | |
tree | fe85407efc2d3c2dc3ecd6c38f9d6b3421509b2d | |
parent | 74a00cc93ba99367e175ad3d3415e585d453d17f (diff) | |
download | ibus-a6710817b3d29d6a522f108f96ffe64d2f5367fe.tar.gz |
Gettext migration for gschema.xml file
https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration
-rw-r--r-- | bindings/vala/config.vapi | 2 | ||||
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | data/dconf/org.freedesktop.ibus.gschema.xml | 2 | ||||
-rw-r--r-- | po/Makevars | 8 | ||||
-rw-r--r-- | po/POTFILES.in | 10 | ||||
-rw-r--r-- | setup/Makefile.am | 14 | ||||
-rw-r--r-- | setup/ibus-setup.desktop (renamed from setup/ibus-setup.desktop.in) | 0 | ||||
-rw-r--r-- | src/ibusutil.c | 2 | ||||
-rw-r--r-- | src/keyname-table.h | 70 | ||||
-rw-r--r-- | tools/main.vala | 2 | ||||
-rw-r--r-- | ui/gtk3/Makefile.am | 20 | ||||
-rw-r--r-- | ui/gtk3/application.vala | 3 | ||||
-rw-r--r-- | ui/gtk3/emojierapp.vala | 3 | ||||
-rw-r--r-- | ui/gtk3/extension.vala | 3 | ||||
-rw-r--r-- | ui/gtk3/ibus-extension-gtk3.desktop.in (renamed from ui/gtk3/ibus-extension-gtk3.desktop.in.in) | 0 | ||||
-rw-r--r-- | ui/gtk3/ibus-ui-emojier.desktop.in (renamed from ui/gtk3/ibus-ui-emojier.desktop.in.in) | 0 |
16 files changed, 40 insertions, 108 deletions
diff --git a/bindings/vala/config.vapi b/bindings/vala/config.vapi index e3c43dfb..45ab61b0 100644 --- a/bindings/vala/config.vapi +++ b/bindings/vala/config.vapi @@ -9,5 +9,5 @@ namespace Config public const string PKGDATADIR; public const string LIBEXECDIR; public const string GETTEXT_PACKAGE; - public const string GLIB_LOCALE_DIR; + public const string LOCALEDIR; } diff --git a/configure.ac b/configure.ac index 0e9337a7..26a048c8 100644 --- a/configure.ac +++ b/configure.ac @@ -111,9 +111,8 @@ GETTEXT_PACKAGE=ibus10 AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The prefix for out gettext translation domains.]) -GLIB_DEFINE_LOCALEDIR(GLIB_LOCALE_DIR) -GLIB_LOCALE_DIR=$localedir -AC_SUBST(GLIB_LOCALE_DIR) +AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir", + [Define the location where the catalogs will be installed]) # For dislpay date. m4_define(ibus_datedisplay, @@ -131,14 +130,14 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET # i18n stuff -AM_GLIB_GNU_GETTEXT +AM_GNU_GETTEXT_VERSION([0.19.8]) +AM_GNU_GETTEXT([external]) # Define PACKAGE_VERSION_* variables. AM_DISABLE_STATIC AC_ISC_POSIX AC_HEADER_STDC LT_INIT -IT_PROG_INTLTOOL([0.35.0]) # Check functions. AC_CHECK_FUNCS(daemon) diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml index cbe7118e..8724a8ba 100644 --- a/data/dconf/org.freedesktop.ibus.gschema.xml +++ b/data/dconf/org.freedesktop.ibus.gschema.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <schemalist> <schema id="org.freedesktop.ibus" path="/desktop/ibus/"> <child name="general" schema="org.freedesktop.ibus.general"/> diff --git a/po/Makevars b/po/Makevars index 3e56bea1..8cf0b78a 100644 --- a/po/Makevars +++ b/po/Makevars @@ -8,7 +8,9 @@ subdir = po top_builddir = .. # These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ +# The last argument --keyword without keyword prevents xgettext from +# extracting translatable strings from "Icon" in *.desktop files. +XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --keyword=Name --keyword=Comment --keyword --add-comments # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding @@ -39,3 +41,7 @@ MSGID_BUGS_ADDRESS = $(PACKAGE_BUGREPORT) # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = + +# https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration +PO_DEPENDS_ON_POT = "no" +DIST_DEPENDS_ON_UPDAE_PO = "no" diff --git a/po/POTFILES.in b/po/POTFILES.in index c81292d2..b3b71e81 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,11 +1,10 @@ # Files with translatable strings. # Please keep this file in alphabetical order. -[type: gettext/glade]setup/setup.ui bus/dbusimpl.c bus/engineproxy.c bus/inputcontext.c bus/panelproxy.c -data/ibus.schemas.in +data/dconf/org.freedesktop.ibus.gschema.xml ibus/__init__.py ibus/_config.py.in ibus/_gtk.py @@ -36,9 +35,10 @@ setup/engineabout.py setup/enginecombobox.py setup/enginedialog.py setup/enginetreeview.py -setup/ibus-setup.desktop.in +setup/ibus-setup.desktop setup/keyboardshortcut.py setup/main.py +setup/setup.ui src/ibusbus.c src/ibusconfig.c src/ibusemojigen.h @@ -61,8 +61,8 @@ ui/gtk3/candidatepanel.vala ui/gtk3/emojier.vala ui/gtk3/emojierapp.vala ui/gtk3/handle.vala -ui/gtk3/ibus-extension-gtk3.desktop.in.in -ui/gtk3/ibus-ui-emojier.desktop.in.in +ui/gtk3/ibus-extension-gtk3.desktop.in +ui/gtk3/ibus-ui-emojier.desktop.in ui/gtk3/iconwidget.vala ui/gtk3/keybindingmanager.vala ui/gtk3/panel.vala diff --git a/setup/Makefile.am b/setup/Makefile.am index b7dd7554..17d80c51 100644 --- a/setup/Makefile.am +++ b/setup/Makefile.am @@ -3,8 +3,8 @@ # ibus - The Input Bus # # Copyright (c) 2007-2014 Peng Huang <shawn.p.huang@gmail.com> -# Copyright (c) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com> -# Copyright (c) 2007-2017 Red Hat, Inc. +# Copyright (c) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com> +# Copyright (c) 2007-2018 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -40,10 +40,8 @@ ibussetup_DATA = \ bin_SCRIPTS = ibus-setup ibussetupdir = $(pkgdatadir)/setup -desktop_in_files = ibus-setup.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) +desktop_DATA = ibus-setup.desktop desktopdir = $(datadir)/applications -@INTLTOOL_DESKTOP_RULE@ man_one_in_files = ibus-setup.1.in man_one_files = $(man_one_in_files:.1.in=.1) @@ -67,11 +65,7 @@ EXTRA_DIST = \ $(man_one_in_files) \ ibus-setup.in \ setup.ui \ - ibus-setup.desktop.in \ - $(NULL) - -DISTCLEANFILES = \ - $(desktop_DATA) \ + ibus-setup.desktop \ $(NULL) test: diff --git a/setup/ibus-setup.desktop.in b/setup/ibus-setup.desktop index 864b026e..864b026e 100644 --- a/setup/ibus-setup.desktop.in +++ b/setup/ibus-setup.desktop diff --git a/src/ibusutil.c b/src/ibusutil.c index 3c6f9247..15e36f80 100644 --- a/src/ibusutil.c +++ b/src/ibusutil.c @@ -99,7 +99,7 @@ _load_lang() struct stat buf; #ifdef ENABLE_NLS - bindtextdomain ("iso_639", GLIB_LOCALE_DIR); + bindtextdomain ("iso_639", LOCALEDIR); bind_textdomain_codeset ("iso_639", "UTF-8"); #endif diff --git a/src/keyname-table.h b/src/keyname-table.h index 5d133226..f84ecdc3 100644 --- a/src/keyname-table.h +++ b/src/keyname-table.h @@ -6830,6 +6830,9 @@ static const gdk_key gdk_keys_by_name[] = { #if 0 /* + * xgettext extracts strings in '#if 0' against intltool and I deleted + * all the translatable strings here. + * * Translators, the strings in the “keyboard label” context are * display names for keyboard keys. Some of them have prefixes like * XF86 or ISO_ - these should be removed in the translation. Similarly, @@ -6840,72 +6843,5 @@ static const gdk_key gdk_keys_by_name[] = { * Scroll_lock - Scroll lock * KP_Space - Space (keypad) */ -NC_("keyboard label", "BackSpace") -NC_("keyboard label", "Tab") -NC_("keyboard label", "Return") -NC_("keyboard label", "Pause") -NC_("keyboard label", "Scroll_Lock") -NC_("keyboard label", "Sys_Req") -NC_("keyboard label", "Escape") -NC_("keyboard label", "Multi_key") -NC_("keyboard label", "Home") -NC_("keyboard label", "Left") -NC_("keyboard label", "Up") -NC_("keyboard label", "Right") -NC_("keyboard label", "Down") -NC_("keyboard label", "Page_Up") -NC_("keyboard label", "Page_Down") -NC_("keyboard label", "End") -NC_("keyboard label", "Begin") -NC_("keyboard label", "Print") -NC_("keyboard label", "Insert") -NC_("keyboard label", "Num_Lock") -/* Translators: KP_ means 'key pad' here */ -NC_("keyboard label", "KP_Space") -NC_("keyboard label", "KP_Tab") -NC_("keyboard label", "KP_Enter") -NC_("keyboard label", "KP_Home") -NC_("keyboard label", "KP_Left") -NC_("keyboard label", "KP_Up") -NC_("keyboard label", "KP_Right") -NC_("keyboard label", "KP_Down") -NC_("keyboard label", "KP_Page_Up") -NC_("keyboard label", "KP_Prior") -NC_("keyboard label", "KP_Page_Down") -NC_("keyboard label", "KP_Next") -NC_("keyboard label", "KP_End") -NC_("keyboard label", "KP_Begin") -NC_("keyboard label", "KP_Insert") -NC_("keyboard label", "KP_Delete") -NC_("keyboard label", "Delete") -NC_("keyboard label", "MonBrightnessUp") -NC_("keyboard label", "MonBrightnessDown") -NC_("keyboard label", "KbdBrightnessUp") -NC_("keyboard label", "KbdBrightnessDown") -NC_("keyboard label", "AudioMute") -NC_("keyboard label", "AudioMicMute") -NC_("keyboard label", "AudioLowerVolume") -NC_("keyboard label", "AudioRaiseVolume") -NC_("keyboard label", "AudioPlay") -NC_("keyboard label", "AudioStop") -NC_("keyboard label", "AudioNext") -NC_("keyboard label", "AudioPrev") -NC_("keyboard label", "AudioRecord") -NC_("keyboard label", "AudioPause") -NC_("keyboard label", "AudioRewind") -NC_("keyboard label", "AudioMedia") -NC_("keyboard label", "ScreenSaver") -NC_("keyboard label", "Battery") -NC_("keyboard label", "Launch1") -NC_("keyboard label", "Forward") -NC_("keyboard label", "Back") -NC_("keyboard label", "Sleep") -NC_("keyboard label", "Hibernate") -NC_("keyboard label", "WLAN") -NC_("keyboard label", "WebCam") -NC_("keyboard label", "Display") -NC_("keyboard label", "TouchpadToggle") -NC_("keyboard label", "WakeUp") -NC_("keyboard label", "Suspend") #endif diff --git a/tools/main.vala b/tools/main.vala index 6e201f30..bf9c0fc9 100644 --- a/tools/main.vala +++ b/tools/main.vala @@ -472,7 +472,7 @@ void print_usage(FileStream stream) { public int main(string[] argv) { GLib.Intl.setlocale(GLib.LocaleCategory.ALL, ""); - GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.GLIB_LOCALE_DIR); + GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); GLib.Intl.textdomain(Config.GETTEXT_PACKAGE); diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am index 6ebc96ce..e40971f1 100644 --- a/ui/gtk3/Makefile.am +++ b/ui/gtk3/Makefile.am @@ -165,8 +165,8 @@ EXTRA_DIST = \ gtkpanel.xml.in \ notification-item.xml \ notification-watcher.xml \ - ibus-ui-emojier.desktop.in.in \ - ibus-extension-gtk3.desktop.in.in \ + ibus-ui-emojier.desktop.in \ + ibus-extension-gtk3.desktop.in \ panelbinding.vala \ $(NULL) @@ -265,32 +265,32 @@ man_sevendir = $(mandir)/man7 %.7.gz: %.7 $(AM_V_GEN) gzip -c $< > $@.tmp && mv $@.tmp $@ -desktop_in_in_files = \ - ibus-ui-emojier.desktop.in.in \ - ibus-extension-gtk3.desktop.in.in \ +desktop_in_files = \ + ibus-ui-emojier.desktop.in \ + ibus-extension-gtk3.desktop.in \ $(NULL) -desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in) +desktop_notrans_files = $(desktop_in_files:.desktop.in=.desktop) desktop_DATA = \ org.freedesktop.IBus.Panel.Emojier.desktop \ org.freedesktop.IBus.Panel.Extension.Gtk3.desktop \ $(NULL) desktopdir = $(datadir)/applications -%.desktop.in: %.desktop.in.in +%.desktop: %.desktop.in $(AM_V_GEN) sed \ -e 's|^_Name=|Name=|g' \ -e 's|@libexecdir[@]|$(libexecdir)|g' $< > $@.tmp && \ mv $@.tmp $@ $(NULL) -org.freedesktop.IBus.Panel.Emojier.desktop: ibus-ui-emojier.desktop.in +org.freedesktop.IBus.Panel.Emojier.desktop: ibus-ui-emojier.desktop $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ $(NULL) -org.freedesktop.IBus.Panel.Extension.Gtk3.desktop: ibus-extension-gtk3.desktop.in +org.freedesktop.IBus.Panel.Extension.Gtk3.desktop: ibus-extension-gtk3.desktop $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ $(NULL) CLEANFILES += \ $(desktop_DATA) \ - $(desktop_in_files) \ + $(desktop_notrans_files) \ $(man_seven_DATA) \ $(man_seven_files) \ $(NULL) diff --git a/ui/gtk3/application.vala b/ui/gtk3/application.vala index 806b4b22..cc9ee54c 100644 --- a/ui/gtk3/application.vala +++ b/ui/gtk3/application.vala @@ -26,8 +26,7 @@ class Application { private Panel m_panel; public Application(string[] argv) { - GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, - Config.GLIB_LOCALE_DIR); + GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); IBus.init(); Gtk.init(ref argv); diff --git a/ui/gtk3/emojierapp.vala b/ui/gtk3/emojierapp.vala index fab99d9e..e8331989 100644 --- a/ui/gtk3/emojierapp.vala +++ b/ui/gtk3/emojierapp.vala @@ -227,8 +227,7 @@ public class EmojiApplication : Gtk.Application { public static int main (string[] args) { - GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, - Config.GLIB_LOCALE_DIR); + GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); GLib.Intl.textdomain(Config.GETTEXT_PACKAGE); diff --git a/ui/gtk3/extension.vala b/ui/gtk3/extension.vala index c729fd7e..ea3cd464 100644 --- a/ui/gtk3/extension.vala +++ b/ui/gtk3/extension.vala @@ -28,8 +28,7 @@ class ExtensionGtk : Gtk.Application { public ExtensionGtk(string[] args) { Object(application_id: "org.freedesktop.IBus.Panel.Extension.Gtk3", flags: ApplicationFlags.FLAGS_NONE); - GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, - Config.GLIB_LOCALE_DIR); + GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); IBus.init(); Gtk.init(ref args); diff --git a/ui/gtk3/ibus-extension-gtk3.desktop.in.in b/ui/gtk3/ibus-extension-gtk3.desktop.in index a119ec8e..a119ec8e 100644 --- a/ui/gtk3/ibus-extension-gtk3.desktop.in.in +++ b/ui/gtk3/ibus-extension-gtk3.desktop.in diff --git a/ui/gtk3/ibus-ui-emojier.desktop.in.in b/ui/gtk3/ibus-ui-emojier.desktop.in index 6d9422d5..6d9422d5 100644 --- a/ui/gtk3/ibus-ui-emojier.desktop.in.in +++ b/ui/gtk3/ibus-ui-emojier.desktop.in |