Skip to content

Commit

Permalink
doc: maintain po without no-location
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhys committed Dec 25, 2013
1 parent 057469a commit 5e5976d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
15 changes: 8 additions & 7 deletions build/makefiles/gettext.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ SUFFIXES += .pot .po .mo
all:

.pot.po:
msgmerge --quiet --update --sort-by-file $@ $<
msgmerge --quiet --sort-by-file --output-file=$*.edit.po $@ $<
msgcat --no-location --output $@ $*.edit.po
.po.mo:
msgfmt -o $@ $<

update: pot-build-stamp $(po_files)
update: pot-build-stamp $(edit_po_files) $(po_files)

if DOCUMENT_BUILDABLE
build: $(mo_files)
Expand All @@ -43,11 +44,11 @@ gettext: sphinx-ensure-updated
xgettext --language Python --output conf.pot ../../../source/conf.py

init: gettext
for pot in *.pot; do \
po=`basename $${pot} | sed -e 's,pot$$,po,g'`; \
test "$(FORCE_INIT)" = "yes" -o ! -f $${po} && \
msginit --input=$${pot} --output-file=$${po} --locale=$(LOCALE); \
:; \
for pot in *.pot; do \
edit_po=`basename $${pot} | sed -e 's,pot$$,edit.po,g'`; \
test "$(FORCE_INIT)" = "yes" -o ! -f $${edit_po} && \
msginit --input=$${pot} --output-file=$${edit_po} --locale=$(LOCALE); \
:; \
done

reinit:
Expand Down
14 changes: 14 additions & 0 deletions doc/update-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ find "themes" -type f | \
-e 's,pot$,po,' | \
list_paths "po_files_relative_from_locale_dir"

## edit.po file base paths
(cd locale/en/LC_MESSAGES; find . -type f -name '*.pot') | \
sed \
-e 's,^\./,,' \
-e 's,pot$,edit.po,' | \
list_paths "edit_po_files"

## edit.po file paths relative from locale/$LANG/ dir.
(cd locale/en/LC_MESSAGES; find . -type f -name '*.pot') | \
sed \
-e 's,^\.,LC_MESSAGES,' \
-e 's,pot$,edit.po,' | \
list_paths "edit_po_files_relative_from_locale_dir"

## mo file paths relative from locale/$LANG/ dir.
(cd locale/en/LC_MESSAGES; find . -type f -name '*.pot') | \
sed \
Expand Down

0 comments on commit 5e5976d

Please sign in to comment.