ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [mdk-re] gettext and Makefiles
@ 2002-03-25 10:01 Alexandre Prokoudine
  2002-03-25 10:17 ` Grigory Batalov
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Prokoudine @ 2002-03-25 10:01 UTC (permalink / raw)
  To: mandrake-russian

Привет всем!

Имеем вот такой текст: в Makefile из папки locale, где должен лежать PO-файл

# locale/Makefile
#
# Matt Brubeck 2002-01-12
# based on the locale makefile from wxWindows 2.2.9
#  
# This is the makefile for generating the message catalog file and
# building lang.mo files from the translated lang.po catalogs.
# This makefile may be invoked to build either audacity.pot or any lang.mo

# Autodetect the languages we support.	Currently this relies on make
# being called with this dir as the cwd, but if we generate this file
# with configure an explicit path should be specified -- RL.

WX_LINGUAS := `ls *.po 2> /dev/null | sed -n 's/^\(.*\)\.po$$/\1/p'`

# the programs we use (TODO: use configure to detect them)
MSGFMT=msgfmt -v
MSGMERGE=msgmerge
XGETTEXT=xgettext
XARGS=xargs

# common xgettext args: C++ syntax, use the specified macro names as markers
XGETTEXT_ARGS=-C -k_ -kwxGetTranslation -kwxTRANSLATE -s -j

# implicit rules
%.mo: %.po
	$(MSGFMT) -o $@ $<

# a PO file must be updated from the template to include new translations
POTFILE=audacity.pot 

%.po: $(POTFILE)
	if [ -f $@ ]; then $(MSGMERGE) $@ $(POTFILE) > $@.new && mv $@.new $@; \
	else cp $(POTFILE) $@; fi

$(POTFILE):
	touch $@
	find ../src -name "*.h" \
		| $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o $(POTFILE)
	find ../src -name "*.cpp" \
		| $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o $(POTFILE)

allpo: update
	@for t in $(WX_LINGUAS); do $(MAKE) $$t.po; done

allmo:
	@for t in $(WX_LINGUAS); do $(MAKE) $$t.mo; done

update:
	$(RM) $(POTFILE)
	$(MAKE) $(POTFILE)

# targets depending on this one will be always remade
FORCE:

.PHONY: allpo allmo force-update


Вопрос: КАК сделать из всего этого обычный PO-файл, который можно редактировать?

Заранее спасибо!

--
А.П.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-03-25 10:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-25 10:01 [mdk-re] gettext and Makefiles Alexandre Prokoudine
2002-03-25 10:17 ` Grigory Batalov
2002-03-25 10:46   ` Alexandre Prokoudine

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git