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.

fundraising.sh 914B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. inc_fundraising=true
  3. [ -z "$inc_filenames" ] && . "$basedir/build/filenames.sh"
  4. [ -z "$inc_languages" ] && . "$basedir/build/languages.sh"
  5. cache_fundraising(){
  6. cache_fundraising="$(for lang in $(get_languages); do
  7. if [ -f "$basedir/fundraising-${lang}.xml" ]; then
  8. echo -n " ${lang}:<$basedir/fundraising-${lang}.xml> "
  9. elif [ -f "$basedir/fundraising-en.xml" ]; then
  10. echo -n " ${lang}:<$basedir/fundraising-en.xml> "
  11. fi
  12. done)"
  13. }
  14. get_fundraisingfile(){
  15. # get the fundraising file for a given language
  16. # TODO: integrate with regular texts function
  17. lang="$1"
  18. if [ -n "$cache_fundraising" ]; then
  19. echo "$cache_fundraising" |sed -r 's;^.* '"$lang"':<([^>]+)> .*$;\1;p'
  20. elif [ -f "$basedir/fundraising-${lang}.xml" ]; then
  21. echo "$basedir/fundraising-${lang}.xml"
  22. elif [ -f "$basedir/fundraising-en.xml" ]; then
  23. echo "$basedir/fundraising-en.xml"
  24. fi
  25. }