Skip to content

Commit

Permalink
build: Simplify metadata.json string extraction
Browse files Browse the repository at this point in the history
Use the new JSONPath based extractor instead of marking translatable
strings in metadata.json.
  • Loading branch information
ueno committed May 11, 2015
1 parent 0a27a85 commit 0b45bb4
Show file tree
Hide file tree
Showing 38 changed files with 186 additions and 184 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

SUBDIRS = marisa-glib libkkc data tools tests po
SUBDIRS = marisa-glib libkkc tools data tests po
DISTCHECK_CONFIGURE_FLAGS = --enable-docs
ACLOCAL_AMFLAGS = -I m4

Expand Down
12 changes: 2 additions & 10 deletions data/rules/act/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,16 @@ files = \
keymap/latin.json \
keymap/wide-latin.json \
rom-kana/default.json \
$(NULL)
metadata_in = \
metadata.json.in \
metadata.json \
$(NULL)

nobase_rules_DATA = \
$(files) \
$(metadata_in:.in=) \
$(NULL)

EXTRA_DIST = \
$(files) \
$(metadata_in) \
$(NULL)

CLEANFILES = \
metadata.json \
$(NULL)

-include $(top_srcdir)/data/rules/rule.mk
include $(top_srcdir)/data/rules/rule.mk
-include $(top_srcdir)/git.mk
5 changes: 5 additions & 0 deletions data/rules/act/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "ACT",
"description": "Extended romaji input method based on AZIK for Dvorak keyboard layout, developed by Kiyoshi Kimura <http://hp.vector.co.jp/authors/VA002116/azik/azikindx.htm#act>",
"priority": 10
}
5 changes: 0 additions & 5 deletions data/rules/act/metadata.json.in

This file was deleted.

12 changes: 2 additions & 10 deletions data/rules/azik-jp106/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,16 @@ files = \
keymap/latin.json \
keymap/wide-latin.json \
rom-kana/default.json \
$(NULL)
metadata_in = \
metadata.json.in \
metadata.json \
$(NULL)

nobase_rules_DATA = \
$(files) \
$(metadata_in:.in=) \
$(NULL)

EXTRA_DIST = \
$(files) \
$(metadata_in) \
$(NULL)

CLEANFILES = \
metadata.json \
$(NULL)

-include $(top_srcdir)/data/rules/rule.mk
include $(top_srcdir)/data/rules/rule.mk
-include $(top_srcdir)/git.mk
5 changes: 5 additions & 0 deletions data/rules/azik-jp106/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "AZIK (Japanese 106 keyboard)",
"description": "Extended romaji input method developed by Kiyoshi Kimura <http://hp.vector.co.jp/authors/VA002116/azik/azikindx.htm>",
"priority": 10
}
5 changes: 0 additions & 5 deletions data/rules/azik-jp106/metadata.json.in

This file was deleted.

12 changes: 2 additions & 10 deletions data/rules/azik/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,16 @@ files = \
keymap/latin.json \
keymap/wide-latin.json \
rom-kana/default.json \
$(NULL)
metadata_in = \
metadata.json.in \
metadata.json \
$(NULL)

nobase_rules_DATA = \
$(files) \
$(metadata_in:.in=) \
$(NULL)

EXTRA_DIST = \
$(files) \
$(metadata_in) \
$(NULL)

CLEANFILES = \
metadata.json \
$(NULL)

-include $(top_srcdir)/data/rules/rule.mk
include $(top_srcdir)/data/rules/rule.mk
-include $(top_srcdir)/git.mk
5 changes: 5 additions & 0 deletions data/rules/azik/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "AZIK",
"description": "Extended romaji input method developed by Kiyoshi Kimura <http://hp.vector.co.jp/authors/VA002116/azik/azikindx.htm>",
"priority": 10
}
5 changes: 0 additions & 5 deletions data/rules/azik/metadata.json.in

This file was deleted.

12 changes: 2 additions & 10 deletions data/rules/default/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,16 @@ files = \
keymap/wide-latin.json \
keymap/direct.json \
rom-kana/default.json \
$(NULL)
metadata_in = \
metadata.json.in \
metadata.json \
$(NULL)

nobase_rules_DATA = \
$(files) \
$(metadata_in:.in=) \
$(NULL)

EXTRA_DIST = \
$(files) \
$(metadata_in) \
$(NULL)

CLEANFILES = \
metadata.json \
$(NULL)

-include $(top_srcdir)/data/rules/rule.mk
include $(top_srcdir)/data/rules/rule.mk
-include $(top_srcdir)/git.mk
5 changes: 5 additions & 0 deletions data/rules/default/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Default",
"description": "Default typing rule",
"priority": 99
}
5 changes: 0 additions & 5 deletions data/rules/default/metadata.json.in

This file was deleted.

12 changes: 2 additions & 10 deletions data/rules/kana/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,16 @@ files = \
keymap/wide-latin.json \
keymap/direct.json \
rom-kana/default.json \
$(NULL)
metadata_in = \
metadata.json.in \
metadata.json \
$(NULL)

nobase_rules_DATA = \
$(files) \
$(metadata_in:.in=) \
$(NULL)

EXTRA_DIST = \
$(files) \
$(metadata_in) \
$(NULL)

CLEANFILES = \
metadata.json \
$(NULL)

