Gettext migration for gschema.xml file

https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration
This commit is contained in:
fujiwarat 2018-10-16 19:46:01 +09:00
Родитель 74a00cc93b
Коммит a6710817b3
16 изменённых файлов: 40 добавлений и 108 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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)

Просмотреть файл

@ -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"/>

Просмотреть файл

@ -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"

Просмотреть файл

@ -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

Просмотреть файл

@ -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:

Просмотреть файл

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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);

Просмотреть файл

@ -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)

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);