renamed wxstd.po to wxstd.pot so that it uses standard gettext extension for catalog templates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2007-11-12 10:12:49 +00:00
parent 36e1bcaf99
commit a2b18c5746
6 changed files with 25 additions and 25 deletions

View File

@ -433,7 +433,7 @@ copy *.def \wxmsw_dist\wxMSW\samples\internat
copy *.rc \wxmsw_dist\wxMSW\samples\internat
copy *.ico \wxmsw_dist\wxMSW\samples\internat
copy readme.txt \wxmsw_dist\wxMSW\samples\internat
copy wxstd.po \wxmsw_dist\wxMSW\samples\internat
copy wxstd.pot \wxmsw_dist\wxMSW\samples\internat
cd fr
md \wxmsw_dist\wxMSW\samples\internat\fr
copy *.?o \wxmsw_dist\wxMSW\samples\internat\fr

View File

@ -271,12 +271,12 @@ wxWidgets uses the standard GNU gettext tools for i18n so if you are already
familiar with them you shouldn't have any problems with working on wxWidgets
translations. Here are the the steps you should follow:
<ol>
<li>Get the latest version of the file <tt>locale/wxstd.po</tt> from the
<li>Get the latest version of the file <tt>locale/wxstd.pot</tt> from the
wxWidgets source tree: if you&#39;re using <a href="cvs.htm">cvs</a>
or the <a href="http://wxwindows.sf.net/snapshots/">daily snapshots</a>,
you should already have it. Otherwise you can always
retrieve it directly from the cvs repository via the Web interface
<a href="http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/locale/wxstd.po">here</a>.
<a href="http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/locale/wxstd.pot">here</a>.
<li>Rename it to <tt>XY.po</tt> where <tt>"XY"</tt> is the 2 letter
<a href="http://lcweb.loc.gov/standards/iso639-2/englangn.html">ISO 639-1 language code</a>

View File

@ -36,9 +36,9 @@ Now a brief overview of the process of translations (please refer to GNU
gettext documentation for more details). It happens in several steps:
1. the strings to translate are extracted from the C++ sources using xgettext
program into a wxstd.po file which is a "text message catalog"
program into a wxstd.pot file which is a "text message catalog"
2. this new wxstd.po file (recreated each time some new text messages are added
2. this new wxstd.pot file (recreated each time some new text messages are added
to wxWidgets) is merged with existing translations in another .po file (for
example, de.po) and replaces this file (this is done using the program
msgmerge)

View File

@ -1,14 +1,14 @@
# this is the makefile for generating wxstd.po message catalog file and
# this is the makefile for generating wxstd.pot message catalog file and
# building lang.mo files from the translated lang.po catalogs
# this makefile may be invoked to build either wxstd.po or any lang.mo
# this makefile may be invoked to build either wxstd.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 := $(shell ls *.po */*.po 2> /dev/null | sed 's/wxstd.po//g' | sed 's/.po//g')
WX_LINGUAS_UPDATE := $(shell ls *.po 2> /dev/null | sed 's/wxstd.po//g' | sed 's/.po//g')
WX_LINGUAS := $(shell ls *.po */*.po 2> /dev/null | sed 's/wxstd.pot//g' | sed 's/.po//g')
WX_LINGUAS_UPDATE := $(shell ls *.po 2> /dev/null | sed 's/wxstd.pot//g' | sed 's/.po//g')
# the programs we use (TODO: use configure to detect them)
MSGFMT=msgfmt --verbose
@ -23,19 +23,19 @@ XGETTEXT_ARGS=-C -k_ -kwxPLURAL:1,2 -kwxTRANSLATE -s -j
%.mo: %.po
$(MSGFMT) -c -o $@ $<
# a PO file must be updated from wxstd.po to include new translations
%.po: wxstd.po
if [ -f $@ ]; then $(MSGMERGE) $@ wxstd.po > $@.new && mv $@.new $@; else cp wxstd.po $@; fi
# a PO file must be updated from wxstd.pot to include new translations
%.po: wxstd.pot
if [ -f $@ ]; then $(MSGMERGE) $@ wxstd.pot > $@.new && mv $@.new $@; else cp wxstd.pot $@; fi
# note the extra -kAddToPopUp used for Scintilla files: this is a hack to
# translate the popup menu items
wxstd.po:
wxstd.pot:
touch $@
find ../include -name "*.h" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.po
find ../src -name "*.cpp" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.po
find ../contrib/include -name "*.h" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.po
find ../contrib/src -name "*.cpp" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.po
find ../contrib/src/stc/scintilla/src -name "*.cxx" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -kAddToPopUp -o wxstd.po
find ../include -name "*.h" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.pot
find ../src -name "*.cpp" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.pot
find ../contrib/include -name "*.h" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.pot
find ../contrib/src -name "*.cpp" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -o wxstd.pot
find ../contrib/src/stc/scintilla/src -name "*.cxx" | $(XARGS) $(XGETTEXT) $(XGETTEXT_ARGS) -kAddToPopUp -o wxstd.pot
allpo: force-update
@-for t in $(WX_LINGUAS_UPDATE); do $(MAKE) $$t.po; done
@ -44,7 +44,7 @@ allmo:
@for t in $(WX_LINGUAS); do $(MAKE) $$t.mo; done
force-update:
$(RM) wxstd.po
$(RM) wxstd.pot
# print out the percentage of the translated strings
stats: FORCE

View File

@ -47,20 +47,20 @@ A. First of all, you will need the GNU gettext tools (see the next question).
xgettext -C -n -k_ -kwxPLURAL:1,2 -kwxTRANSLATE -o internat.po ../internat.cpp
# .po file for wxWindows might be generated in the same way. An already
# generated wxstd.po as well as translations for some languages can be
# generated wxstd.pot as well as translations for some languages can be
# found in the locale directory.
cp ../../locale/<language>.po ./wxstd.po
cp ../../locale/<language>.po ./wxstd.pot
- or -
cp ../../locale/wxstd.po .
cp ../../locale/wxstd.pot .
# now edit the files and do translate strings (this isn't done by gettext)
# you can use another editor if you wish :-) No need to edit wxstd.po if you
# you can use another editor if you wish :-) No need to edit wxstd.pot if you
# already got a translated one.
vi internat.po wxstd.po
vi internat.po wxstd.pot
# create the message catalog files
msgfmt -o internat.mo internat.po
msgfmt -o wxstd.mo wxstd.po
msgfmt -o wxstd.mo wxstd.pot
# run the sample to test it
cd ..