-include $(top_srcdir)/data/rules/rule.mk
include $(top_srcdir)/data/rules/rule.mk
-include $(top_srcdir)/git.mk
6 changes: 6 additions & 0 deletions data/rules/kana/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Kana",
"description": "Direct Kana typing",
"filter": "kana",
"priority": 99
}
6 changes: 0 additions & 6 deletions data/rules/kana/metadata.json.in

This file was deleted.

12 changes: 2 additions & 10 deletions data/rules/kzik/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,16 @@ files = \
keymap/latin.json \
keymap/wide-latin.json \
rom-kana/default.json \
$(NULL)
metadata_in = \
metadata.json.in \
metadata.json \
$(NULL)

nobase_rules_DATA = \
$(files) \
$(metadata_in:.in=) \
$(NULL)

EXTRA_DIST = \
$(files) \
$(metadata_in) \
$(NULL)

CLEANFILES = \
metadata.json \
$(NULL)

-include $(top_srcdir)/data/rules/rule.mk
include $(top_srcdir)/data/rules/rule.mk
-include $(top_srcdir)/git.mk
5 changes: 5 additions & 0 deletions data/rules/kzik/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "KZIK",
"description": "Extended romaji input method based on AZIK, developed by OHASHI Hideya <http://ohac.sytes.net/pukiwiki.php?kzik>",
"priority": 10
}
5 changes: 0 additions & 5 deletions data/rules/kzik/metadata.json.in

This file was deleted.

12 changes: 2 additions & 10 deletions data/rules/nicola/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,16 @@ files = \
keymap/wide-latin.json \
keymap/direct.json \
rom-kana/default.json \
$(NULL)
metadata_in = \
metadata.json.in \
metadata.json \
$(NULL)

nobase_rules_DATA = \
$(files) \
$(metadata_in:.in=) \
$(NULL)

EXTRA_DIST = \
$(files) \
$(metadata_in) \
$(NULL)

CLEANFILES = \
metadata.json \
$(NULL)

-include $(top_srcdir)/data/rules/rule.mk
include $(top_srcdir)/data/rules/rule.mk
-include $(top_srcdir)/git.mk
6 changes: 6 additions & 0 deletions data/rules/nicola/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "NICOLA",
"description": "Input method using thumb shift keyboard developed by the NICOLA (NIhongo-nyuuryoku COnsortium LAyout) project <http://nicola.sunicom.co.jp/index.html>",
"filter": "nicola",
"priority": 10
}
6 changes: 0 additions & 6 deletions data/rules/nicola/metadata.json.in

This file was deleted.

13 changes: 8 additions & 5 deletions data/rules/rule.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.SUFFIXES: .json .json.in
SUFFIXES = .json .pot

edit = sed -e 's!\(^ *"[^"]*": *\)_(\("[^"]*"\))!\1\2!g'
.json.in.json:
.json.pot:
$(AM_V_GEN) rm -f $@ $@.tmp; \
srcdir=''; \
test -f ./$< || srcdir=$(srcdir)/; \
$(edit) $${srcdir}$< >$@.tmp; \
mv $@.tmp $@
$(top_builddir)/tools/gen-metadata-pot $${srcdir}$< \
'$$.name' '$$.description' >$@.tmp && mv $@.tmp $@

metadata.pot: metadata.json $(top_srcdir)/tools/gen-metadata-pot.c

EXTRA_DIST += metadata.pot
12 changes: 2 additions & 10 deletions data/rules/tcode/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,16 @@ files = \
keymap/latin.json \
keymap/wide-latin.json \
rom-kana/default.json \
$(NULL)
metadata_in = \
metadata.json.in \
metadata.json \
$(NULL)

nobase_rules_DATA = \
$(files) \
$(metadata_in:.in=) \
$(NULL)

EXTRA_DIST = \
$(files) \
$(metadata_in) \
$(NULL)

CLEANFILES = \
metadata.json \
$(NULL)

-include $(top_srcdir)/data/rules/rule.mk
include $(top_srcdir)/data/rules/rule.mk
-include $(top_srcdir)/git.mk
5 changes: 5 additions & 0 deletions data/rules/tcode/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "T-Code",
"description": "Japanese direct input method developed by the T-Code project <http://openlab.jp/tcode/>",
"priority": 10
}
5 changes: 0 additions & 5 deletions data/rules/tcode/metadata.json.in

This file was deleted.

12 changes: 2 additions & 10 deletions data/rules/trycode/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,16 @@ files = \
keymap/latin.json \
keymap/wide-latin.json \
rom-kana/default.json \
$(NULL)
metadata_in = \
metadata.json.in \
metadata.json \
$(NULL)

nobase_rules_DATA = \
$(files) \
$(metadata_in:.in=) \
$(NULL)

EXTRA_DIST = \
$(files) \
$(metadata_in) \
$(NULL)

CLEANFILES = \
metadata.json \
$(NULL)

-include $(top_srcdir)/data/rules/rule.mk
include $(top_srcdir)/data/rules/rule.mk
-include $(top_srcdir)/git.mk
5 changes: 5 additions & 0 deletions data/rules/trycode/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "TRY-CODE",
"description": "Japanese direct input method based on T-Code, developed by Naoto Takahashi <http://www.m17n.org/ntakahas/npx/aggressive/aggressive4.en.html>",
"priority": 10
}
5 changes: 0 additions & 5 deletions data/rules/trycode/metadata.json.in

This file was deleted.

Loading

0 comments on commit 0b45bb4

Please sign in to comment.