summaryrefslogtreecommitdiff
path: root/make/po4a.mk
blob: 508935c29d6988d0359360fb50644521d6742fc7 (plain)
  1. package = PACKAGE
  2. module = MODULE
  3. version = VERSION
  4. locale = LOCALE
  5. # override with e.g. htmltemplate when handling non-Markdown files
  6. fileformat = text
  7. # Percentage of l10n completed to be acceptable
  8. threshold = 100
  9. # l10nfiles: relative paths to localizable files
  10. # Invoke from inside basedir of master files
  11. # potfile: path to POT file
  12. mkpot:
  13. po4a-gettextize -M UTF-8 -L UTF-8 -f "$(fileformat)" -o markdown $(patsubst %,-m %,$(l10nfiles)) -p "$(potfile)"
  14. sed -i \
  15. -e 's/^# SOME DESCRIPTIVE TITLE/# $(locale) translation of $(module) pages for $(package)./' \
  16. -e '/^# This file/ s/PACKAGE/$(package)/' \
  17. -e '/^"Project-Id-Version:/ s/PACKAGE/$(package) $(module)/' \
  18. -e '/^"Project-Id-Version:/ s/VERSION/$(version)/' \
  19. -e '/^"Content-Type:/ s/CHARSET/UTF-8/' \
  20. -e '/^"Content-Transfer-Encoding:/ s/ENCODING/8bit/' \
  21. "$(potfile)"
  22. # Invoke from root dir of translated files
  23. # masterdir: path to dir containing untranslated files
  24. # pofile: path to PO file
  25. mkpo:
  26. po4a-gettextize -M UTF-8 -L UTF-8 -f "$(fileformat)" -o markdown $(patsubst %,-m %,$(l10nfiles)) $(patsubst %,-l $(masterdir)/%,$(l10nfiles)) -p "$(pofile)"
  27. # Invoke from inside basedir of master files
  28. # pofile: path to PO file
  29. updatepo:
  30. po4a-updatepo -M UTF-8 -f "$(fileformat)" -o markdown $(patsubst %,-m %,$(l10nfiles)) -p "$(pofile)"
  31. # Invoke from root dir of translated files
  32. # masterdir: path to dir containing untranslated files
  33. # pofile: path to PO file
  34. $(l10nfiles): % : $(masterdir)/%
  35. po4a-translate -M UTF-8 -L UTF-8 -k "$(threshold)" -f "$(fileformat)" -o markdown $(patsubst %,-m $(masterdir)/%,$@) -p "$(pofile)" -l "$@"
  36. .PHONY: mkpot mkpo $(l10nfiles)