diff options
author | Changwoo Ryu <cwryu@debian.org> | 2019-08-10 22:13:15 +0900 |
---|---|---|
committer | Choe Hwanjin <choe.hwanjin@gmail.com> | 2021-04-06 23:16:55 +0900 |
commit | cf218777a2019753462084a5ceec7ca0457b9f65 (patch) | |
tree | 86f20388f7ecc1312cb447e44b09a8be069dabdd | |
parent | 5d1c7a77e6153227701fc906d3611b15e5b390ee (diff) | |
download | libhangul-cf218777a2019753462084a5ceec7ca0457b9f65.tar.gz |
intltool to gettext migration
https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration
-rwxr-xr-x | autogen.sh | 8 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | data/keyboards/Makefile.am | 29 | ||||
-rw-r--r-- | data/keyboards/hangul-keyboard-2.xml.template | 2 | ||||
-rw-r--r-- | data/keyboards/hangul-keyboard-2y.xml.template | 2 | ||||
-rw-r--r-- | data/keyboards/hangul-keyboard-32.xml.template | 2 | ||||
-rw-r--r-- | data/keyboards/hangul-keyboard-39.xml.template | 2 | ||||
-rw-r--r-- | data/keyboards/hangul-keyboard-3f.xml.template | 2 | ||||
-rw-r--r-- | data/keyboards/hangul-keyboard-3s.xml.template | 2 | ||||
-rw-r--r-- | data/keyboards/hangul-keyboard-3y.xml.template | 2 | ||||
-rw-r--r-- | data/keyboards/hangul-keyboard-ahn.xml.template | 2 | ||||
-rw-r--r-- | data/keyboards/hangul-keyboard-ro.xml.template | 2 | ||||
-rw-r--r-- | data/keyboards/its/hangul-keyboard.its | 9 | ||||
-rw-r--r-- | data/keyboards/its/hangul-keyboard.loc | 10 |
14 files changed, 51 insertions, 26 deletions
@@ -3,14 +3,8 @@ test -f ChangeLog || touch ChangeLog -libtoolize=`which glibtoolize` -if test -z "$libtoolize"; then - libtoolize=libtoolize -fi - -intltoolize --copy --force -$libtoolize --automake --copy --force aclocal $ACLOCAL_AMFLAGS +autoreconf --force --install autoheader automake --add-missing --copy autoconf diff --git a/configure.ac b/configure.ac index 80ee216..369f904 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,8 @@ AC_SUBST(LIBHANGUL_CURRENT) AC_SUBST(LIBHANGUL_REVISION) AC_SUBST(LIBHANGUL_AGE) -IT_PROG_INTLTOOL +AM_GNU_GETTEXT_VERSION([0.19.8]) +AM_GNU_GETTEXT([external]) # Checks for programs. AC_PROG_CC diff --git a/data/keyboards/Makefile.am b/data/keyboards/Makefile.am index 12b5459..15db898 100644 --- a/data/keyboards/Makefile.am +++ b/data/keyboards/Makefile.am @@ -26,22 +26,35 @@ EXTRA_DIST = \ hangul-keyboard-ahn.xml.template \ hangul-combination-default.xml \ hangul-combination-full.xml \ + its/hangul-keyboard.its \ + its/hangul-keyboard.loc \ $(NULL) -# intltool로 xml 파일을 번역하면 주석이 모두 사라지고 attr의 순서도 -# 재정렬된다. 이를 방지하고자 name 부분만 별도의 name.xml로 만들어 +# its 폴더의 *.its, *.loc rule을 사용하기 위해 GETTEXTDATADIRS 지정 +MSGFMT_COMMAND = env GETTEXTDATADIRS=$(srcdir) $(MSGFMT) + +# msgfmt으로 xml 파일을 번역하면 들여쓰기 크기가 바뀌고 같은 줄에 달린 주석 +# 앞에 줄바꿈이 추가된다. 이를 방지하고자 root node와 name 부분만 별도의 +# name.xml로 만들어 (msgfmt 입출력은 valid XML만 가능하므로 root node도 포함.) # 번역한후 template과 name.xml을 병합하여 키보드 xml 파일을 생성한다. hangul-keyboard-%.xml: hangul-keyboard-%.name.xml hangul-keyboard-%.xml.template - sed -i -e '1 D' -e 's/^<name/ <name/' $< + sed -i -e '1 D' \ + -e '/^<hangul-keyboard/D' \ + -e '/^<\/hangul-keyboard/D' \ + -e 's/^ *<name/ <name/' $< sed \ - -e '/<_name>/r $<' \ - -e '/<_name>/a\ ' \ - -e '/<_name>/D' \ + -e '/<name>/r $<' \ + -e '/<name>/D' \ $(srcdir)/$@.template > $@ hangul-keyboard-%.name.xml.in: hangul-keyboard-%.xml.template grep "xml version=" $< > $@ - grep "<_name>" $< >> $@ + grep "<hangul-keyboard" $< >> $@ + grep "<name>" $< >> $@ + grep "</hangul-keyboard" $< >> $@ + +hangul-keyboard-%.name.xml: hangul-keyboard-%.name.xml.in Makefile + $(AM_V_GEN)$(MSGFMT_COMMAND) --xml --template $< -d $(top_srcdir)/po -o $@ CLEANFILES = \ hangul-keyboard-2.xml \ @@ -54,5 +67,3 @@ CLEANFILES = \ hangul-keyboard-ro.xml \ hangul-keyboard-ahn.xml \ $(NULL) - -@INTLTOOL_XML_RULE@ diff --git a/data/keyboards/hangul-keyboard-2.xml.template b/data/keyboards/hangul-keyboard-2.xml.template index a4a0117..2f3d565 100644 --- a/data/keyboards/hangul-keyboard-2.xml.template +++ b/data/keyboards/hangul-keyboard-2.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <hangul-keyboard id="2" type="jamo"> - <_name>Dubeolsik</_name> + <name>Dubeolsik</name> <map id="0"> <item key="0x41" value="0x1106"/> <!-- A → ᄆᅠ --> diff --git a/data/keyboards/hangul-keyboard-2y.xml.template b/data/keyboards/hangul-keyboard-2y.xml.template index c94846f..53fabf0 100644 --- a/data/keyboards/hangul-keyboard-2y.xml.template +++ b/data/keyboards/hangul-keyboard-2y.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <hangul-keyboard id="2y" type="jamo-yet"> - <_name>Dubeolsik Yetgeul</_name> + <name>Dubeolsik Yetgeul</name> <map id="0"> <item key="0x41" value="0x1140"/> <!-- A → ᅀᅠ --> diff --git a/data/keyboards/hangul-keyboard-32.xml.template b/data/keyboards/hangul-keyboard-32.xml.template index 5920069..fe36a3b 100644 --- a/data/keyboards/hangul-keyboard-32.xml.template +++ b/data/keyboards/hangul-keyboard-32.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <hangul-keyboard id="32" type="jaso"> - <_name>Sebeolsik Dubeol Layout</_name> + <name>Sebeolsik Dubeol Layout</name> <map id="0"> <item key="0x21" value="0x0021"/> <!-- ! → ! --> diff --git a/data/keyboards/hangul-keyboard-39.xml.template b/data/keyboards/hangul-keyboard-39.xml.template index 78cfb50..5b06241 100644 --- a/data/keyboards/hangul-keyboard-39.xml.template +++ b/data/keyboards/hangul-keyboard-39.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <hangul-keyboard id="39" type="jaso"> - <_name>Sebeolsik 390</_name> + <name>Sebeolsik 390</name> <map id="0"> <item key="0x21" value="0x11bd"/> <!-- ! → ᅟᅠᆽ --> diff --git a/data/keyboards/hangul-keyboard-3f.xml.template b/data/keyboards/hangul-keyboard-3f.xml.template index c563df9..9fdc4d4 100644 --- a/data/keyboards/hangul-keyboard-3f.xml.template +++ b/data/keyboards/hangul-keyboard-3f.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <hangul-keyboard id="3f" type="jaso"> - <_name>Sebeolsik Final</_name> + <name>Sebeolsik Final</name> <map id="0"> <item key="0x21" value="0x11a9"/> <!-- ! → ᅟᅠᆩ --> diff --git a/data/keyboards/hangul-keyboard-3s.xml.template b/data/keyboards/hangul-keyboard-3s.xml.template index 5a95490..1c88a62 100644 --- a/data/keyboards/hangul-keyboard-3s.xml.template +++ b/data/keyboards/hangul-keyboard-3s.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <hangul-keyboard id="3s" type="jaso"> - <_name>Sebeolsik Noshift</_name> + <name>Sebeolsik Noshift</name> <map id="0"> <item key="0x21" value="0x0021"/> <!-- ! → ! --> diff --git a/data/keyboards/hangul-keyboard-3y.xml.template b/data/keyboards/hangul-keyboard-3y.xml.template index 67f0ae9..19d665b 100644 --- a/data/keyboards/hangul-keyboard-3y.xml.template +++ b/data/keyboards/hangul-keyboard-3y.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <hangul-keyboard id="3y" type="jaso-yet"> - <_name>Sebeolsik Yetgeul</_name> + <name>Sebeolsik Yetgeul</name> <map id="0"> <item key="0x21" value="0x11bd"/> <!-- ! → ᅟᅠᆽ --> diff --git a/data/keyboards/hangul-keyboard-ahn.xml.template b/data/keyboards/hangul-keyboard-ahn.xml.template index 0fa4d3c..04aa9ad 100644 --- a/data/keyboards/hangul-keyboard-ahn.xml.template +++ b/data/keyboards/hangul-keyboard-ahn.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <hangul-keyboard id="ahn" type="jaso"> - <_name>Ahnmatae</_name> + <name>Ahnmatae</name> <map id="0"> <item key="0x21" value="0x0021"/> <!-- ! → ! --> diff --git a/data/keyboards/hangul-keyboard-ro.xml.template b/data/keyboards/hangul-keyboard-ro.xml.template index 0f40813..4bf231b 100644 --- a/data/keyboards/hangul-keyboard-ro.xml.template +++ b/data/keyboards/hangul-keyboard-ro.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <hangul-keyboard id="ro" type="romaja"> - <_name>Romaja</_name> + <name>Romaja</name> <map id="0"> <item key="0x21" value="0x0021"/> <!-- ! → ! --> diff --git a/data/keyboards/its/hangul-keyboard.its b/data/keyboards/its/hangul-keyboard.its new file mode 100644 index 0000000..b62f4f5 --- /dev/null +++ b/data/keyboards/its/hangul-keyboard.its @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<!-- +See the gettext manual for ITS/LOC file formats: +http://www.gnu.org/software/gettext/manual/html_node/Preparing-ITS-Rules.html +--> +<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> + <its:translateRule selector="/hangul-keyboard" translate="no"/> + <its:translateRule selector="//name" translate="yes"/> +</its:rules> diff --git a/data/keyboards/its/hangul-keyboard.loc b/data/keyboards/its/hangul-keyboard.loc new file mode 100644 index 0000000..7705c5d --- /dev/null +++ b/data/keyboards/its/hangul-keyboard.loc @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +See the gettext manual for ITS/LOC file formats: +http://www.gnu.org/software/gettext/manual/html_node/Preparing-ITS-Rules.html +--> +<locatingRules> + <locatingRule name="hangul-keyboard" pattern="*.xml"> + <documentRule localName="hangul-keyboard" target="hangul-keyboard.its"/> + </locatingRule> +</locatingRules> |