<commit_before>#!/bin/bash
# mozdev
cd $(dirname $(cygpath -u $(cygpath -m -s "${0}")))/..
[ -d xpi ] || mkdir xpi
cd xpi
rm -fr mozdev/
rsync -a --exclude-from=../src-tb3/make-exclude.txt ../src-tb3/* mozdev/
cd mozdev/chrome/locale
for locale in *
do
  for file in ${locale}/*.properties
  do
    echo ${file}
    grep -q '=$' ${file}      # Check if file has untranslated strings
    if [ $? -eq 0 ]
    then
      while read line
      do
        if expr index "${line}" '=' > /dev/null
        then
          untranslatedstring="^#${line%%=*}=$"
          untranslatedstring="${untranslatedstring/\#\#/#}"
          untranslatedstring="${untranslatedstring/\{/\\{}"
          untranslatedstring="${untranslatedstring/\}/\}}"
          sed -r "s/${untranslatedstring//\//\\/}/${line//\//\\/}/" ${file} > ${file}.new
          mv ${file}.new ${file}
        fi
      done < en-US/$(basename ${file})
    fi
  done
done
for locale in *
do
  for file in ${locale}/*.dtd
  do
    echo ${file}
    grep -q '""' ${file}      # Check if file has untranslated strings
    if [ $? -eq 0 ]
    then
      while read line
      do
        if expr match "${line}" '<!ENTITY' > /dev/null
        then
          untranslatedstring="${line%%\"*}\"\" -->"
          untranslatedstring="${untranslatedstring/ENTITY/-- ENTITY}"
          sed -r "s/${untranslatedstring//\//\\/}/${line//\//\\/}/" ${file} > ${file}.new
          mv ${file}.new ${file}
        fi
      done < en-US/$(basename ${file})
    fi
  done
done
cd ..
zip -r -D -0 mailredirect.jar content/ locale/ skin/ skin-moz/
cd ../..
grep -v em:unpack ../src-tb3/install.rdf > mozdev/install.rdf
sed -r "s/chrome\//jar:chrome\/mailredirect.jar!\//" ../src-tb3/chrome.manifest > mozdev/chrome.manifest
version=`grep em:version ../src-tb3/install.rdf | sed -r "s/^[^>]*>//" | sed -r "s/<.*$//"`
cd mozdev
rm mailredirect-${version}.xpi 2> /dev/null
zip -r -D mailredirect-${version}.xpi install.rdf chrome.manifest chrome/mailredirect.jar chrome/icons/ defaults/ LICENSE
cd ..
read -p "Press any key to continue . . . " -n 1
<commit_msg>Leave unpack="true" in install.rdf because it's needed for window icon<commit_after>#!/bin/bash
# mozdev
cd $(dirname $(cygpath -u $(cygpath -m -s "${0}")))/..
[ -d xpi ] || mkdir xpi
cd xpi
rm -fr mozdev/
rsync -a --exclude-from=../src-tb3/make-exclude.txt ../src-tb3/* mozdev/
cd mozdev/chrome/locale
for locale in *
do
  for file in ${locale}/*.properties
  do
    echo ${file}
    grep -q '=$' ${file}      # Check if file has untranslated strings
    if [ $? -eq 0 ]
    then
      while read line
      do
        if expr index "${line}" '=' > /dev/null
        then
          untranslatedstring="^#${line%%=*}=$"
          untranslatedstring="${untranslatedstring/\#\#/#}"
          untranslatedstring="${untranslatedstring/\{/\\{}"
          untranslatedstring="${untranslatedstring/\}/\}}"
          sed -r "s/${untranslatedstring//\//\\/}/${line//\//\\/}/" ${file} > ${file}.new
          mv ${file}.new ${file}
        fi
      done < en-US/$(basename ${file})
    fi
  done
done
for locale in *
do
  for file in ${locale}/*.dtd
  do
    echo ${file}
    grep -q '""' ${file}      # Check if file has untranslated strings
    if [ $? -eq 0 ]
    then
      while read line
      do
        if expr match "${line}" '<!ENTITY' > /dev/null
        then
          untranslatedstring="${line%%\"*}\"\" -->"
          untranslatedstring="${untranslatedstring/ENTITY/-- ENTITY}"
          sed -r "s/${untranslatedstring//\//\\/}/${line//\//\\/}/" ${file} > ${file}.new
          mv ${file}.new ${file}
        fi
      done < en-US/$(basename ${file})
    fi
  done
done
cd ..
zip -r -D -0 mailredirect.jar content/ locale/ skin/ skin-moz/
cd ../..
sed -r "s/chrome\//jar:chrome\/mailredirect.jar!\//" ../src-tb3/chrome.manifest > mozdev/chrome.manifest
version=`grep em:version ../src-tb3/install.rdf | sed -r "s/^[^>]*>//" | sed -r "s/<.*$//"`
cd mozdev
rm mailredirect-${version}.xpi 2> /dev/null
zip -r -D mailredirect-${version}.xpi install.rdf chrome.manifest chrome/mailredirect.jar chrome/icons/ defaults/ LICENSE
cd ..
read -p "Press any key to continue . . . " -n 1

{'fraction_non_alphanumeric': 0.20408163265306123, 'fraction_numerical': 0.005042016806722689, 'mean_word_length': 2.1560606060606062, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1821368', 'n_tokens_mistral': 1522, 'n_tokens_neox': 1446, 'n_words': 380}