diff options
author | David Cantrell <dcantrell@redhat.com> | 2009-05-27 17:00:49 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2009-06-03 09:28:49 -1000 |
commit | 777301cc123cb78631939caad3038ade24d724b6 (patch) | |
tree | cb66b823d6ebc53f0728e0e9bd3ab6593d97315e /po | |
parent | 6104124defc97a4f65d31c1cc5c09e0716f6f3c1 (diff) | |
download | anaconda-777301cc123cb78631939caad3038ade24d724b6.tar.gz anaconda-777301cc123cb78631939caad3038ade24d724b6.tar.xz anaconda-777301cc123cb78631939caad3038ade24d724b6.zip |
Use gettext.ldngettext when necessary (#467603)
The i18n people have suggested using ngettext when we need to have
singular and plural forms of strings, where the count will vary as to
what we are reporting to the user.
I've made the changes they have suggested. I created a new lambda
function called P_() to use for the plural cases. P_() takes in three
parameters:
1) The singular form of the string.
2) The plural form of the string.
3) A count.
Here's an example:
....some loop runs doing stuff
bytesWritten = 47
msg = P_("Wrote %d byte.",
"Wrote %d bytes.",
bytesWritten) % (bytesWritten,)
print msg
The % substitution is correct at the end because P_() returns a single
string, so we only need the format string to account for that.
Some strings have been changed slightly to make it easier for
translations to other languages, particularly when choosing plural forms.
Diffstat (limited to 'po')
-rw-r--r-- | po/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/po/Makefile b/po/Makefile index 6e5b1d2bf..b33aee7f5 100644 --- a/po/Makefile +++ b/po/Makefile @@ -28,9 +28,9 @@ all: $(FMTCATALOGS) $(NLSPACKAGE).pot: $(POTFILES) $(NONPOTFILES) intltool-po xgettext --from-code=UTF-8 --default-domain=$(NLSPACKAGE) \ - --keyword=_ --keyword=N_ --lang=python $(PYPOTFILES) + --keyword=_ --keyword=N_ --keyword=P_:1,2 --lang=python $(PYPOTFILES) xgettext --from-code=UTF-8 --default-domain=$(NLSPACKAGE) -j \ - --keyword=_ --keyword=N_ --lang=c $(CPOTFILES) tmp/*.h + --keyword=_ --keyword=N_ --keyword=P_:1,2 --lang=c $(CPOTFILES) tmp/*.h cat ../lang-table | cut -f1 | while read line; do echo -e "\n#. generated from lang-table\nmsgid \"$$line\"\nmsgstr \"\""; done >> $(NLSPACKAGE).po if cmp -s $(NLSPACKAGE).po $(NLSPACKAGE).pot; then \ rm -f $(NLSPACKAGE).po; \ |