2 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 PACKAGE=wrt_engine_daemon
20 ALL_SOURCE_FILES=`cd ..; find -name \*.h -o -name \*.cpp -o -name \*.c`
21 POTFILES_LIST=$(cd ..; grep "_(\"" ${ALL_SOURCE_FILES} -c | grep -v :0 | cut -d: -f1)
22 for i in $POTFILES_LIST
27 #ALL_LINGUAS= am az be ca cs da de el en_CA en_GB es et fi fr hr hu it ja ko lv mk ml ms nb ne nl pa pl pt pt_BR ru rw sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW
28 ALL_LINGUAS="en_US en_GB ja ko zh_CN"
30 XGETTEXT=/usr/bin/xgettext
31 MSGMERGE=/usr/bin/msgmerge
33 echo -n "Make ${PACKAGE}.pot "
34 if [ ! -e $POTFILES ] ; then
35 echo "$POTFILES not found"
39 $XGETTEXT --default-domain=${PACKAGE} --directory=${SRCROOT} \
40 --add-comments --keyword=_ --keyword=N_ --files-from=$POTFILES \
41 && test ! -f ${PACKAGE}.po \
42 || (rm -f ${PACKAGE}.pot && mv ${PACKAGE}.po ${PACKAGE}.pot)
51 for LANG in $ALL_LINGUAS; do
54 if [ ! -e $LANG.po ] ; then
55 sed 's/CHARSET/UTF-8/g' ${PACKAGE}.pot > ${LANG}.po
56 echo "${LANG}.po created"
58 if $MSGMERGE ${LANG}.po ${PACKAGE}.pot -o ${LANG}.new.po ; then
59 if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then
62 if mv -f ${LANG}.new.po ${LANG}.po; then
65 echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2
71 echo "msgmerge for $LANG failed!"