Build: use standard infrastructure for translations

We now use standard framework generatedby "gettextize" utility.

It has two limitations which I do not consider sufficiently important
to invest into hand-made solution:

1. It can automatically gather strings only from files which have some
   file extension like .c or .py. Right now we do not have any
   translatable strings in Python files without extensions. Given that these
   files will be removed from source tree and replaced with entry points
   from setuptools I do not see a reason to invest into supporting this.

2. It does not automatically strip untranslated strings from po files.
   This is a manual step in mainteiner's in workflow anyway so I will
   add separate Makefile target for it later on.

This commit contains gettextize instrastructure + filled-in files
Makevars and POTFILES.in.

https://fedorahosted.org/freeipa/ticket/6418

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
This commit is contained in:
Petr Spacek 2016-11-11 22:54:13 +01:00 committed by Martin Basti
parent 4225484356
commit 4842231074
15 changed files with 937 additions and 334 deletions

14
.gitignore vendored
View File

@ -1,3 +1,16 @@
# Autotools files - generated by autoreconf -i
/m4
# gettext infrastructure
/ABOUT-NLS
/po/*.gmo
/po/*~
/po/Makefile.in.in
/po/Makevars.template
/po/POTFILES
/po/remove-potcdate.sed
/po/stamp-po
# In-tree build files
configure
config.h
@ -16,6 +29,7 @@ aclocal.m4
autom4te.cache/
config.guess
config.log
config.rpath
config.status
config.sub
depcomp

View File

@ -1,3 +1,5 @@
ACLOCAL_AMFLAGS = -I m4
IPACLIENT_SUBDIRS = ipaclient ipalib ipaplatform ipapython
SUBDIRS = asn1 util client contrib daemons init install $(IPACLIENT_SUBDIRS) ipaserver ipatests po
@ -23,6 +25,7 @@ EXTRA_DIST = .mailmap \
ACI.txt \
API.txt \
BUILD.txt \
config.rpath \
Contributors.txt \
COPYING.openssl \
contrib \

View File

@ -1,4 +1,5 @@
AC_PREREQ(2.59)
AC_CONFIG_MACRO_DIRS([m4])
m4_include(VERSION.m4)
AC_INIT([freeipa],
IPA_VERSION,
@ -283,41 +284,18 @@ dnl ---------------------------------------------------------------------------
dnl Translations
dnl ---------------------------------------------------------------------------
AC_SUBST(GETTEXT_DOMAIN, [ipa])
AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
dnl integrate our custom hacks into gettextize infrastructure
AC_CONFIG_COMMANDS([po/Makefile-hackit],
[echo "include Makefile.hack" dnl
>> "${ac_abs_top_srcdir}/po/Makefile"])
AC_PROG_MKDIR_P
AC_PROG_AWK
AC_PROG_SED
AC_PATH_PROG(XGETTEXT, xgettext, [no])
if test "x$XGETTEXT" = "xno"; then
AC_MSG_ERROR([xgettext not found, install gettext])
fi
AC_PATH_PROG(MSGFMT, msgfmt, [no])
if test "x$MSGFMT" = "xno"; then
AC_MSG_ERROR([msgfmt not found, install gettext])
fi
AC_PATH_PROG(MSGINIT, msginit, [no])
if test "x$MSGINIT" = "xno"; then
AC_MSG_ERROR([msginit not found, install gettext])
fi
AC_PATH_PROG(MSGMERGE, msgmerge, [no])
if test "x$MSGMERGE" = "xno"; then
AC_MSG_ERROR([msgmerge not found, install gettext])
fi
AC_PATH_PROG(MSGCMP, msgcmp, [no])
if test "x$MSGCMP" = "xno"; then
AC_MSG_ERROR([msgcmp not found, install gettext])
fi
AC_PATH_PROG(MSGATTRIB, msgattrib, [no])
if test "x$MSGATTRIB" = "xno"; then
AC_MSG_ERROR([msgattrib not found, install gettext])
fi
dnl ---------------------------------------------------------------------------
dnl IPA platform
dnl ---------------------------------------------------------------------------
@ -546,7 +524,7 @@ AC_CONFIG_FILES([
ipasetup.py
ipatests/Makefile
ipatests/man/Makefile
po/Makefile
po/Makefile.in
util/Makefile
])

View File

@ -60,6 +60,7 @@ BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: gettext
BuildRequires: gettext-devel
BuildRequires: python-devel
%if 0%{?with_python3}
BuildRequires: python3-devel

View File

@ -1,225 +0,0 @@
prefix = @prefix@
exec_prefix = ${prefix}
datarootdir = ${prefix}/share
datadir = ${datarootdir}
localedir = ${datarootdir}/locale
INSTALL = @INSTALL@
AWK = @AWK@
SED = @SED@
MKDIR_P = @MKDIR_P@
XGETTEXT = @XGETTEXT@
MSGFMT = @MSGFMT@
MSGINIT = @MSGINIT@
MSGMERGE = @MSGMERGE@
MSGCMP = @MSGCMP@
MSGATTRIB = @MSGATTRIB@
IPA_TEST_I18N = ../ipatests/i18n.py
DOMAIN = @GETTEXT_DOMAIN@
MSGMERGE_UPDATE = $(MSGMERGE) --update
COPYRIGHT_HOLDER = Red Hat
PACKAGE_NAME = $(DOMAIN)
# An email address or URL where you can report bugs in the untranslated strings
PACKAGE_BUGREPORT = https://fedorahosted.org/freeipa/newticket
XGETTEXT_OPTIONS = \
--add-comments="TRANSLATORS:" \
--copyright-holder="$(COPYRIGHT_HOLDER)" \
--package-name="$(PACKAGE_NAME)" \
--msgid-bugs-address="$(PACKAGE_BUGREPORT)"
languages = $(shell $(SED) 's/\#.*//' LINGUAS) # The sed command removes comments
po_files = $(patsubst %, %.po, $(languages))
mo_files = $(patsubst %.po, %.mo, $(po_files))
po_count=$(words $(po_files))
PY_FILES = $(shell cd ..; git ls-files | grep -v -e "^ipatests/" -e "^doc/" -e "^po/" -e "^ipapython/test/" -e "setup.py" | grep "\.py$$" | tr '\n' ' '; cd po)
C_FILES = $(shell cd ..; git ls-files | grep "\.c$$" | tr '\n' ' '; cd po)
H_FILES = $(shell cd ..; git ls-files | grep "\.h$$" | tr '\n' ' '; cd po)
# Please keep this list sorted!
PY_EXPLICIT_FILES = \
client/ipa-client-install \
client/ipa-client-automount \
client/ipa-certupdate \
install/tools/ipa-adtrust-install \
install/tools/ipa-advise \
install/tools/ipa-backup \
install/tools/ipa-ca-install \
install/tools/ipa-compat-manage \
install/tools/ipa-csreplica-manage \
install/tools/ipactl \
install/tools/ipa-dns-install \
install/tools/ipa-httpd-kdcproxy \
install/tools/ipa-kra-install \
install/tools/ipa-ldap-updater \
install/tools/ipa-managed-entries \
install/tools/ipa-nis-manage \
install/tools/ipa-otptoken-import \
install/tools/ipa-replica-conncheck \
install/tools/ipa-replica-install \
install/tools/ipa-replica-manage \
install/tools/ipa-replica-prepare \
install/tools/ipa-restore \
install/tools/ipa-server-certinstall \
install/tools/ipa-server-install \
install/tools/ipa-server-upgrade \
install/tools/ipa-upgradeconfig \
ipa
PYTHON_POTFILES = $(PY_FILES) $(PY_EXPLICIT_FILES)
C_POTFILES = $(C_FILES) $(H_FILES)
.SUFFIXES:
.SUFFIXES: .po .mo
.PHONY: all create-po update-po update-pot install mostlyclean clean distclean distdir test mo-files debug strip-po merge-po $(po_files)
all:
check:
SUFFIXES = .po .mo
.po.mo:
@echo Creating $@; \
$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
$(po_files): $(DOMAIN).pot
@if [ ! -f $@ ]; then \
lang=`echo $@ | $(SED) -r -e 's/\.po$$//'` # Strip .po suffix ; \
echo Creating nonexistent $@, you should add this file to your SCM repository; \
$(MSGINIT) --locale $$lang --no-translator -i $(DOMAIN).pot -o $@; \
fi; \
echo Merging $(DOMAIN).pot into $@; \
$(MSGMERGE) --no-fuzzy-matching -o $@ $@ $(DOMAIN).pot
strip-po:
@for po_file in $(po_files); do \
echo Stripping $$po_file; \
$(MSGATTRIB) --translated --no-fuzzy --no-location $$po_file > $$po_file.tmp; \
mv $$po_file.tmp $$po_file; \
done
@export FILES_TO_REMOVE=`find . -name '*.po' -empty`; \
if [ "$$FILES_TO_REMOVE" != "" ]; then \
echo Removing empty translation files; \
rm -v $$FILES_TO_REMOVE; \
echo; echo Please remove the deleted files from LINGUAS!; echo; \
fi
create-po: $(DOMAIN).pot
@for po_file in $(po_files); do \
if [ ! -e $$po_file ]; then \
lang=`echo $$po_file | $(SED) -r -e 's/\.po$$//'` # Strip .po suffix ; \
echo Creating nonexistent $$po_file, you should add this file to your SCM repository; \
$(MSGINIT) --locale $$lang --no-translator -i $(DOMAIN).pot -o $$po_file; \
fi; \
done
merge-po: update-pot
$(MAKE) $(po_files)
update-po: merge-po
$(MAKE) strip-po
update-pot:
@rm -f $(DOMAIN).pot.update
@pushd .. ; \
$(XGETTEXT) $(XGETTEXT_OPTIONS) \
--output po/$(DOMAIN).pot.update \
--language="python" \
$(PYTHON_POTFILES) \
&& \
$(XGETTEXT) $(XGETTEXT_OPTIONS) \
--output po/$(DOMAIN).pot.update \
--join-existing \
--language="c" \
--from-code="UTF-8" \
--keyword='_' \
$(C_POTFILES) ; \
popd ; \
$(SED) '/^"POT-Creation-Date: .*"$$/d' $(DOMAIN).pot.update > $(DOMAIN).pot.update.tmp ; \
$(SED) -i -r -e 's%("Content-Type: text/plain; charset=)(.*)(\\n")%\1UTF-8\3%' $(DOMAIN).pot.update.tmp ; \
$(SED) '/^"POT-Creation-Date: .*"$$/d' $(DOMAIN).pot > $(DOMAIN).pot.tmp ; \
if ! cmp -s $(DOMAIN).pot.update.tmp $(DOMAIN).pot.tmp ; then \
echo "$(DOMAIN).pot updated" ; \
mv $(DOMAIN).pot.update $(DOMAIN).pot ; \
# Replace the charset with UTF-8 ; \
$(SED) -i -r -e 's%("Content-Type: text/plain; charset=)(.*)(\\n")%\1UTF-8\3%' $(DOMAIN).pot ; \
else \
echo "$(DOMAIN).pot unmodified" ; \
fi || :
@rm -f $(DOMAIN).pot.update $(DOMAIN).pot.update.tmp $(DOMAIN).pot.tmp
$(IPA_TEST_I18N) --show-strings --validate-pot $(DOMAIN).pot
msg-stats:
@pot_count=`$(MSGFMT) --statistics $(DOMAIN).pot 2>&1 | \
$(AWK) '{match($$0, /([0-9]+) translated messages, ([0-9]+) untranslated messages/, groups); \
printf "%s\n", groups[2];}'` ; \
echo "$(DOMAIN).pot has $$pot_count messages. There are $(po_count) po translation files." ; \
for po_file in $(po_files); do \
$(MSGFMT) --statistics $$po_file 2>&1 | \
$(AWK) -v po_file=$$po_file -v pot_count=$$pot_count -v pot_file=$(DOMAIN).pot \
'BEGIN {po_name = gensub(/\.po$$/, "", 1, po_file);} \
match($$0, /([[:digit:]]+) translated/, group) {translated = group[1]} \
match($$0, /([[:digit:]]+) untranslated/, group) {untranslated = group[1]} \
match($$0, /([[:digit:]]+) fuzzy/, group) {fuzzy = group[1]} \
END {pot_untranslated = pot_count - translated; \
ratio = sprintf("%d/%d", translated, pot_count); \
printf "%-7s %11s %5.1f%% %5d untranslated, %5d fuzzy\n", \
po_name ":", ratio, translated/pot_count*100.0, pot_untranslated, fuzzy;}'; \
done
mo-files: $(mo_files)
install: $(mo_files)
@for lang in $(languages); do \
dstdir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
$(MKDIR_P) $$dstdir; \
$(INSTALL) $$lang.mo $$dstdir/$(DOMAIN).mo; \
done
mostlyclean:
rm -rf *.mo test.po test_locale tmp.pot
rm -f $(DOMAIN).pot.update $(DOMAIN).pot.update.tmp $(DOMAIN).pot.tmp
clean: mostlyclean
distclean: clean
rm -f Makefile
distdir:
cp $(po_files) $(distdir)
cp $(DOMAIN).pot $(distdir)
cp LINGUAS Makefile.in README contributing_translators.txt $(distdir)
maintainer-clean: distclean
test:
$(IPA_TEST_I18N) --test-gettext
validate-pot:
$(IPA_TEST_I18N) --show-strings --validate-pot $(DOMAIN).pot
validate-po:
$(IPA_TEST_I18N) --show-strings --validate-po $(po_files)
validate-src-strings:
@rm -f tmp.pot
@touch tmp.pot
@$(MAKE) DOMAIN=tmp update-pot; \
status=$$?; \
rm tmp.pot; \
exit $$status
debug:
@echo Python potfiles:
@echo PY_FILES = $(PY_FILES)
@echo PY_EXPLICIT_FILES = $(PY_EXPLICIT_FILES)
@echo C potfiles:
@echo C_FILES = $(C_FILES)
@echo H_FILES = $(H_FILES)

