Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mk-printable-en-xml.sh 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env bash
  2. # -----------------------------------------------------------------------------
  3. # Script to rebuild printable.en.xml
  4. # -----------------------------------------------------------------------------
  5. lang_bg="Български"
  6. lang_ca="Català"
  7. lang_cs="Česky"
  8. lang_da="Dansk"
  9. lang_de="Deutsch"
  10. lang_el="Ελληνικά"
  11. lang_en="English"
  12. lang_es="Español"
  13. lang_fi="Suomi"
  14. lang_fr="Français"
  15. lang_hu="Magyar"
  16. lang_it="Italiano"
  17. lang_ku="Kurdî"
  18. lang_mk="Mакедонски"
  19. lang_nl="Nederlands"
  20. lang_no="Norsk"
  21. lang_pl="Polski"
  22. lang_pt="Português"
  23. lang_ro="Română"
  24. lang_ru="Русский"
  25. lang_sl="Slovenščina"
  26. lang_sq="Shqip"
  27. lang_sr="Srpski"
  28. lang_sv="Svenska"
  29. lang_tr="Türkçe"
  30. rm --force printable.en.xml
  31. echo "<printableset>" >> printable.en.xml
  32. lastfile=""
  33. for i in $*; do
  34. dir=$(dirname $i)
  35. base=$(basename $i)
  36. file=$(echo -n $base | cut --delimiter="." --fields="1")
  37. lang=$(echo -n $base | cut --delimiter="." --fields="2")
  38. thetype=$(echo -n ${file} | cut --delimiter="-" --fields="1")
  39. langvar="lang_${lang}"
  40. moreinfo=$(xsltproc get_moreinfo.xsl $i)
  41. if [ "${file}" != "${lastfile}" ]; then
  42. if [ -n "${lastfile}" ]; then
  43. echo " </printable>" >> printable.en.xml
  44. fi
  45. echo -n " <printable" >> printable.en.xml
  46. echo -n " type=\"${thetype}\"" >> printable.en.xml
  47. echo -n " id=\"${dir}/${file}\"" >> printable.en.xml
  48. if [ -n "${moreinfo}" ]; then
  49. echo -n " moreinfo=\"${moreinfo}\"" >> printable.en.xml
  50. fi
  51. echo ">" >> printable.en.xml
  52. fi
  53. echo -n " <translation" >> printable.en.xml
  54. echo -n " lang=\"${lang}\"" >> printable.en.xml
  55. echo -n " langname=\"${!langvar}\">" >> printable.en.xml
  56. xsltproc get_h1.xsl $i >> printable.en.xml
  57. echo "</translation>" >> printable.en.xml
  58. lastfile=${file}
  59. done
  60. echo " </printable>" >> printable.en.xml
  61. echo "</printableset>" >> printable.en.xml