Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added complex ordering case from sprintf documentation of Perl, outpu…

…t validation information added (should be some JS with green/red flag probably?), fixed update_locale.sh
  • Loading branch information...
commit 95efe61a1d1e323a093a527dbcbf8cc64b07134c 1 parent eb1e163
@Getty authored
View
6 t/20-locale-simple.t
@@ -49,4 +49,10 @@ is(
"changing position test"
);
+is(
+ l("Other change order test %s %s %s",1,2,3),
+ 'Verhalten aus http://perldoc.perl.org/functions/sprintf.html 3 1 1',
+ "other changing position test"
+);
+
done_testing;
View
2  t/data/locale/de_DE/LC_MESSAGES/othertest.json
@@ -1 +1 @@
-{"":{"Plural-Forms":" nplurals=2; plural=n != 1;","MIME-Version":" 1.0","POT-Creation-Date":" 2009-06-14 09:29-0400","Language":" de_DE","Last-Translator":" Community","Content-Type":" text/plain; charset=UTF-8","Language-Team":" DuckDuckGo Community <community@duckduckgo.com>","PO-Revision-Date":" 2009-06-14 09:29-0400","Content-Transfer-Encoding":" 8bit","Project-Id-Version":" DuckDuckGo-Translation-0.000"},"Other":[null,"Anderes"],"Umlaut-Test":[null,"Dies ist ein Ümläut"],"Hello":[null,"Anderes Hallo"],"Change order test %s %s":[null,"Ganz andere Reihenfolge hier %2$s %1$s"],"You have %d message":["You have %d messages","Du hast %d AndereNachricht","Du hast %d AndereNachrichten"]}
View
2  t/data/locale/de_DE/LC_MESSAGES/test.json
@@ -1 +1 @@
-locale_data['test'] = {"":{"Plural-Forms":" nplurals=2; plural=n != 1;","MIME-Version":" 1.0","POT-Creation-Date":" 2009-06-14 09:29-0400","Language":" de_DE","Last-Translator":" Community","Content-Type":" text/plain; charset=UTF-8","Language-Team":" DuckDuckGo Community <community@duckduckgo.com>","PO-Revision-Date":" 2009-06-14 09:29-0400","Content-Transfer-Encoding":" 8bit","Project-Id-Version":" DuckDuckGo-Translation-0.000"},"Hello":[null,"Hallo"],"Change order test %s %s":[null,"Andere Reihenfolge hier %2$s %1$s"],"You have %d message of %s":["You have %d messages of %s","Du hast %d Nachricht von %s","Du hast %d Nachrichten von %s"],"You have %d message":["You have %d messages","Du hast %d Nachricht","Du hast %d Nachrichten"]};
+locale_data['test'] = {"":{"Plural-Forms":" nplurals=2; plural=n != 1;","MIME-Version":" 1.0","POT-Creation-Date":" 2009-06-14 09:29-0400","Language":" de_DE","Last-Translator":" Community","Content-Type":" text/plain; charset=UTF-8","Language-Team":" DuckDuckGo Community <community@duckduckgo.com>","PO-Revision-Date":" 2009-06-14 09:29-0400","Content-Transfer-Encoding":" 8bit","Project-Id-Version":" DuckDuckGo-Translation-0.000"},"Hello":[null,"Hallo"],"Change order test %s %s":[null,"Andere Reihenfolge hier %2$s %1$s"],"You have %d message of %s":["You have %d messages of %s","Du hast %d Nachricht von %s","Du hast %d Nachrichten von %s"],"You have %d message":["You have %d messages","Du hast %d Nachricht","Du hast %d Nachrichten"],"Other change order test %s %s %s":[null,"Verhalten aus http://perldoc.perl.org/functions/sprintf.html %3$s %s %1$s"]};
View
BIN  t/data/locale/de_DE/LC_MESSAGES/test.mo
Binary file not shown
View
3  t/data/locale/de_DE/LC_MESSAGES/test.po
@@ -26,3 +26,6 @@ msgstr "Hallo"
msgid "Change order test %s %s"
msgstr "Andere Reihenfolge hier %2$s %1$s"
+
+msgid "Other change order test %s %s %s"
+msgstr "Verhalten aus http://perldoc.perl.org/functions/sprintf.html %3$s %s %1$s"
View
10 t/data/locale_simple_test.html
@@ -19,12 +19,20 @@
ltd('test');
add_t(l("Hello"));
+ add_t('Should be: "' + 'Hallo' + '"');
add_t(ln("You have %d message","You have %d messages",4));
+ add_t('Should be: "' + 'Du hast 4 Nachrichten' + '"');
add_t(ln("You have %d message","You have %d messages",1));
+ add_t('Should be: "' + 'Du hast 1 Nachricht' + '"');
add_t(ln("You have %d message of %s","You have %d messages of %s",4,'harry'));
+ add_t('Should be: "' + 'Du hast 4 Nachrichten von harry' + '"');
add_t(ln("You have %d message of %s","You have %d messages of %s",1,'harry'));
+ add_t('Should be: "' + 'Du hast 1 Nachricht von harry' + '"');
add_t(l("Change order test %s %s",1,2));
-
+ add_t('Should be: "' + 'Andere Reihenfolge hier 2 1' + '"');
+ add_t(l("Other change order test %s %s %s",1,2,3));
+ add_t('Should be: "' + 'Verhalten aus http://perldoc.perl.org/functions/sprintf.html 3 1 1' + '"');
+
}
</script>
View
2  t/data/update_locale.sh
@@ -6,6 +6,6 @@ for domain in test othertest
do
msgfmt -o $BASE/locale/de_DE/LC_MESSAGES/$domain.mo $BASE/locale/de_DE/LC_MESSAGES/$domain.po
echo -n "locale_data['$domain'] = " >$BASE/locale/de_DE/LC_MESSAGES/$domain.json
- $BASE/../../share/js/gettext/po2json $BASE/locale/de_DE/LC_MESSAGES/$domain.po >>$BASE/locale/de_DE/LC_MESSAGES/$domain.json
+ $BASE/../../bin/po2json $BASE/locale/de_DE/LC_MESSAGES/$domain.po >>$BASE/locale/de_DE/LC_MESSAGES/$domain.json
echo ";" >>$BASE/locale/de_DE/LC_MESSAGES/$domain.json
done
Please sign in to comment.
Something went wrong with that request. Please try again.