80
po/Makevars Normal file
View File

@ -0,0 +1,80 @@
# Makefile variables for PO directory in any package using GNU gettext.
# Usually the message domain is the same as the package name.
DOMAIN = ipa
# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --from-code="UTF-8" --keyword=_
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
# package. (Note that the msgstr strings, extracted from the package's
# sources, belong to the copyright holder of the package.) Translators are
# expected to transfer the copyright for their translations to this person
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = Red Hat
# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU = no
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
# in the GNU gettext documentation, section 'Preparing Strings'.
# - Strings which use unclear terms or require additional context to be
# understood.
# - Strings which make invalid assumptions about notation of date, time or
# money.
# - Pluralisation problems.
# - Incorrect English spelling.
# - Incorrect formatting.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS = https://fedorahosted.org/freeipa/newticket
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# context. Possible values are "yes" and "no". Set this to yes if the
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = no
# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS = --no-fuzzy-matching
# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
MSGINIT_OPTIONS = --no-translator
# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
# FreeIPA downloads PO files from Zanata so we do not need to re-generate them.
PO_DEPENDS_ON_POT = no
# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = no

627
po/POTFILES.in Normal file
View File

@ -0,0 +1,627 @@
contrib/nssciphersuite/nssciphersuite.py
daemons/ipa-otpd/test.py
ignore_import_errors.py
install/migration/migration.py
install/share/copy-schema-to-ca.py
install/share/wsgi.py
install/wsgi/plugins.py
ipaclient/__init__.py
ipaclient/frontend.py
ipaclient/install/__init__.py
ipaclient/install/automount.py
ipaclient/install/client.py
ipaclient/install/ipa_client_install.py
ipaclient/ipa_certupdate.py
ipaclient/ipachangeconf.py
ipaclient/ipadiscovery.py
ipaclient/ntpconf.py
ipaclient/plugins/__init__.py
ipaclient/plugins/automember.py
ipaclient/plugins/automount.py
ipaclient/plugins/cert.py
ipaclient/plugins/certprofile.py
ipaclient/plugins/dns.py
ipaclient/plugins/hbacrule.py
ipaclient/plugins/hbactest.py
ipaclient/plugins/host.py
ipaclient/plugins/idrange.py
ipaclient/plugins/internal.py
ipaclient/plugins/location.py
ipaclient/plugins/migration.py
ipaclient/plugins/misc.py
ipaclient/plugins/otptoken.py
ipaclient/plugins/otptoken_yubikey.py
ipaclient/plugins/passwd.py
ipaclient/plugins/permission.py
ipaclient/plugins/rpcclient.py
ipaclient/plugins/server.py
ipaclient/plugins/service.py
ipaclient/plugins/sudorule.py
ipaclient/plugins/topology.py
ipaclient/plugins/trust.py
ipaclient/plugins/user.py
ipaclient/plugins/vault.py
ipaclient/remote_plugins/2_114/__init__.py
ipaclient/remote_plugins/2_114/aci.py
ipaclient/remote_plugins/2_114/automember.py
ipaclient/remote_plugins/2_114/automount.py
ipaclient/remote_plugins/2_114/batch.py
ipaclient/remote_plugins/2_114/cert.py
ipaclient/remote_plugins/2_114/config.py
ipaclient/remote_plugins/2_114/delegation.py
ipaclient/remote_plugins/2_114/dns.py
ipaclient/remote_plugins/2_114/group.py
ipaclient/remote_plugins/2_114/hbacrule.py
ipaclient/remote_plugins/2_114/hbacsvc.py
ipaclient/remote_plugins/2_114/hbacsvcgroup.py
ipaclient/remote_plugins/2_114/hbactest.py
ipaclient/remote_plugins/2_114/host.py
ipaclient/remote_plugins/2_114/hostgroup.py
ipaclient/remote_plugins/2_114/idrange.py
ipaclient/remote_plugins/2_114/idviews.py
ipaclient/remote_plugins/2_114/internal.py
ipaclient/remote_plugins/2_114/join.py
ipaclient/remote_plugins/2_114/krbtpolicy.py
ipaclient/remote_plugins/2_114/migration.py
ipaclient/remote_plugins/2_114/misc.py
ipaclient/remote_plugins/2_114/netgroup.py
ipaclient/remote_plugins/2_114/otpconfig.py
ipaclient/remote_plugins/2_114/otptoken.py
ipaclient/remote_plugins/2_114/otptoken_yubikey.py
ipaclient/remote_plugins/2_114/passwd.py
ipaclient/remote_plugins/2_114/permission.py
ipaclient/remote_plugins/2_114/ping.py
ipaclient/remote_plugins/2_114/pkinit.py
ipaclient/remote_plugins/2_114/privilege.py
ipaclient/remote_plugins/2_114/pwpolicy.py
ipaclient/remote_plugins/2_114/radiusproxy.py
ipaclient/remote_plugins/2_114/realmdomains.py
ipaclient/remote_plugins/2_114/role.py
ipaclient/remote_plugins/2_114/selfservice.py
ipaclient/remote_plugins/2_114/selinuxusermap.py
ipaclient/remote_plugins/2_114/service.py
ipaclient/remote_plugins/2_114/session.py
ipaclient/remote_plugins/2_114/sudocmd.py
ipaclient/remote_plugins/2_114/sudocmdgroup.py
ipaclient/remote_plugins/2_114/sudorule.py
ipaclient/remote_plugins/2_114/trust.py
ipaclient/remote_plugins/2_114/user.py
ipaclient/remote_plugins/2_156/__init__.py
ipaclient/remote_plugins/2_156/aci.py
ipaclient/remote_plugins/2_156/automember.py
ipaclient/remote_plugins/2_156/automount.py
ipaclient/remote_plugins/2_156/batch.py
ipaclient/remote_plugins/2_156/caacl.py
ipaclient/remote_plugins/2_156/cert.py
ipaclient/remote_plugins/2_156/certprofile.py
ipaclient/remote_plugins/2_156/config.py
ipaclient/remote_plugins/2_156/delegation.py
ipaclient/remote_plugins/2_156/dns.py
ipaclient/remote_plugins/2_156/domainlevel.py
ipaclient/remote_plugins/2_156/group.py
ipaclient/remote_plugins/2_156/hbacrule.py
ipaclient/remote_plugins/2_156/hbacsvc.py
ipaclient/remote_plugins/2_156/hbacsvcgroup.py
ipaclient/remote_plugins/2_156/hbactest.py
ipaclient/remote_plugins/2_156/host.py
ipaclient/remote_plugins/2_156/hostgroup.py
ipaclient/remote_plugins/2_156/idrange.py
ipaclient/remote_plugins/2_156/idviews.py
ipaclient/remote_plugins/2_156/internal.py
ipaclient/remote_plugins/2_156/join.py
ipaclient/remote_plugins/2_156/krbtpolicy.py
ipaclient/remote_plugins/2_156/migration.py
ipaclient/remote_plugins/2_156/misc.py
ipaclient/remote_plugins/2_156/netgroup.py
ipaclient/remote_plugins/2_156/otpconfig.py
ipaclient/remote_plugins/2_156/otptoken.py
ipaclient/remote_plugins/2_156/otptoken_yubikey.py
ipaclient/remote_plugins/2_156/passwd.py
ipaclient/remote_plugins/2_156/permission.py
ipaclient/remote_plugins/2_156/ping.py
ipaclient/remote_plugins/2_156/pkinit.py
ipaclient/remote_plugins/2_156/privilege.py
ipaclient/remote_plugins/2_156/pwpolicy.py
ipaclient/remote_plugins/2_156/radiusproxy.py
ipaclient/remote_plugins/2_156/realmdomains.py
ipaclient/remote_plugins/2_156/role.py
ipaclient/remote_plugins/2_156/selfservice.py
ipaclient/remote_plugins/2_156/selinuxusermap.py
ipaclient/remote_plugins/2_156/server.py
ipaclient/remote_plugins/2_156/service.py
ipaclient/remote_plugins/2_156/servicedelegation.py
ipaclient/remote_plugins/2_156/session.py
ipaclient/remote_plugins/2_156/stageuser.py
ipaclient/remote_plugins/2_156/sudocmd.py
ipaclient/remote_plugins/2_156/sudocmdgroup.py
ipaclient/remote_plugins/2_156/sudorule.py
ipaclient/remote_plugins/2_156/topology.py
ipaclient/remote_plugins/2_156/trust.py
ipaclient/remote_plugins/2_156/user.py
ipaclient/remote_plugins/2_156/vault.py
ipaclient/remote_plugins/2_164/__init__.py
ipaclient/remote_plugins/2_164/aci.py
ipaclient/remote_plugins/2_164/automember.py
ipaclient/remote_plugins/2_164/automount.py
ipaclient/remote_plugins/2_164/batch.py
ipaclient/remote_plugins/2_164/caacl.py
ipaclient/remote_plugins/2_164/cert.py
ipaclient/remote_plugins/2_164/certprofile.py
ipaclient/remote_plugins/2_164/config.py
ipaclient/remote_plugins/2_164/delegation.py
ipaclient/remote_plugins/2_164/dns.py
ipaclient/remote_plugins/2_164/domainlevel.py
ipaclient/remote_plugins/2_164/group.py
ipaclient/remote_plugins/2_164/hbacrule.py
ipaclient/remote_plugins/2_164/hbacsvc.py
ipaclient/remote_plugins/2_164/hbacsvcgroup.py
ipaclient/remote_plugins/2_164/hbactest.py
ipaclient/remote_plugins/2_164/host.py
ipaclient/remote_plugins/2_164/hostgroup.py
ipaclient/remote_plugins/2_164/idrange.py
ipaclient/remote_plugins/2_164/idviews.py
ipaclient/remote_plugins/2_164/internal.py
ipaclient/remote_plugins/2_164/join.py
ipaclient/remote_plugins/2_164/krbtpolicy.py
ipaclient/remote_plugins/2_164/migration.py
ipaclient/remote_plugins/2_164/misc.py
ipaclient/remote_plugins/2_164/netgroup.py
ipaclient/remote_plugins/2_164/otpconfig.py
ipaclient/remote_plugins/2_164/otptoken.py
ipaclient/remote_plugins/2_164/otptoken_yubikey.py
ipaclient/remote_plugins/2_164/passwd.py
ipaclient/remote_plugins/2_164/permission.py
ipaclient/remote_plugins/2_164/ping.py
ipaclient/remote_plugins/2_164/pkinit.py
ipaclient/remote_plugins/2_164/privilege.py
ipaclient/remote_plugins/2_164/pwpolicy.py
ipaclient/remote_plugins/2_164/radiusproxy.py
ipaclient/remote_plugins/2_164/realmdomains.py
ipaclient/remote_plugins/2_164/role.py
ipaclient/remote_plugins/2_164/selfservice.py
ipaclient/remote_plugins/2_164/selinuxusermap.py
ipaclient/remote_plugins/2_164/server.py
ipaclient/remote_plugins/2_164/service.py
ipaclient/remote_plugins/2_164/servicedelegation.py
ipaclient/remote_plugins/2_164/session.py
ipaclient/remote_plugins/2_164/stageuser.py
ipaclient/remote_plugins/2_164/sudocmd.py
ipaclient/remote_plugins/2_164/sudocmdgroup.py
ipaclient/remote_plugins/2_164/sudorule.py
ipaclient/remote_plugins/2_164/topology.py
ipaclient/remote_plugins/2_164/trust.py
ipaclient/remote_plugins/2_164/user.py
ipaclient/remote_plugins/2_164/vault.py
ipaclient/remote_plugins/2_49/__init__.py
ipaclient/remote_plugins/2_49/aci.py
ipaclient/remote_plugins/2_49/automember.py
ipaclient/remote_plugins/2_49/automount.py
ipaclient/remote_plugins/2_49/batch.py
ipaclient/remote_plugins/2_49/cert.py
ipaclient/remote_plugins/2_49/config.py
ipaclient/remote_plugins/2_49/delegation.py
ipaclient/remote_plugins/2_49/dns.py
ipaclient/remote_plugins/2_49/entitle.py
ipaclient/remote_plugins/2_49/group.py
ipaclient/remote_plugins/2_49/hbacrule.py
ipaclient/remote_plugins/2_49/hbacsvc.py
ipaclient/remote_plugins/2_49/hbacsvcgroup.py
ipaclient/remote_plugins/2_49/hbactest.py
ipaclient/remote_plugins/2_49/host.py
ipaclient/remote_plugins/2_49/hostgroup.py
ipaclient/remote_plugins/2_49/idrange.py
ipaclient/remote_plugins/2_49/internal.py
ipaclient/remote_plugins/2_49/join.py
ipaclient/remote_plugins/2_49/krbtpolicy.py
ipaclient/remote_plugins/2_49/migration.py
ipaclient/remote_plugins/2_49/misc.py
ipaclient/remote_plugins/2_49/netgroup.py
ipaclient/remote_plugins/2_49/passwd.py
ipaclient/remote_plugins/2_49/permission.py
ipaclient/remote_plugins/2_49/ping.py
ipaclient/remote_plugins/2_49/pkinit.py
ipaclient/remote_plugins/2_49/privilege.py
ipaclient/remote_plugins/2_49/pwpolicy.py
ipaclient/remote_plugins/2_49/role.py
ipaclient/remote_plugins/2_49/selfservice.py
ipaclient/remote_plugins/2_49/selinuxusermap.py
ipaclient/remote_plugins/2_49/service.py
ipaclient/remote_plugins/2_49/session.py
ipaclient/remote_plugins/2_49/sudocmd.py
ipaclient/remote_plugins/2_49/sudocmdgroup.py
ipaclient/remote_plugins/2_49/sudorule.py
ipaclient/remote_plugins/2_49/trust.py
ipaclient/remote_plugins/2_49/user.py
ipaclient/remote_plugins/__init__.py
ipaclient/remote_plugins/compat.py
ipaclient/remote_plugins/schema.py
ipalib/__init__.py
ipalib/aci.py
ipalib/backend.py
ipalib/base.py
ipalib/capabilities.py
ipalib/certstore.py
ipalib/cli.py
ipalib/config.py
ipalib/constants.py
ipalib/crud.py
ipalib/dns.py
ipalib/errors.py
ipalib/frontend.py
ipalib/install/__init__.py
ipalib/install/hostname.py
ipalib/install/service.py
ipalib/krb_utils.py
ipalib/messages.py
ipalib/output.py
ipalib/parameters.py
ipalib/pkcs10.py
ipalib/plugable.py
ipalib/request.py
ipalib/rpc.py
ipalib/text.py
ipalib/util.py
ipalib/x509.py
ipaplatform/base/__init__.py
ipaplatform/base/constants.py
ipaplatform/base/paths.py
ipaplatform/base/services.py
ipaplatform/base/tasks.py
ipaplatform/fedora/__init__.py
ipaplatform/fedora/constants.py
ipaplatform/fedora/paths.py
ipaplatform/fedora/services.py
ipaplatform/fedora/tasks.py
ipaplatform/redhat/__init__.py
ipaplatform/redhat/authconfig.py
ipaplatform/redhat/constants.py
ipaplatform/redhat/paths.py
ipaplatform/redhat/services.py
ipaplatform/redhat/tasks.py
ipaplatform/rhel/__init__.py
ipaplatform/rhel/constants.py
ipaplatform/rhel/paths.py
ipaplatform/rhel/services.py
ipaplatform/rhel/tasks.py
ipapython/__init__.py
ipapython/admintool.py
ipapython/certdb.py
ipapython/certmonger.py
ipapython/config.py
ipapython/cookie.py
ipapython/dn.py
ipapython/dnssec/__init__.py
ipapython/dnssec/abshsm.py
ipapython/dnssec/bindmgr.py
ipapython/dnssec/keysyncer.py
ipapython/dnssec/ldapkeydb.py
ipapython/dnssec/localhsm.py
ipapython/dnssec/odsmgr.py
ipapython/dnssec/syncrepl.py
ipapython/dnssec/temp.py
ipapython/dnsutil.py
ipapython/dogtag.py
ipapython/errors.py
ipapython/graph.py
ipapython/install/__init__.py
ipapython/install/cli.py
ipapython/install/common.py
ipapython/install/core.py
ipapython/install/typing.py
ipapython/install/util.py
ipapython/ipa_log_manager.py
ipapython/ipaldap.py
ipapython/ipautil.py
ipapython/ipavalidate.py
ipapython/kerberos.py
ipapython/kernel_keyring.py
ipapython/log_manager.py
ipapython/nsslib.py
ipapython/p11helper.py
ipapython/secrets/__init__.py
ipapython/secrets/client.py
ipapython/secrets/common.py
ipapython/secrets/kem.py
ipapython/secrets/store.py
ipapython/ssh.py
ipapython/sysrestore.py
ipaserver/__init__.py
ipaserver/advise/__init__.py
ipaserver/advise/base.py
ipaserver/advise/plugins/__init__.py
ipaserver/advise/plugins/fedora_authconfig.py
ipaserver/advise/plugins/legacy_clients.py
ipaserver/dcerpc.py
ipaserver/dns_data_management.py
ipaserver/install/__init__.py
ipaserver/install/adtrustinstance.py
ipaserver/install/bindinstance.py
ipaserver/install/ca.py
ipaserver/install/cainstance.py
ipaserver/install/certs.py
ipaserver/install/conncheck.py
ipaserver/install/custodiainstance.py
ipaserver/install/dns.py
ipaserver/install/dnskeysyncinstance.py
ipaserver/install/dogtag.py
ipaserver/install/dogtaginstance.py
ipaserver/install/dsinstance.py
ipaserver/install/httpinstance.py
ipaserver/install/installutils.py
ipaserver/install/ipa_backup.py
ipaserver/install/ipa_cacert_manage.py
ipaserver/install/ipa_kra_install.py
ipaserver/install/ipa_ldap_updater.py
ipaserver/install/ipa_otptoken_import.py
ipaserver/install/ipa_replica_install.py
ipaserver/install/ipa_replica_prepare.py
ipaserver/install/ipa_restore.py
ipaserver/install/ipa_server_certinstall.py
ipaserver/install/ipa_server_install.py
ipaserver/install/ipa_server_upgrade.py
ipaserver/install/ipa_winsync_migrate.py
ipaserver/install/kra.py
ipaserver/install/krainstance.py
ipaserver/install/krbinstance.py
ipaserver/install/ldapupdate.py
ipaserver/install/memcacheinstance.py
ipaserver/install/ntpinstance.py
ipaserver/install/odsexporterinstance.py
ipaserver/install/opendnssecinstance.py
ipaserver/install/otpdinstance.py
ipaserver/install/plugins/__init__.py
ipaserver/install/plugins/adtrust.py
ipaserver/install/plugins/ca_renewal_master.py
ipaserver/install/plugins/dns.py
ipaserver/install/plugins/fix_replica_agreements.py
ipaserver/install/plugins/rename_managed.py
ipaserver/install/plugins/update_ca_topology.py
ipaserver/install/plugins/update_dna_shared_config.py
ipaserver/install/plugins/update_idranges.py
ipaserver/install/plugins/update_ldap_server_list.py
ipaserver/install/plugins/update_managed_permissions.py
ipaserver/install/plugins/update_nis.py
ipaserver/install/plugins/update_pacs.py
ipaserver/install/plugins/update_passsync.py
ipaserver/install/plugins/update_referint.py
ipaserver/install/plugins/update_services.py
ipaserver/install/plugins/update_uniqueness.py
ipaserver/install/plugins/upload_cacrt.py
ipaserver/install/replication.py
ipaserver/install/schemaupdate.py
ipaserver/install/server/__init__.py
ipaserver/install/server/install.py
ipaserver/install/server/replicainstall.py
ipaserver/install/server/upgrade.py
ipaserver/install/service.py
ipaserver/install/sysupgrade.py
ipaserver/install/upgradeinstance.py
ipaserver/plugins/__init__.py
ipaserver/plugins/aci.py
ipaserver/plugins/automember.py
ipaserver/plugins/automount.py
ipaserver/plugins/baseldap.py
ipaserver/plugins/baseuser.py
ipaserver/plugins/batch.py
ipaserver/plugins/ca.py
ipaserver/plugins/caacl.py
ipaserver/plugins/cert.py
ipaserver/plugins/certprofile.py
ipaserver/plugins/config.py
ipaserver/plugins/delegation.py
ipaserver/plugins/dns.py
ipaserver/plugins/dnsserver.py
ipaserver/plugins/dogtag.py
ipaserver/plugins/domainlevel.py
ipaserver/plugins/group.py
ipaserver/plugins/hbac.py
ipaserver/plugins/hbacrule.py
ipaserver/plugins/hbacsvc.py
ipaserver/plugins/hbacsvcgroup.py
ipaserver/plugins/hbactest.py
ipaserver/plugins/host.py
ipaserver/plugins/hostgroup.py
ipaserver/plugins/idrange.py
ipaserver/plugins/idviews.py
ipaserver/plugins/internal.py
ipaserver/plugins/join.py
ipaserver/plugins/krbtpolicy.py
ipaserver/plugins/ldap2.py
ipaserver/plugins/location.py
ipaserver/plugins/migration.py
ipaserver/plugins/misc.py
ipaserver/plugins/netgroup.py
ipaserver/plugins/otp.py
ipaserver/plugins/otpconfig.py
ipaserver/plugins/otptoken.py
ipaserver/plugins/passwd.py
ipaserver/plugins/permission.py
ipaserver/plugins/ping.py
ipaserver/plugins/pkinit.py
ipaserver/plugins/privilege.py
ipaserver/plugins/pwpolicy.py
ipaserver/plugins/rabase.py
ipaserver/plugins/radiusproxy.py
ipaserver/plugins/realmdomains.py
ipaserver/plugins/role.py
ipaserver/plugins/schema.py
ipaserver/plugins/selfservice.py
ipaserver/plugins/selinuxusermap.py
ipaserver/plugins/server.py
ipaserver/plugins/serverrole.py
ipaserver/plugins/serverroles.py
ipaserver/plugins/service.py
ipaserver/plugins/servicedelegation.py
ipaserver/plugins/session.py
ipaserver/plugins/stageuser.py
ipaserver/plugins/sudo.py
ipaserver/plugins/sudocmd.py
ipaserver/plugins/sudocmdgroup.py
ipaserver/plugins/sudorule.py
ipaserver/plugins/topology.py
ipaserver/plugins/trust.py
ipaserver/plugins/user.py
ipaserver/plugins/vault.py
ipaserver/plugins/virtual.py
ipaserver/plugins/xmlserver.py
ipaserver/rpcserver.py
ipaserver/servroles.py
ipaserver/session.py
ipaserver/topology.py
lite-server.py
pylint_plugins.py
asn1/asn1c/BIT_STRING.c
asn1/asn1c/GKCurrentKeys.c
asn1/asn1c/GKNewKeys.c
asn1/asn1c/GKReply.c
asn1/asn1c/GetKeytabControl.c
asn1/asn1c/INTEGER.c
asn1/asn1c/Int32.c
asn1/asn1c/KrbKey.c
asn1/asn1c/NativeEnumerated.c
asn1/asn1c/NativeInteger.c
asn1/asn1c/OCTET_STRING.c
asn1/asn1c/TypeValuePair.c
asn1/asn1c/asn_SEQUENCE_OF.c
asn1/asn1c/asn_SET_OF.c
asn1/asn1c/asn_codecs_prim.c
asn1/asn1c/ber_decoder.c
asn1/asn1c/ber_tlv_length.c
asn1/asn1c/ber_tlv_tag.c
asn1/asn1c/constr_CHOICE.c
asn1/asn1c/constr_SEQUENCE.c
asn1/asn1c/constr_SEQUENCE_OF.c
asn1/asn1c/constr_SET_OF.c
asn1/asn1c/constr_TYPE.c
asn1/asn1c/constraints.c
asn1/asn1c/der_encoder.c
asn1/asn1c/per_decoder.c
asn1/asn1c/per_encoder.c
asn1/asn1c/per_opentype.c
asn1/asn1c/per_support.c
asn1/asn1c/xer_decoder.c
asn1/asn1c/xer_encoder.c
asn1/asn1c/xer_support.c
asn1/ipa_asn1.c
client/config.c
client/ipa-client-common.c
client/ipa-getkeytab.c
client/ipa-join.c
client/ipa-rmkeytab.c
daemons/ipa-kdb/ipa_kdb.c
daemons/ipa-kdb/ipa_kdb_audit_as.c
daemons/ipa-kdb/ipa_kdb_common.c
daemons/ipa-kdb/ipa_kdb_delegation.c
daemons/ipa-kdb/ipa_kdb_mkey.c
daemons/ipa-kdb/ipa_kdb_mspac.c
daemons/ipa-kdb/ipa_kdb_passwords.c
daemons/ipa-kdb/ipa_kdb_principals.c
daemons/ipa-kdb/ipa_kdb_pwdpolicy.c
daemons/ipa-kdb/tests/ipa_kdb_tests.c
daemons/ipa-otpd/bind.c
daemons/ipa-otpd/forward.c
daemons/ipa-otpd/main.c
daemons/ipa-otpd/parse.c
daemons/ipa-otpd/query.c
daemons/ipa-otpd/queue.c
daemons/ipa-otpd/stdio.c
daemons/ipa-sam/ipa_sam.c
daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap.c
daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_netlogon.c
daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_tests.c
daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_worker.c
daemons/ipa-slapi-plugins/ipa-dns/ipa_dns.c
daemons/ipa-slapi-plugins/ipa-enrollment/ipa_enrollment.c
daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_cmocka_tests.c
daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c
daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c
daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c
daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c
daemons/ipa-slapi-plugins/ipa-otp-counter/berval.c
daemons/ipa-slapi-plugins/ipa-otp-counter/ipa_otp_counter.c
daemons/ipa-slapi-plugins/ipa-otp-counter/ldapmod.c
daemons/ipa-slapi-plugins/ipa-otp-lasttoken/ipa_otp_lasttoken.c
daemons/ipa-slapi-plugins/ipa-pwd-extop/common.c
daemons/ipa-slapi-plugins/ipa-pwd-extop/encoding.c
daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
daemons/ipa-slapi-plugins/ipa-pwd-extop/otpctrl.c
daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c
daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c
daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen.c
daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_common.c
daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c
daemons/ipa-slapi-plugins/ipa-uuid/ipa_uuid.c
daemons/ipa-slapi-plugins/ipa-version/ipa_repl_version.c
daemons/ipa-slapi-plugins/ipa-winsync/ipa-winsync-config.c
daemons/ipa-slapi-plugins/ipa-winsync/ipa-winsync.c
daemons/ipa-slapi-plugins/libotp/hotp.c
daemons/ipa-slapi-plugins/libotp/otp_config.c
daemons/ipa-slapi-plugins/libotp/otp_token.c
daemons/ipa-slapi-plugins/libotp/t_hotp.c
daemons/ipa-slapi-plugins/topology/topology_agmt.c
daemons/ipa-slapi-plugins/topology/topology_cfg.c
daemons/ipa-slapi-plugins/topology/topology_init.c
daemons/ipa-slapi-plugins/topology/topology_post.c
daemons/ipa-slapi-plugins/topology/topology_pre.c
daemons/ipa-slapi-plugins/topology/topology_util.c
util/ipa_krb5.c
util/ipa_pwd.c
util/ipa_pwd_ntlm.c
asn1/asn1c/BIT_STRING.h
asn1/asn1c/GKCurrentKeys.h
asn1/asn1c/GKNewKeys.h
asn1/asn1c/GKReply.h
asn1/asn1c/GetKeytabControl.h
asn1/asn1c/INTEGER.h
asn1/asn1c/Int32.h
asn1/asn1c/KrbKey.h
asn1/asn1c/NativeEnumerated.h
asn1/asn1c/NativeInteger.h
asn1/asn1c/OCTET_STRING.h
asn1/asn1c/TypeValuePair.h
asn1/asn1c/asn_SEQUENCE_OF.h
asn1/asn1c/asn_SET_OF.h
asn1/asn1c/asn_application.h
asn1/asn1c/asn_codecs.h
asn1/asn1c/asn_codecs_prim.h
asn1/asn1c/asn_internal.h
asn1/asn1c/asn_system.h
asn1/asn1c/ber_decoder.h
asn1/asn1c/ber_tlv_length.h
asn1/asn1c/ber_tlv_tag.h
asn1/asn1c/constr_CHOICE.h
asn1/asn1c/constr_SEQUENCE.h
asn1/asn1c/constr_SEQUENCE_OF.h
asn1/asn1c/constr_SET_OF.h
asn1/asn1c/constr_TYPE.h
asn1/asn1c/constraints.h
asn1/asn1c/der_encoder.h
asn1/asn1c/per_decoder.h
asn1/asn1c/per_encoder.h
asn1/asn1c/per_opentype.h
asn1/asn1c/per_support.h
asn1/asn1c/xer_decoder.h
asn1/asn1c/xer_encoder.h
asn1/asn1c/xer_support.h
asn1/ipa_asn1.h
client/ipa-client-common.h
daemons/ipa-kdb/ipa_kdb.h
daemons/ipa-kdb/ipa_kdb_mspac_private.h
daemons/ipa-otpd/internal.h
daemons/ipa-sam/ipa_sam.h
daemons/ipa-slapi-plugins/common/util.h
daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap.h
daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
daemons/ipa-slapi-plugins/ipa-otp-counter/berval.h
daemons/ipa-slapi-plugins/ipa-otp-counter/ldapmod.h
daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h
daemons/ipa-slapi-plugins/ipa-pwd-extop/otpctrl.h
daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen.h
daemons/ipa-slapi-plugins/ipa-winsync/ipa-winsync.h
daemons/ipa-slapi-plugins/libotp/hotp.h
daemons/ipa-slapi-plugins/libotp/otp_config.h
daemons/ipa-slapi-plugins/libotp/otp_token.h
daemons/ipa-slapi-plugins/topology/topology.h
util/ipa_krb5.h
util/ipa_mspac.h
util/ipa_pwd.h

