summaryrefslogtreecommitdiffstats
path: root/web/html/testpo.php
diff options
context:
space:
mode:
authoreric <eric>2004-06-18 18:23:14 +0200
committereric <eric>2004-06-18 18:23:14 +0200
commit1e35dc01cf94ba1ec4923b8f040e49b4dc399860 (patch)
tree15404a70070fe01c1bcf432fba6befbdb2f2f097 /web/html/testpo.php
parent79f64a059254bbbae93cf7c2f9dfa512aa5f9f7e (diff)
downloadaur-1e35dc01cf94ba1ec4923b8f040e49b4dc399860.tar.gz
aur-1e35dc01cf94ba1ec4923b8f040e49b4dc399860.tar.xz
finishing touches on genpopo, started playing with _real_ PHP code and svn keywords
Diffstat (limited to 'web/html/testpo.php')
-rw-r--r--web/html/testpo.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/web/html/testpo.php b/web/html/testpo.php
new file mode 100644
index 00000000..fbb0fa84
--- /dev/null
+++ b/web/html/testpo.php
@@ -0,0 +1,42 @@
+<?
+# This is a sample script to demonstrate how the AUR will
+# handle i18n. Note: When the PHP script is finished, and
+# has the proper include file (see below), and the _()
+# function has been used (see below), use the web/utils/genpopo
+# script to parse the PHP script and pull out the text
+# that requires translation and puts the mapping into the
+# include file.
+#
+
+# Each AUR PHP script that requires i18n support, needs to
+# define an 'xxx_po.inc' file where the i18n mapping will
+# reside.
+#
+include("test_po.inc");
+
+
+# Use the _() function to identify text that requires
+# translation to other languages. The examples below
+# show how to use %-substitution.
+#
+print "<html><body bgcolor='white'>\n";
+
+print "<p>\n";
+print _("Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h.",
+ array("<a href='".$_SERVER['PHP_SELF']."?LANG=en'>","English","</a>",
+ "<a href='".$_SERVER['PHP_SELF']."?LANG=es'>","Español","</a>",
+ "<a href='".$_SERVER['PHP_SELF']."?LANG=de'>","Deutsch","</a>",
+ "<a href='".$_SERVER['PHP_SELF']."?LANG=fr'>","Français","</a>"));
+print "</p>\n";
+
+print "<p>\n";
+print _("My current language tag is: '%s'.", array($LANG));
+print "</p>\n";
+
+print "<ul>\n";
+print _("Hello, world!")."<br/>\n";
+print _("Hello, again!")."<br/>\n";
+print "</ul>\n";
+print "</body>\n</html>";
+
+?>