Home | History | Annotate | Line # | Download | only in tests
      1 #! /bin/sh
      2 
      3 # Test handling of obsolete/untranslated messages with Java .properties syntax.
      4 
      5 tmpfiles=""
      6 trap 'rm -fr $tmpfiles' 1 2 3 15
      7 
      8 tmpfiles="$tmpfiles mm-p-1.in1 mm-p-1.in2"
      9 cat <<EOF > mm-p-1.in1
     10 #
     11 # def.po
     12 #
     13 #: file:100
     14 not\ existing=but with translation
     15 
     16 #: file2:101
     17 !not\ existing\ without\ translation=
     18 
     19 #: file3:102
     20 still\ existing=translation
     21 
     22 #
     23 # trailing comments should be removed
     24 EOF
     25 
     26 cat <<EOF > mm-p-1.in2
     27 #
     28 # ref.po
     29 #
     30 #: file3:102
     31 still\ existing=here is normally no comment
     32 
     33 #: file4:10
     34 !untranslated=
     35 
     36 #
     37 # trailing comments should be removed, even here
     38 EOF
     39 
     40 tmpfiles="$tmpfiles mm-p-1.out"
     41 : ${MSGMERGE=msgmerge}
     42 ${MSGMERGE} -q --properties-input --properties-output -o mm-p-1.out mm-p-1.in1 mm-p-1.in2
     43 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     44 
     45 tmpfiles="$tmpfiles mm-p-1.ok"
     46 cat << EOF > mm-p-1.ok
     47 #: file3:102
     48 still\ existing=translation
     49 
     50 #: file4:10
     51 !untranslated=
     52 EOF
     53 
     54 : ${DIFF=diff}
     55 ${DIFF} mm-p-1.ok mm-p-1.out
     56 result=$?
     57 
     58 rm -fr $tmpfiles
     59 
     60 exit $result
     61