118
po/README
View File

@ -1,34 +1,18 @@
Q: I've added a new source file, how do I make sure it's strings get translated?
A: Edit Makefile.in and add the source file to the appropriate *_POTFILES list.
Then run "make update-po".
NOTE: Now this i only necessary for python files that lack the .py
extension. All .py, .c and .h files are automatically sourced.
Q: Untranslated strings and file locations are missing from my .po file.
How do I add them?
A: make merge-po
Untranslated strings are left out of the files in SCM. The merge-po command
runs msgmerge to add them again.
A: Add the source file to the POTFILES.in list. Then run "make ipa.pot-update".
Q: How do I pick up new strings to translate from the source files after the
source have been modified?
A: make merge-po
A: make ipa.pot-update
This regenerates the pot template file by scanning all the source files.
Then the new strings are merged into each .po file from the new pot file.
Q: How do I just regenerate the pot template file without regenerating all the
.po files?
A: make update-pot
Q: I am done translating. How do I commit my changes?
A: Run `make strip-po` to remove unneeded information from the po files, then
add your changes to SCM.
A: make ipa.pot-update
Q: How do I add a new language for translation?
@ -51,13 +35,15 @@ A: The files Makefile.in, LINGUAS control the build, they must be in the SCM.
Be careful, .po files may be automatically updated when the source files
change (or the .pot changes, usually the .pot file changes only as a result
of rescanning the source files). This mean a .po file might be automatically
updated while a translator has the file out for editing, all the caveats
about SCM merging apply.
updated while a file from translation service is being downloaded.
If there is a conflict, you should generate new pot file,
upload it do the translation service, and re-download the po files.
Q: Which are automatically generated and thus do not need to be in SCM?
A: The *.mo files are automatically generated on demand from their corresponding
.po file.
A: The *.gmo files are automatically generated on demand from their
corresponding .po file.
Q: What role does the .pot file play?
@ -65,79 +51,55 @@ A: The .pot file is called a template file. It is generated by scanning all the
source files (e.g. *.py *.c *.h) in the project using xgettext. xgettext
locates every translatable string (e.g. strings marked with _()) and adds
that string along with metadata about it's location to the .pot file. Thus
the .pot file is a collection of every translatable string in the project. If
you edit a source file and add a translatable string you will have to
the .pot file is a collection of every translatable string in the project.
If you edit a source file and add a translatable string you will have to
regenerate the .pot file in order to pick up the new string.
This template file needs to be uploaded from time to time to translation
service so translators can translate new and updated strings incrementally.
Q: What is the relationship between a .po file and the .pot file?
A: A .po file contains the translations for particular language. It derives from
the .pot file. When the .pot file is updated with new strings to translate
each .po will merge the new strings in. The .po file is where translators
work providing translations for their language. Thus it's important the .po
not be recreated from scratch and is kept in SCM, otherwise the translators
work will be lost.
A: A .po file contains the translations for particular language. It derives
from the .pot file. When the .pot file is updated with new strings
to translate each .po will merge the new strings in.
Previously the .po file was where translators worked providing translations
for their language.
Today the work is done inside translation service Zanata so the .po files
are kept in SCM just for the case of failure in the translation service.
Q: What is the transation workflow?
Let's use an example for French, it's .po file will be fr.po.
1) Developer creates main.c with one translatable sting _("Begin").
2) Produce the .pot file by running xgettext on main.c
2) Maintainer produces the .pot file by running make ipa.pot-update.
3) .pot file contains one msgid, "Begin"
3) .pot file contains one msgid, "Begin".
4) fr.po is created from the .pot file, it also contains one msgid, "Begin"
4) Maintainer uploads .pot file is to Zanata translation service:
$ zanata-cli push
(all the parameters are taken from zanata.xml file)
5) Translator edits fr.po and provide the French translation of "Begin".
5) Translator uses Zanata service to provide the French translation
of "Begin".
6) Developer adds new translatable sting _("End") to main.c
5) Maintainer download fr.po is generated by Zanata service,
it also contains one msgid, "Begin".
$ zanata-cli pull
7) Generate a new .pot file by running xgettext on main.c
6) Maintainer strips untranslated strings from .po files
to make diffs smaller:
$ make strip-po
8) .pot file contains two msgid's, "Begin", and "End"
7) Maintainer commits new .po files to Git.
9) fr.po is missing the new msgid in the .pot file, so the .pot is merged
into fr.po by running msgmerge. This copies into fr.po the new "End" msgid
but preserves the existing translations in fr.po (e.g. "Begin"). The fr.po
will now have 2 msgid's one which is translated already (e.g. "Begin") and
one that untranslated (e.g. "End").
Q: What are .gmo files?
10) Sometime later the French translator comes back to see if he/she needs to
add more translations to fr.po. They see there is a missing translation,
they check fr.po out from SCM, add the missing translation, and then
check fr.po back into SCM.
This means at any given moment the set of .po files will have varying degrees
of translation completeness. Because the .po files are merged when the source
code files are updated existing translations are not lost. It also means a
.po file which was fully translated may need new translations after a .pot
update. It is permissible to have incomplete translations in a message
catalog, at run time if a translation for a particular string is available in
the message catalog the user will be presented with the string in their
language. However if the string is not yet translated in the .po file then
they just get the original string (typically in English).
Q: What are .mo files?
A: .mo files are the content of a .po file but in "machine" format for fast
A: .gmo files are the content of a .po file but in "machine" format for fast
run time access (mo = Machine Object, po = Portable Object). .mo files are
what gets installed along with the package. Think of a .po as a source file
which is compiled into a object file for run time use.
Q: Why don't we use gettexize and autopoint?
A: Because the framework they produce is too limited. Specifically there is no
way to pass the source language to xgettext when it scans a file. xgettext
only knows how to automatically determine the language from the source files
extension. However we have many files without extensions, thus we have to
group all Python (et. al.) files together and run xgettext on every file *we*
know to Python (because xgettext can't figure this out itself if there is no
file extension). There is another added benefit of avoiding gettextize and
autopoint, simplicity. Managing translations is complex and hard enough as it
is, gettextize and autopoint adds another whole layer of complexity which
just further obscures things.
Q: Who created the awful mess and who do I ask when things don't work as I
expect or I have further questions?
A: John Dennis <jdennis@redhat.com>
Credits:
- GNU project
- John Dennis <jdennis@redhat.com> for his work on the original system

