From 74594e516d699a3a95a4e8112c914b9225853de7 Mon Sep 17 00:00:00 2001 From: eric Date: Fri, 18 Jun 2004 22:42:07 +0000 Subject: renamed _() function to __() to avoid gettext conflict --- web/README.txt | 2 +- web/html/index.php | 4 ++-- web/html/template.php | 4 ++-- web/html/testpo.php | 12 +++++----- web/lang/aur_po.inc | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ web/lang/index_po.inc | 5 ++++ web/lib/aur.inc | 62 +++++++++++++++++++++++++++++++++++++++++++++--- web/lib/translator.inc | 9 +++---- web/utils/genpopo | 2 +- 9 files changed, 145 insertions(+), 19 deletions(-) create mode 100644 web/lang/aur_po.inc diff --git a/web/README.txt b/web/README.txt index 5795705c..dbc3c6d7 100644 --- a/web/README.txt +++ b/web/README.txt @@ -11,7 +11,7 @@ Directory Layout: Scripts: -------- -- lib/funcs.inc +- lib/aur.inc This is where we can stick functions that can be shared between the various scripts. Also a good place to put the MySQL authentication variables since it should live outside diff --git a/web/html/index.php b/web/html/index.php index fcd57c7f..24afdf04 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -4,8 +4,8 @@ include("aur.inc"); html_header(); -print "Hi, this is worth reading!
\n"; - +#$dbh = db_connect(); +print "Connected...
\n"; html_footer("\$Id$"); diff --git a/web/html/template.php b/web/html/template.php index 69964751..8ada0f1f 100644 --- a/web/html/template.php +++ b/web/html/template.php @@ -4,10 +4,10 @@ include("index_po.inc"); # use some form of this for i18n support html_header(); # print out the HTML header -# Any text you print out to the visitor, use the _() function +# Any text you print out to the visitor, use the __() function # for i18n support. See 'testpo.php' for more details. # -print _("Hi, this is worth reading!")."
\n"; +print __("Hi, this is worth reading!")."
\n"; html_footer("\$Id$"); # Use the $Id$ keyword diff --git a/web/html/testpo.php b/web/html/testpo.php index fbb0fa84..7f2f1d90 100644 --- a/web/html/testpo.php +++ b/web/html/testpo.php @@ -1,7 +1,7 @@ \n"; print "

\n"; -print _("Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h.", +print __("Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h.", array("","English","", "","Español","", "","Deutsch","", @@ -30,12 +30,12 @@ print _("Select your language here: %h%s%h, %h%s%h, %h%s%h, %h%s%h.", print "

\n"; print "

\n"; -print _("My current language tag is: '%s'.", array($LANG)); +print __("My current language tag is: '%s'.", array($LANG)); print "

