-SUBDIRS = hangul data test
+SUBDIRS = hangul data test po
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libhangul.pc
EXTRA_DIST = \
+ config.rpath \
+ m4/ChangeLog \
doc/Makefile \
doc/Doxyfile.in \
doc/mainpage.dox
export LANG=C ; \
export LC_CTYPE=ko_KR.UTF-8; \
svn log -v > ChangeLog
+
+ACLOCAL_AMFLAGS = -I m4
libtoolize=libtoolize
fi
+gettextize --force --no-changelog
$libtoolize --automake
aclocal $ACLOCAL_AMFLAGS
autoheader
AC_CHECK_FUNCS([munmap])
AC_CHECK_FUNCS([strcasecmp])
+# Checks for gettext stuff
+GETTEXT_PACKAGE="$PACKAGE"
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", gettext package name)
+AM_GNU_GETTEXT([external])
+
# Checks for unit test framework
PKG_PROG_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
AC_CONFIG_FILES([
Makefile
-hangul/Makefile
data/Makefile
data/hanja/Makefile
-test/Makefile
doc/Doxyfile
+hangul/Makefile
libhangul.pc
+po/Makefile.in
+test/Makefile
+tools/Makefile
])
AC_OUTPUT
hanja.c
libhangul_la_CFLAGS = \
+ -DLOCALEDIR=\"$(localedir)\" \
-DLIBHANGUL_DEFAULT_HANJA_DIC=\"$(datadir)/libhangul/hanja/hanja.txt\"
libhangul_la_LDFLAGS = -version-info $(LIBHANGUL_CURRENT):$(LIBHANGUL_REVISION):$(LIBHANGUL_AGE)
--- /dev/null
+#ifndef libhangul_hangul_gettext_h
+#define libhangul_hangul_gettext_h
+
+#ifdef ENABLE_NLS
+
+#include <libintl.h>
+
+#define _(x) dgettext(GETTEXT_PACKAGE, x)
+#define N_(x) x
+
+#else /* ENABLE_NLS */
+
+#define _(x) (x)
+#define N_(x) x
+
+#endif /* ENABLE_NLS */
+
+#endif // libhangul_hangul_gettext_h
#include <inttypes.h>
#include <limits.h>
+#include "hangul-gettext.h"
#include "hangul.h"
#include "hangulinternals.h"
static const HangulKeyboard hangul_keyboard_2 = {
HANGUL_KEYBOARD_TYPE_JAMO,
"2",
- "Dubeolsik",
+ N_("Dubeolsik"),
(ucschar*)hangul_keyboard_table_2,
&hangul_combination_default
};
static const HangulKeyboard hangul_keyboard_32 = {
HANGUL_KEYBOARD_TYPE_JASO,
"32",
- "Sebeolsik dubeol layout",
+ N_("Sebeolsik dubeol layout"),
(ucschar*)hangul_keyboard_table_32,
&hangul_combination_default
};
static const HangulKeyboard hangul_keyboard_390 = {
HANGUL_KEYBOARD_TYPE_JASO,
"39",
- "Sebeolsik 390",
+ N_("Sebeolsik 390"),
(ucschar*)hangul_keyboard_table_390,
&hangul_combination_default
};
static const HangulKeyboard hangul_keyboard_3final = {
HANGUL_KEYBOARD_TYPE_JASO,
"3f",
- "Sebeolsik final",
+ N_("Sebeolsik final"),
(ucschar*)hangul_keyboard_table_3final,
&hangul_combination_default
};
static const HangulKeyboard hangul_keyboard_3sun = {
HANGUL_KEYBOARD_TYPE_JASO,
- "3sun",
- "Sebeolsik no-shift",
+ "3s",
+ N_("Sebeolsik no-shift"),
(ucschar*)hangul_keyboard_table_3sun,
&hangul_combination_default
};
static const HangulKeyboard hangul_keyboard_3yet = {
HANGUL_KEYBOARD_TYPE_JASO,
"3y",
- "Sebeolsik yetgeul",
+ N_("Sebeolsik yetgeul"),
(ucschar*)hangul_keyboard_table_3yet,
&hangul_combination_full
};
static const HangulKeyboard hangul_keyboard_romaja = {
HANGUL_KEYBOARD_TYPE_ROMAJA,
"ro",
- "Romaja",
+ N_("Romaja"),
(ucschar*)hangul_keyboard_table_romaja,
&hangul_combination_romaja
};
static const HangulKeyboard hangul_keyboard_ahn = {
HANGUL_KEYBOARD_TYPE_JASO,
"ahn",
- "Ahnmatae",
+ N_("Ahnmatae"),
(ucschar*)hangul_keyboard_table_ahn,
&hangul_combination_ahn
};
const char*
hangul_ic_get_keyboard_name(unsigned index_)
{
+#ifdef ENABLE_NLS
+ static bool isGettextInitialized = false;
+ if (!isGettextInitialized) {
+ isGettextInitialized = true;
+ bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+ }
+#endif
+
if (index_ < N_ELEMENTS(hangul_keyboards)) {
- return hangul_keyboards[index_]->name;
+ return _(hangul_keyboards[index_]->name);
}
return NULL;
--- /dev/null
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# 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
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = http://kldp.net/projects/hangul
+
+# 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 =
--- /dev/null
+# List of source files which contain translatable strings.
+
+hangul/hangulctype.c
+hangul/hangulinputcontext.c
+hangul/hanja.c
--- /dev/null
+# libhangul korean translation
+# Copyright (C) 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libhangul package.
+# Choe Hwanjin <choe.hwanjin@gmail.com>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libhangul 0.0.11\n"
+"Report-Msgid-Bugs-To: http://kldp.net/projects/hangul\n"
+"POT-Creation-Date: 2010-11-14 21:21+0900\n"
+"PO-Revision-Date: 2010-11-14 21:34+0900\n"
+"Last-Translator: Choe Hwanjin <choe.hwanjin@gmail.com>\n"
+"Language-Team: Korean <ko@li.org>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: hangul/hangulinputcontext.c:267
+msgid "Dubeolsik"
+msgstr "두벌식"
+
+#: hangul/hangulinputcontext.c:275
+msgid "Sebeolsik dubeol layout"
+msgstr "두벌식 세벌 자판"
+
+#: hangul/hangulinputcontext.c:283
+msgid "Sebeolsik 390"
+msgstr "세벌식 390"
+
+#: hangul/hangulinputcontext.c:291
+msgid "Sebeolsik final"
+msgstr "세벌식 최종"
+
+#: hangul/hangulinputcontext.c:299
+msgid "Sebeolsik no-shift"
+msgstr "세벌식 순아래"
+
+#: hangul/hangulinputcontext.c:307
+msgid "Sebeolsik yetgeul"
+msgstr "세벌식 옛글"
+
+#: hangul/hangulinputcontext.c:315
+msgid "Romaja"
+msgstr "로마자"
+
+#: hangul/hangulinputcontext.c:323
+msgid "Ahnmatae"
+msgstr "안마태"