58
po/Rules-quot Normal file
View File

@ -0,0 +1,58 @@
# This file, Rules-quot, can be copied and used freely without restrictions.
# Special Makefile rules for English message catalogs with quotation marks.
DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
.SUFFIXES: .insert-header .po-update-en
en@quot.po-create:
$(MAKE) en@quot.po-update
en@boldquot.po-create:
$(MAKE) en@boldquot.po-update
en@quot.po-update: en@quot.po-update-en
en@boldquot.po-update: en@boldquot.po-update-en
.insert-header.po-update-en:
@lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
tmpdir=`pwd`; \
echo "$$lang:"; \
ll=`echo $$lang | sed -e 's/@.*//'`; \
LC_ALL=C; export LC_ALL; \
cd $(srcdir); \
if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \
| $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \
{ case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \
$(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \
;; \
*) \
$(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \
;; \
esac } 2>/dev/null > $$tmpdir/$$lang.new.po \
; then \
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
rm -f $$tmpdir/$$lang.new.po; \
else \
if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
:; \
else \
echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
exit 1; \
fi; \
fi; \
else \
echo "creation of $$lang.po failed!" 1>&2; \
rm -f $$tmpdir/$$lang.new.po; \
fi
en@quot.insert-header: insert-header.sin
sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
en@boldquot.insert-header: insert-header.sin
sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
mostlyclean: mostlyclean-quot
mostlyclean-quot:
rm -f *.insert-header

10
po/boldquot.sed Normal file
View File

@ -0,0 +1,10 @@
s/"\([^"]*\)"/“\1”/g
s/`\([^`']*\)'/\1/g
s/ '\([^`']*\)' / \1 /g
s/ '\([^`']*\)'$/ \1/g
s/^'\([^`']*\)' /\1 /g
s/“”/""/g
s///g
s//”/g
s///g
s///g

