[Makefile] Convert Traditional Chinese PO file to Simplified Chinese via OpenCC


Convert Traditional Chinese PO file to Simplified Chinese via OpenCC and sed in Makefile.

twpo2cn:
      @echo "\033[92mCheck if OpenCC exists ...\033[0m"
      @[ -x $(shell command -v opencc 2> /dev/null) ] || sudo apt-get install opencc
      @echo "\033[92mCreating zh_CN PO from zh_TW PO ...\033[0m"
      @[ -d $(LOCALE_DIR)/zh_CN/LC_MESSAGES/ ] || mkdir -p $(LOCALE_DIR)/zh_CN/LC_MESSAGES/
      @opencc -c zht2zhs.ini -i $(LOCALE_DIR)/zh_TW/LC_MESSAGES/messages.po -o $(LOCALE_DIR)/zh_CN/LC_MESSAGES/messages.po
      @sed 's/zh_TW/zh_CN/' -i $(LOCALE_DIR)/zh_CN/LC_MESSAGES/messages.po

Tested on Ubuntu Linux 15.10, opencc 0.4.3-2build1, GNU make 4.0-8.2.


References:

[1]

makefile test command exists

make - Check if a program exists from a Makefile - Stack Overflow