+2007-09-01 Bruno Haible <bruno@clisp.org>
+
+ Implement msgctxt for Java ResourceBundles.
+ * xgettext-java-7: New file.
+ * msgunfmt-java-1: Add a few messages with context.
+ * lang-java: Likewise.
+ * Makefile.am (TESTS): Add xgettext-java-7.
+ Suggested by Felix Berger.
+
2007-07-04 Bruno Haible <bruno@clisp.org>
* xgettext-php-3: Use string concatenation in the test.
xgettext-elisp-1 xgettext-elisp-2 \
xgettext-glade-1 xgettext-glade-2 xgettext-glade-3 \
xgettext-java-1 xgettext-java-2 xgettext-java-3 xgettext-java-4 \
- xgettext-java-5 xgettext-java-6 \
+ xgettext-java-5 xgettext-java-6 xgettext-java-7 \
xgettext-librep-1 xgettext-librep-2 \
xgettext-lisp-1 xgettext-lisp-2 \
xgettext-objc-1 xgettext-objc-2 \
System.out.println(GettextResource.gettext(catalog,"'Your command, please?', asked the waiter."));
System.out.println(MessageFormat.format(GettextResource.ngettext(catalog,"a piece of cake","{0,number} pieces of cake",n), new Object[] { new Integer(n) }));
System.out.println(MessageFormat.format(GettextResource.gettext(catalog,"{0} is replaced by {1}."), new Object[] { "FF", "EUR" }));
+ System.out.println(MessageFormat.format(GettextResource.npgettext(catalog,"++","a piece of cake","{0,number} pieces of cake",n), new Object[] { new Integer(n) }));
+ System.out.println(MessageFormat.format(GettextResource.pgettext(catalog,"++","{0} is replaced by {1}."), new Object[] { "FF", "EUR" }));
}
}
EOF
#, java-format
msgid "{0} is replaced by {1}."
msgstr ""
+
+#, java-format
+msgctxt "++"
+msgid "a piece of cake"
+msgid_plural "{0,number} pieces of cake"
+msgstr[0] ""
+msgstr[1] ""
+
+#, java-format
+msgctxt "++"
+msgid "{0} is replaced by {1}."
+msgstr ""
EOF
: ${DIFF=diff}
#, java-format
msgid "{0} is replaced by {1}."
msgstr "{1} remplace {0}."
+
+# Euphemistic formulation.
+#, java-format
+msgctxt "++"
+msgid "a piece of cake"
+msgid_plural "{0,number} pieces of cake"
+msgstr[0] "un morceau de gateau succulent"
+msgstr[1] "{0,number} morceaux de gateau succulent"
+
+# Euphemistic formulation.
+#, java-format
+msgctxt "++"
+msgid "{0} is replaced by {1}."
+msgstr "Le nouveau {1} remplace le vieux {0}."
EOF
tmpfiles="$tmpfiles fr.po.tmp fr.po.new"
«Votre commande, s'il vous plait», dit le garçon.
2 morceaux de gateau
EUR remplace FF.
+2 morceaux de gateau succulent
+Le nouveau EUR remplace le vieux FF.
EOF
cat <<\EOF > prog.oku
«Votre commande, s'il vous plait», dit le garçon.
2 morceaux de gateau
EUR remplace FF.
+2 morceaux de gateau succulent
+Le nouveau EUR remplace le vieux FF.
EOF
: ${LOCALE_FR=fr_FR}
#, java-format
msgid "{0} is replaced by {1}."
msgstr "{1} remplace {0}."
+
+# A proximity measure.
+msgid "Close"
+msgstr "Proche"
+
+# A menu entry.
+msgctxt "File"
+msgid "Close"
+msgstr "Fermer"
EOF
tmpfiles="$tmpfiles prog_fr.class"
msgid "'Your command, please?', asked the waiter."
msgstr "«Votre commande, s'il vous plait», dit le garçon."
+msgid "Close"
+msgstr "Proche"
+
+msgctxt "File"
+msgid "Close"
+msgstr "Fermer"
+
msgid "a piece of cake"
msgid_plural "{0,number} pieces of cake"
msgstr[0] "un morceau de gateau"