25
po/en@boldquot.header Normal file
View File

@ -0,0 +1,25 @@
# All this catalog "translates" are quotation characters.
# The msgids must be ASCII and therefore cannot contain real quotation
# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
# and double quote (0x22). These substitutes look strange; see
# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
#
# This catalog translates grave accent (0x60) and apostrophe (0x27) to
# left single quotation mark (U+2018) and right single quotation mark (U+2019).
# It also translates pairs of apostrophe (0x27) to
# left single quotation mark (U+2018) and right single quotation mark (U+2019)
# and pairs of quotation mark (0x22) to
# left double quotation mark (U+201C) and right double quotation mark (U+201D).
#
# When output to an UTF-8 terminal, the quotation characters appear perfectly.
# When output to an ISO-8859-1 terminal, the single quotation marks are
# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
# grave/acute accent (by libiconv), and the double quotation marks are
# transliterated to 0x22.
# When output to an ASCII terminal, the single quotation marks are
# transliterated to apostrophes, and the double quotation marks are
# transliterated to 0x22.
#
# This catalog furthermore displays the text between the quotation marks in
# bold face, assuming the VT100/XTerm escape sequences.
#

22
po/en@quot.header Normal file
View File

@ -0,0 +1,22 @@
# All this catalog "translates" are quotation characters.
# The msgids must be ASCII and therefore cannot contain real quotation
# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
# and double quote (0x22). These substitutes look strange; see
# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
#
# This catalog translates grave accent (0x60) and apostrophe (0x27) to
# left single quotation mark (U+2018) and right single quotation mark (U+2019).
# It also translates pairs of apostrophe (0x27) to
# left single quotation mark (U+2018) and right single quotation mark (U+2019)
# and pairs of quotation mark (0x22) to
# left double quotation mark (U+201C) and right double quotation mark (U+201D).
#
# When output to an UTF-8 terminal, the quotation characters appear perfectly.
# When output to an ISO-8859-1 terminal, the single quotation marks are
# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
# grave/acute accent (by libiconv), and the double quotation marks are
# transliterated to 0x22.
# When output to an ASCII terminal, the single quotation marks are
# transliterated to apostrophes, and the double quotation marks are
# transliterated to 0x22.
#

