Skip to content

Commit

Permalink
Modernize translation infrastructure
Browse files Browse the repository at this point in the history
- Use xgettext to extract translations from desktop file directly,
  avoiding the need to use intltool
- Make git ignore translation build artifacts
  • Loading branch information
mvz committed Dec 26, 2020
1 parent 0811e90 commit 7414636
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions po/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@ POT=./alexandria.pot

RUBY=../bin/alexandria $(shell find ../lib -name '*.rb' -and -not -path '*macui*')

GLADE=$(shell find ../share/alexandria/glade -name '*.glade')
DESKTOP=../alexandria.desktop

HEADERS=$(shell find .. -name '*.h')
GLADE=$(shell find ../share/alexandria/glade -name '*.glade')

PO=$(wildcard *.po)

$(POT): $(RUBY) $(GLADE) ../alexandria.desktop.in.h $(HEADERS)
$(POT): $(RUBY) $(GLADE) $(DESKTOP)
rm -f $(POT)
@echo Updating PO template from Ruby files
@rxgettext --output=$(POT) $(RUBY)
@echo Updating PO template from Glade files
@xgettext --output=$(POT) --join-existing $(GLADE)
@echo Updating PO template from header files
@xgettext --output=$(POT) --join-existing --extract-all $(HEADERS)

../alexandria.desktop.in.h: ../alexandria.desktop.in
intltool-extract --type=gettext/ini ../alexandria.desktop.in
@echo Updating PO template from desktop file
@xgettext --output=$(POT) --join-existing $(DESKTOP)

$(PO): $(POT)
msgmerge -U $@ $(POT)
Expand Down

0 comments on commit 7414636

Please sign in to comment.