\n"; print "\n"; print "\n"; diff --git a/web/lang/aur_po.inc b/web/lang/aur_po.inc new file mode 100644 index 00000000..5f4ca983 --- /dev/null +++ b/web/lang/aur_po.inc @@ -0,0 +1,64 @@ + Traducción española aquí. <--"; +# $_t["fr"]["ArchLinux User-community Repository"] = "--> Traduction française ici. <--"; +# $_t["de"]["ArchLinux User-community Repository"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["AUR: An ArchLinux project"] = "AUR: An ArchLinux project"; +# $_t["es"]["AUR: An ArchLinux project"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["AUR: An ArchLinux project"] = "--> Traduction française ici. <--"; +# $_t["de"]["AUR: An ArchLinux project"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["Logout"] = "Logout"; +# $_t["es"]["Logout"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Logout"] = "--> Traduction française ici. <--"; +# $_t["de"]["Logout"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["Manage"] = "Manage"; +# $_t["es"]["Manage"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Manage"] = "--> Traduction française ici. <--"; +# $_t["de"]["Manage"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["Submit"] = "Submit"; +# $_t["es"]["Submit"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Submit"] = "--> Traduction française ici. <--"; +# $_t["de"]["Submit"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["%s: An ArchLinux project"] = "%s: An ArchLinux project"; +# $_t["es"]["%s: An ArchLinux project"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["%s: An ArchLinux project"] = "--> Traduction française ici. <--"; +# $_t["de"]["%s: An ArchLinux project"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["Accounts"] = "Accounts"; +# $_t["es"]["Accounts"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Accounts"] = "--> Traduction française ici. <--"; +# $_t["de"]["Accounts"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["Vote"] = "Vote"; +# $_t["es"]["Vote"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Vote"] = "--> Traduction française ici. <--"; +# $_t["de"]["Vote"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["Home"] = "Home"; +# $_t["es"]["Home"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Home"] = "--> Traduction française ici. <--"; +# $_t["de"]["Home"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["Packages"] = "Packages"; +# $_t["es"]["Packages"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Packages"] = "--> Traduction française ici. <--"; +# $_t["de"]["Packages"] = "--> Deutsche Übersetzung hier. <--"; + +?> \ No newline at end of file diff --git a/web/lang/index_po.inc b/web/lang/index_po.inc index 6c04677c..0b5d1bc9 100644 --- a/web/lang/index_po.inc +++ b/web/lang/index_po.inc @@ -11,4 +11,9 @@ include_once("translator.inc"); global $_t; +$_t["en"]["Hi, this is worth reading!"] = "Hi, this is worth reading!"; +# $_t["es"]["Hi, this is worth reading!"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Hi, this is worth reading!"] = "--> Traduction française ici. <--"; +# $_t["de"]["Hi, this is worth reading!"] = "--> Deutsche Übersetzung hier. <--"; + ?> \ No newline at end of file diff --git a/web/lib/aur.inc b/web/lib/aur.inc index 7b7602e3..8a4756e4 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -1,4 +1,32 @@ \n"; print " \n"; - print " AUR: An "; - print "ArchLinux project\n"; + print " "; + print __("%s: An ArchLinux project", array("AUR")); + print "\n"; print " \n"; print " \n"; print " \n"; @@ -28,16 +57,43 @@ function html_header() { print " \n"; print " \n"; print " \n"; - print "\n"; + + # Menu items + # + print " \n"; + print " "; + print " .:"; + print " ".__("Home")." "; + print " - "; + print " ".__("Accounts")." "; + print " - "; + print " ".__("Packages")." "; + print " - "; + print " ".__("Vote")." "; + print " - "; + print " ".__("Manage")." "; + print " - "; + print " ".__("Submit")." "; + print " - "; + print " ".__("Logout")." "; + print " :."; + print " "; + print " "; + print " \n"; + print " \n"; print "\n\n"; return; } + # common footer # function html_footer($ver="") { print "\n\n"; + print " \n"; + print " \n"; + print "\n"; print "

\n"; if ($ver) { print "\n"; diff --git a/web/lib/translator.inc b/web/lib/translator.inc index 79eb39c7..87fe7815 100644 --- a/web/lib/translator.inc +++ b/web/lib/translator.inc @@ -3,7 +3,7 @@ # # usage: -# use the _() function for returning translated strings of +# use the __() function for returning translated strings of # text. The string can contain escape codes %h for HTML # and %s for regular text. # @@ -17,12 +17,13 @@ # $_t["es"]["My cat is large."] = "Mi gato esta grande."; # # examples: -# print _("%s has %s apples.", array("Bill", "5")); -# print _("This is a %h%s%h problem!", array("","major","")); +# print __("%s has %s apples.", array("Bill", "5")); +# print __("This is a %h%s%h problem!", array("","major","")); include_once("common_po.inc"); -function _($tag, $args=array()) { + +function __($tag, $args=array()) { global $_t; global $_REQUEST; global $LANG; diff --git a/web/utils/genpopo b/web/utils/genpopo index 64c71ede..6e59b1eb 100755 --- a/web/utils/genpopo +++ b/web/utils/genpopo @@ -3,7 +3,7 @@ # this script iterates through the 'html' and 'lib' directories # looking for php scripts that contain a include_once("xxx_po.inc") -# line and _() functions. It creates/appends to the corresponding +# line and __() functions. It creates/appends to the corresponding # "xxx_po.inc" file in the 'lang' subdirectory and places the # i18n strings into the file in the proper format. # -- cgit v1.2.3-24-g4f1b