23
po/insert-header.sin Normal file
View File

@ -0,0 +1,23 @@
# Sed script that inserts the file called HEADER before the header entry.
#
# At each occurrence of a line starting with "msgid ", we execute the following
# commands. At the first occurrence, insert the file. At the following
# occurrences, do nothing. The distinction between the first and the following
# occurrences is achieved by looking at the hold space.
/^msgid /{
x
# Test if the hold space is empty.
s/m/m/
ta
# Yes it was empty. First occurrence. Read the file.
r HEADER
# Output the file's contents by reading the next line. But don't lose the
# current line while doing this.
g
N
bb
:a
# The hold space was nonempty. Following occurrences. Do nothing.
x
:b
}

6
po/quot.sed Normal file
View File

@ -0,0 +1,6 @@
s/"\([^"]*\)"/“\1”/g
s/`\([^`']*\)'/\1/g
s/ '\([^`']*\)' / \1 /g
s/ '\([^`']*\)'$/ \1/g
s/^'\([^`']*\)' /\1 /g
s/“”/""/g

19
po/remove-potcdate.sin Normal file
View File

@ -0,0 +1,19 @@
# Sed script that remove the POT-Creation-Date line in the header entry
# from a POT file.
#
# The distinction between the first and the following occurrences of the
# pattern is achieved by looking at the hold space.
/^"POT-Creation-Date: .*"$/{
x
# Test if the hold space is empty.
s/P/P/
ta
# Yes it was empty. First occurrence. Remove the line.
g
d
bb
:a
# The hold space was nonempty. Following occurrences. Do nothing.
x
:b
}