<NME> Makefile
<BEF> NAME = gnome-shell-screenshot
UUID = $(NAME)@ttll.de
SCHEMA = org.gnome.shell.extensions.screenshot.gschema.xml

LANGUAGES = bg ca cs de el es eu fr id_ID it pl pt_BR ru tr uk zh_CN nl

all: update_dependencies
	make archive

update_dependencies:
	git submodule update --init

-include gselib/make/gnome-shell-extension.mk

SOURCE += src/empty64.png res/org.freedesktop.portal.Screenshot.xml
src/locale/gnome-shell-screenshot.pot: $(SOURCE_JAVASCRIPT)
	xgettext -k_ -kN_ -o $@ $(sort $^)

$(ZIPFILE): $(SOURCE) schemas
	-rm $(ZIPFILE)
	cd src && zip -r ../$(ZIPFILE) $(patsubst src/%,%,$(SOURCE))

<MSG> Add Makefile targets for translations

Targets for updating and compiling po-files.

<DFF> @@ -40,6 +40,21 @@ src/schemas/gschemas.compiled: src/schemas/$(SCHEMA)
 src/locale/gnome-shell-screenshot.pot: $(SOURCE_JAVASCRIPT)
 	xgettext -k_ -kN_ -o $@ $(sort $^)
 
+# TODO Create new translation
+#
+# src/locale/%.po: src/locale/gnome-shell-screenshot.pot
+# 	msginit \
+# 	  --no-translator \
+# 	  --input=$^ \
+# 	  --output-file=$@ \
+# 	  --locale=de_DE.utf8 # FIXME replace this
+
+src/locale/%.po: src/locale/gnome-shell-screenshot.pot
+	msgmerge --backup=none --update $@ $^
+
+src/locale/%/LC_MESSAGES/gnome-shell-screenshot.mo: src/locale/%/*.po
+	msgfmt $^ --output-file=$@
+
 $(ZIPFILE): $(SOURCE) schemas
 	-rm $(ZIPFILE)
 	cd src && zip -r ../$(ZIPFILE) $(patsubst src/%,%,$(SOURCE))

Add Makefile targets for translations