aboutsummaryrefslogtreecommitdiff
path: root/packages/pogen/example/proj1/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-04-14 16:05:09 +0200
committerFlorian Dold <florian@dold.me>2023-04-14 16:05:09 +0200
commitf18305776167a3838245fd7d42180ba67218bc46 (patch)
tree95b56ef1528270e9d70d1cb9b5d0ebd8cedfa683 /packages/pogen/example/proj1/src
parent089c15582ed78004ade0855f1e3ee51abd9cdb45 (diff)
downloadwallet-core-f18305776167a3838245fd7d42180ba67218bc46.tar.xz
pogen: fix quoting of double quotes
Diffstat (limited to 'packages/pogen/example/proj1/src')
-rw-r--r--packages/pogen/example/proj1/src/i18n/test.pot130
-rw-r--r--packages/pogen/example/proj1/src/test.ts67
-rw-r--r--packages/pogen/example/proj1/src/test2.tsx17
3 files changed, 214 insertions, 0 deletions
diff --git a/packages/pogen/example/proj1/src/i18n/test.pot b/packages/pogen/example/proj1/src/i18n/test.pot
new file mode 100644
index 000000000..8bc5ef236
--- /dev/null
+++ b/packages/pogen/example/proj1/src/i18n/test.pot
@@ -0,0 +1,130 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-23 00:00+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/test.ts:4
+#, c-format
+msgid "Hello1, World"
+msgstr ""
+
+#: src/test.ts:8
+#, c-format
+msgid "Hello, quoted \"world\""
+msgstr ""
+
+#: src/test.ts:15
+#, c-format
+msgid "Hello5, World"
+msgstr ""
+
+#: src/test.ts:16
+#, c-format
+msgid "Hello6,%1$s World"
+msgstr ""
+
+#. This one has a multi line comment.
+#. It has multiple lines, and a trailing empty line.
+#.
+#: src/test.ts:23
+#, c-format
+msgid "Hello7,%1$s World%2$s"
+msgstr ""
+
+#: src/test.ts:23
+#, c-format
+msgid "one %1$s"
+msgid_plural "many %1$s"
+msgstr[0] ""
+msgstr[1] ""
+
+#: src/test.ts:26
+#, c-format
+msgid "one bla %1$s"
+msgid_plural "many bla %1$s"
+msgstr[0] ""
+msgstr[1] ""
+
+#: src/test.ts:31
+#, c-format
+msgid "I have %1$s apple"
+msgid_plural "I have %1$s apples"
+msgstr[0] ""
+msgstr[1] ""
+
+#: src/test.ts:35
+#, c-format
+msgid "%1$sHello8,%2$s World%3$s"
+msgstr ""
+
+#.
+#. This one has a multi line comment.
+#. It has multiple lines, and a leading empty line.
+#: src/test.ts:42
+#, c-format
+msgid "Hello9,\" '\" World"
+msgstr ""
+
+#: src/test.ts:46
+#, c-format
+msgid ""
+"Hello10\n"
+" ,\" '\" Wo\n"
+" rld"
+msgstr ""
+
+#: src/test.ts:51
+#, c-format
+msgid ""
+"Hello11 this is a long long string\n"
+"it will go over multiple lines and in the pofile\n"
+"it should be wrapped and stuff"
+msgstr ""
+
+#. This is a single line comment
+#: src/test.ts:56
+#, c-format
+msgid ""
+"Hello12 this is a long long string it will go over multiple lines and in the "
+"pofile it should be wrapped and stuff. asdf asdf asdf asdf asdf asdf asdf asdf "
+"adsf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf "
+"asdf"
+msgstr ""
+
+#. First occurrence
+#: src/test.ts:65
+#, c-format
+msgid "This message appears twice"
+msgstr ""
+
+#: src/test2.tsx:1
+#, c-format
+msgid "foo %1$s foo baz"
+msgstr ""
+
+#: src/test2.tsx:5
+#, c-format
+msgid "singular form second line"
+msgid_plural "plural form"
+msgstr[0] ""
+msgstr[1] ""
+
+#: src/test2.tsx:17
+#, c-format
+msgid "\"foo\""
+msgstr ""
+
diff --git a/packages/pogen/example/proj1/src/test.ts b/packages/pogen/example/proj1/src/test.ts
new file mode 100644
index 000000000..2e9b4cbdd
--- /dev/null
+++ b/packages/pogen/example/proj1/src/test.ts
@@ -0,0 +1,67 @@
+declare var i18n: any;
+
+
+console.log(i18n`Hello1, World`);
+console.log(i18n.foo()`Hello2, World`);
+console.log(i18n.foo()`Hello3, World`);
+
+console.log(i18n`Hello, quoted "world"`);
+
+
+/* This is a comment and should be included */
+console.log(i18n().foo()`Hello4, World`);
+
+
+console.log(i18n.foo`Hello5, World`);
+console.log(i18n.foo`Hello6,${123} World`);
+
+/*
+This one has a multi line comment.
+It has multiple lines, and a trailing empty line.
+
+*/
+console.log(/*lol*/i18n.foo`Hello7,${123} World${42}`);
+
+// @ts-expect-error
+i18n.plural(i18n`one ${"foo"}`, i18`many ${"bar"}`);
+
+// @ts-expect-error
+i18n.plural(i18n.foo`one bla ${"foo"}`, i18.foo`many bla ${"bar"}`);
+
+let x = 42;
+
+i18n.plural(i18n`I have ${x} apple`, i18n`I have ${x} apples`);
+
+console.log(i18n`${"foo"}Hello8,${123} World${42}`);
+
+/*
+
+This one has a multi line comment.
+It has multiple lines, and a leading empty line.
+*/
+console.log(i18n`Hello9," '" World`);
+
+// Comments with space in between do not count
+
+console.log(i18n`Hello10
+ ," '" Wo
+ rld`);
+
+
+console.log(i18n`Hello11 this is a long long string
+it will go over multiple lines and in the pofile
+it should be wrapped and stuff`);
+
+// This is a single line comment
+console.log(i18n`Hello12 this is a long long string it will go over multiple lines and in the pofile it should be wrapped and stuff. asdf asdf asdf asdf asdf asdf asdf asdf adsf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf`);
+
+function foo(...args: any[]) {
+}
+
+console.log(foo`Another string, must be excluded`);
+
+
+// First occurrence
+console.log(i18n`This message appears twice`);
+// Second occurrence
+console.log(i18n`This message appears twice`);
diff --git a/packages/pogen/example/proj1/src/test2.tsx b/packages/pogen/example/proj1/src/test2.tsx
new file mode 100644
index 000000000..1c1ab49f2
--- /dev/null
+++ b/packages/pogen/example/proj1/src/test2.tsx
@@ -0,0 +1,17 @@
+let x = <i18n.Translate>foo
+{bar} {" foo "} baz</i18n.Translate>
+
+
+let y = (
+ <i18n.TranslateSwitch>
+ <i18n.TranslateSingular>
+ singular form
+ second line
+ </i18n.TranslateSingular>
+ <i18n.TranslatePlural>
+ plural form
+ </i18n.TranslatePlural>
+ </i18n.TranslateSwitch>
+);
+
+let z = <i18n.Translate>"foo"</i18n.Translate>;