1 0 stevel #!/bin/sh 2 0 stevel # 3 0 stevel # CDDL HEADER START 4 0 stevel # 5 0 stevel # The contents of this file are subject to the terms of the 6 0 stevel # Common Development and Distribution License, Version 1.0 only 7 0 stevel # (the "License"). You may not use this file except in compliance 8 0 stevel # with the License. 9 0 stevel # 10 0 stevel # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11 0 stevel # or http://www.opensolaris.org/os/licensing. 12 0 stevel # See the License for the specific language governing permissions 13 0 stevel # and limitations under the License. 14 0 stevel # 15 0 stevel # When distributing Covered Code, include this CDDL HEADER in each 16 0 stevel # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17 0 stevel # If applicable, add the following below this CDDL HEADER, with the 18 0 stevel # fields enclosed by brackets "[]" replaced with your own identifying 19 0 stevel # information: Portions Copyright [yyyy] [name of copyright owner] 20 0 stevel # 21 0 stevel # CDDL HEADER END 22 0 stevel # 23 0 stevel # 24 0 stevel # Copyright 2005 Sun Microsystems, Inc. All rights reserved. 25 0 stevel # Use is subject to license terms. 26 0 stevel # 27 0 stevel # ident "%Z%%M% %I% %E% SMI" 28 0 stevel 29 0 stevel XGETTEXT=xgettext 30 0 stevel MSGDIR=$1 31 0 stevel 32 0 stevel # 33 0 stevel # Change Directory 34 0 stevel # 35 0 stevel cd ./port/gen 36 0 stevel rm -f *.po 37 0 stevel 38 0 stevel # 39 0 stevel # get list of files 40 0 stevel # 41 0 stevel FILES=`grep gettext *.c | sed "s/:.*//" | sort | sed "s/\.c//" | uniq` 42 0 stevel 43 0 stevel 44 0 stevel # 45 0 stevel # Create po files 46 0 stevel # No need for options for xgettext 47 0 stevel # 48 0 stevel for i in ${FILES} 49 0 stevel do 50 0 stevel cat ${i}.c | sed "s/_libc_gettext/gettext/" > ${i}.i 51 0 stevel ${XGETTEXT} ${i}.i 52 0 stevel cat messages.po | sed "/^domain/d" > ${i}.po 53 0 stevel rm -f ${i}.i messages.po 54 0 stevel done 55 0 stevel 56 0 stevel # 57 0 stevel # Create po files 58 0 stevel # Use -a 59 0 stevel # 60 0 stevel 61 0 stevel # First, create errlst.c, if it doesn't exist. 62 0 stevel # new_list.c is created as a side effect 63 0 stevel if [ ! -f errlst.c ]; then 64 0 stevel awk -f errlist.awk errlist 65 0 stevel rmerr="errlst.c new_list.c" 66 0 stevel else 67 0 stevel rmerr= 68 0 stevel fi 69 0 stevel 70 0 stevel for i in siglist errlst 71 0 stevel do 72 0 stevel cat ${i}.c | sed "s/_libc_gettext/gettext/" > ${i}.i 73 0 stevel ${XGETTEXT} -a ${i}.i 74 0 stevel cat messages.po | sed "/^domain/d" > ${i}.po 75 0 stevel rm -f ${i}.i messages.po 76 0 stevel done 77 0 stevel 78 0 stevel # 79 0 stevel # Copy .po files 80 0 stevel # 81 0 stevel cp *.po ${MSGDIR} 82 0 stevel 83 0 stevel # 84 0 stevel # And remove them 85 0 stevel # 86 0 stevel rm -f *.po ${rmerr} 87 0 stevel 88 0 stevel # 89 0 stevel # Change Directory 90 0 stevel # 91 0 stevel cd ../i18n 92 0 stevel rm -f messages.po regerror_msg.po 93 0 stevel 94 0 stevel # 95 0 stevel # regerror_msg.h 96 0 stevel # 97 0 stevel 98 0 stevel sed "s/_MSG/gettext/" regerror_msg.h > regerror_msg.i 99 0 stevel ${XGETTEXT} regerror_msg.i 100 0 stevel cat messages.po | sed "/^domain/d" > regerror_msg.po 101 0 stevel rm -f regerror_msg.i messages.po 102 0 stevel 103 0 stevel # 104 0 stevel # Copy .po file 105 0 stevel # 106 0 stevel cp regerror_msg.po ${MSGDIR} 107 0 stevel 108 0 stevel # And remove it 109 0 stevel 110 0 stevel rm -f regerror_msg.po 111