summaryrefslogtreecommitdiff
path: root/make/po4a.mk
blob: 9a093203ef0f17ab4676f26e532e5bbe7f56f1a4 (plain)
  1. # override with e.g. htmltemplate when handling non-Markdown files
  2. fileformat = text
  3. # Percentage of l10n completed to be acceptable
  4. threshold = 100
  5. # l10nfiles: relative paths to localizable files
  6. # Invoke from inside basedir of master files
  7. # potfile: path to POT file
  8. mkpot:
  9. po4a-gettextize -M UTF-8 -L UTF-8 -f "$(fileformat)" -o markdown $(patsubst %,-m %,$(l10nfiles)) -p "$(potfile)"
  10. # Invoke from root dir of translated files
  11. # masterdir: path to dir containing untranslated files
  12. # pofile: path to PO file
  13. mkpo:
  14. po4a-gettextize -M UTF-8 -L UTF-8 -f "$(fileformat)" -o markdown $(patsubst %,-m %,$(l10nfiles)) $(patsubst %,-l $(masterdir)/%,$(l10nfiles)) -p "$(pofile)"
  15. # Invoke from inside basedir of master files
  16. # pofile: path to PO file
  17. updatepo:
  18. po4a-updatepo -M UTF-8 -f "$(fileformat)" -o markdown $(patsubst %,-m %,$(l10nfiles)) -p "$(pofile)"
  19. # Invoke from root dir of translated files
  20. # masterdir: path to dir containing untranslated files
  21. # pofile: path to PO file
  22. $(l10nfiles): % : $(masterdir)/%
  23. po4a-translate -M UTF-8 -L UTF-8 -k "$(threshold)" -f "$(fileformat)" -o markdown $(patsubst %,-m $(masterdir)/%,$@) -p "$(pofile)" -l "$@"
  24. .PHONY: mkpot mkpo $(l10nfiles)