SLING-10654: add test content for icu plural test (#4)
Including:
- some format expressions and data being used for the same
- some translations of the pattern used in a non-trivial language
diff --git a/src/main/resources/SLING-INF/apps/sightly/locales/cs.json b/src/main/resources/SLING-INF/apps/sightly/locales/cs.json
new file mode 100644
index 0000000..fb62664
--- /dev/null
+++ b/src/main/resources/SLING-INF/apps/sightly/locales/cs.json
@@ -0,0 +1,10 @@
+{
+ "jcr:primaryType": "nt:unstructured",
+ "jcr:mixinTypes": [ "mix:language" ],
+ "jcr:language": "cs",
+ "results-plural": {
+ "jcr:primaryType": "sling:MessageEntry",
+ "sling:key": "{0,plural,one{# result} other{# results}}",
+ "sling:message": "{0,plural,one{# výsledek} few{# výsledky} other{# výsledků}}"
+ }
+}
\ No newline at end of file
diff --git a/src/main/resources/SLING-INF/apps/sightly/scripts/format/FormatPojo.java b/src/main/resources/SLING-INF/apps/sightly/scripts/format/FormatPojo.java
index 394d68b..8597538 100644
--- a/src/main/resources/SLING-INF/apps/sightly/scripts/format/FormatPojo.java
+++ b/src/main/resources/SLING-INF/apps/sightly/scripts/format/FormatPojo.java
@@ -29,4 +29,19 @@
return date;
}
+ public int getZero() {
+ return 0;
+ }
+
+ public int getOne() {
+ return 1;
+ }
+
+ public int getFew() {
+ return 3;
+ }
+
+ public int getMany() {
+ return 15;
+ }
}
\ No newline at end of file
diff --git a/src/main/resources/SLING-INF/apps/sightly/scripts/format/format.html b/src/main/resources/SLING-INF/apps/sightly/scripts/format/format.html
index 790144a..18538f4 100644
--- a/src/main/resources/SLING-INF/apps/sightly/scripts/format/format.html
+++ b/src/main/resources/SLING-INF/apps/sightly/scripts/format/format.html
@@ -19,4 +19,13 @@
<p id="format-date-2">${'short' @ format=pojo.date, timezone='UTC', locale='de_DE', type='date'}</p>
<p id="format-date-3">${'short' @ format=pojo.date, timezone='UTC', locale='de_DE'}</p>
<p id="format-date-4">${'FULL' @ format=pojo.date, timezone='UTC', locale='de_DE', type='date'}</p>
+
+<p id="format-icu-plural-zero">${'{0,plural,one{# result} other{# results}}' @ format=pojo.zero, locale='en', i18n }</p>
+<p id="format-icu-plural-one">${'{0,plural,one{# result} other{# results}}' @ format=pojo.one, locale='en', i18n }</p>
+<p id="format-icu-plural-few">${'{0,plural,one{# result} other{# results}}' @ format=pojo.few, locale='en', i18n }</p>
+<p id="format-icu-plural-many">${'{0,plural,one{# result} other{# results}}' @ format=pojo.many, locale='en', i18n }</p>
+<p id="format-icu-plural-zero-cs">${'{0,plural,one{# result} other{# results}}' @ format=pojo.zero, locale='cs', i18n }</p>
+<p id="format-icu-plural-one-cs">${'{0,plural,one{# result} other{# results}}' @ format=pojo.one, locale='cs', i18n }</p>
+<p id="format-icu-plural-few-cs">${'{0,plural,one{# result} other{# results}}' @ format=pojo.few, locale='cs', i18n }</p>
+<p id="format-icu-plural-many-cs">${'{0,plural,one{# result} other{# results}}' @ format=pojo.many, locale='cs', i18n }</p>
</div>
\ No newline at end of file