examples: Added i18n example and po files for several languages
authorLucas Bajolet <r4pass@hotmail.com>
Fri, 24 Apr 2015 14:51:22 +0000 (10:51 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Mon, 27 Apr 2015 14:51:07 +0000 (10:51 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

examples/langannot.nit [new file with mode: 0644]
examples/languages/en/LC_MESSAGES/langannot.po [new file with mode: 0644]
examples/languages/fr/LC_MESSAGES/langannot.po [new file with mode: 0644]
examples/languages/ja/LC_MESSAGES/langannot.po [new file with mode: 0644]
examples/languages/langannot.pot [new file with mode: 0644]
tests/exec.skip

diff --git a/examples/langannot.nit b/examples/langannot.nit
new file mode 100644 (file)
index 0000000..7d471f6
--- /dev/null
@@ -0,0 +1,37 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Sample module showing the use of the i18n annotation
+module langannot is i18n
+
+import gettext
+
+class X
+       fun foo: String do
+               return "This String is a test"
+       end
+end
+
+var t = new X
+print t.foo
+
+print "This String is a test"
+
+print """Multiline string
+
+example
+
+
+of the language annotation capacities
+"""
diff --git a/examples/languages/en/LC_MESSAGES/langannot.po b/examples/languages/en/LC_MESSAGES/langannot.po
new file mode 100644 (file)
index 0000000..e4e0d02
--- /dev/null
@@ -0,0 +1,9 @@
+#: langannot::langannot 22--10:32, langannot::langannot 29--7:29
+msgid "This String is a test"
+msgstr "This String is a test"
+
+#: langannot::langannot 31--7:3
+msgid "Multiline string\n\nexample\n\n\nof the language annotation capacities\n"
+msgstr "Multiline string\n\nexample\n\n\nof the language annotation capacities\n"
+
+# Generated file, do not modify
diff --git a/examples/languages/fr/LC_MESSAGES/langannot.po b/examples/languages/fr/LC_MESSAGES/langannot.po
new file mode 100644 (file)
index 0000000..78ed2e7
--- /dev/null
@@ -0,0 +1,9 @@
+#: langannot::langannot 22--10:32, langannot::langannot 29--7:29
+msgid "This String is a test"
+msgstr "Cette chaîne de caractères est un test"
+
+#: langannot::langannot 31--7:3
+msgid "Multiline string\n\nexample\n\n\nof the language annotation capacities\n"
+msgstr "Example de\n\nchaine multiligne\n\n\navec annotation de localisation\n"
+
+# Generated file, do not modify
diff --git a/examples/languages/ja/LC_MESSAGES/langannot.po b/examples/languages/ja/LC_MESSAGES/langannot.po
new file mode 100644 (file)
index 0000000..1a50944
--- /dev/null
@@ -0,0 +1,9 @@
+#: langannot::langannot 22--10:32, langannot::langannot 29--7:29
+msgid "This String is a test"
+msgstr "この文字列はてストです"
+
+#: langannot::langannot 31--7:3
+msgid "Multiline string\n\nexample\n\n\nof the language annotation capacities\n"
+msgstr "複数行の文字列\n\nなサンプルプログラム\n\n\n新しい国際化アノテーションとともに\n"
+
+# Generated file, do not modify
diff --git a/examples/languages/langannot.pot b/examples/languages/langannot.pot
new file mode 100644 (file)
index 0000000..f6c2096
--- /dev/null
@@ -0,0 +1,9 @@
+#: langannot::langannot 22--10:32, langannot::langannot 29--7:29
+msgid "This String is a test"
+msgstr ""
+
+#: langannot::langannot 31--7:3
+msgid "Multiline string\n\nexample\n\n\nof the language annotation capacities\n"
+msgstr ""
+
+# Generated file, do not modify
index b4d2b33..49599a2 100644 (file)
@@ -3,3 +3,4 @@ leapfrog_curses
 websocket_server
 converter
 show_basedir
+langannot