[med-svn] r555 - in trunk/community/website: . inc locale locale/en locale/it locale/it/LC_MESSAGES
hanska-guest at alioth.debian.org
hanska-guest at alioth.debian.org
Thu Oct 4 18:38:41 UTC 2007
Author: hanska-guest
Date: 2007-10-04 18:38:41 +0000 (Thu, 04 Oct 2007)
New Revision: 555
Added:
trunk/community/website/inc/locale.inc.php
trunk/community/website/locale/
trunk/community/website/locale/en/
trunk/community/website/locale/en/LC_MESSAGES/
trunk/community/website/locale/it/
trunk/community/website/locale/it/LC_MESSAGES/
trunk/community/website/locale/it/LC_MESSAGES/messages.mo
trunk/community/website/locale/it/LC_MESSAGES/messages.po
trunk/community/website/locale/messages.pot
Modified:
trunk/community/website/bugs.php
trunk/community/website/inc/header.inc.php
trunk/community/website/index.php
Log:
First l10n implementation
Modified: trunk/community/website/bugs.php
===================================================================
--- trunk/community/website/bugs.php 2007-10-04 14:56:57 UTC (rev 554)
+++ trunk/community/website/bugs.php 2007-10-04 18:38:41 UTC (rev 555)
@@ -1,9 +1,7 @@
<?php
require_once("inc/header.inc.php");
-//require_once("inc/parser.inc.php");
$login = "debian-med-packaging at lists.alioth.debian.org";
-//$url = "http://qa.debian.org/developer.php?login=$login";
$soapUrl = "http://bugs.debian.org/cgi-bin/soap.cgi";
$nameSpace = "Debbugs/SOAP";
@@ -11,11 +9,11 @@
$soap = new SoapClient(null, array('location' => $soapUrl,
'uri' => $nameSpace));
-$package = ($_GET["pkg"]) ? $_GET["pkg"] : "all";
+$package = ($_GET["pkg"]) ? $_GET["pkg"] : _("all");
$bugs = array();
-if ($package == "all") {
+if ($package == _("all")) {
$bug_numbers = $soap->get_bugs("maint", $login);
} else {
$bug_numbers = $soap->get_bugs("package", $package);
@@ -40,22 +38,22 @@
<table class="columns">
<tr>
<td class="left">
- <span class="section">envelope</span>
+ <span class="section"><?=_("summary")?></span>
<div class="section">
<div class="sectionTop"></div>
<div class="row">
- Bugs for package:
+ <?=_("Bugs for package")?>:
<strong><?=$package?></strong>
</div>
<div class="row">
- Total bugs:
+ <?=_("Total bugs")?>:
<strong><?=$count?></strong>
</div>
</div>
</td>
<td class="main">
<div class="pageBody">
- <h1>Bugs for package "<?=$package?>"</h1>
+ <h1><?=_("Bugs for package")?> "<?=$package?>"</h1>
<table class="messageHeaders">
<?php
foreach($bugs as $package => $bug) {
Modified: trunk/community/website/inc/header.inc.php
===================================================================
--- trunk/community/website/inc/header.inc.php 2007-10-04 14:56:57 UTC (rev 554)
+++ trunk/community/website/inc/header.inc.php 2007-10-04 18:38:41 UTC (rev 555)
@@ -1,4 +1,6 @@
-<html>
+<?php
+ require_once("locale.inc.php");
+?><html>
<head>
<title>Debian-Med Project</title>
<link href="/inc/style.css" type="text/css" rel="stylesheet" />
Added: trunk/community/website/inc/locale.inc.php
===================================================================
--- trunk/community/website/inc/locale.inc.php (rev 0)
+++ trunk/community/website/inc/locale.inc.php 2007-10-04 18:38:41 UTC (rev 555)
@@ -0,0 +1,59 @@
+<?php
+// _SERVER["HTTP_ACCEPT_LANGUAGE"] it-it,it;q=0.8,en-gb;q=0.6,en-us;q=0.4,en;q=0.2
+//$languages = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
+$languages = "it-it,it;q=0.8,en-gb;q=0.6,en-us;q=0.4,en;q=0.2";
+$lang_arr = explode(",", $languages);
+$lang_arr[0] .= ";q=1.0";
+
+$locales_dir = dirname($_SERVER["SCRIPT_FILENAME"])."/locale/";
+
+$handle = @opendir($locales_dir) or die(_("Cannot open") . " $locales_dir.\n");
+while ($file = readdir($handle)) {
+ if ($file != "." && $file != ".." && isdir($file)) {
+ $available[] = $file;
+ }
+}
+
+$i = 0;
+foreach ($lang_arr as $lang_code) {
+ $tmp[] = explode(";", $lang_code);
+
+ // let's use the aa_BB format
+ preg_match("/([a-zA-Z]+)-([a-zA-Z]+)/", $tmp[$i][0], $matches);
+ $tmp[$i][0] = ($matches) ? strtolower($matches[1]) . "_" . strtoupper($matches[2]) : $tmp[$i][0];
+ $langs[str_replace("q=", "", $tmp[$i][1])] = $tmp[$i][0];
+ $i++;
+}
+
+// let's sort them by priority, highest first
+krsort($langs);
+
+$locale = "en";
+$priority = "1.0";
+
+foreach ($langs as $index => $language) {
+ preg_match("/([a-z]+)_[A-Z]+/", $language, $matches);
+ $test = $matches[1];
+ if (in_array($test, $available)) {
+ $locale = $test;
+ $priority = $index;
+ break;
+ }
+}
+
+if ($priority < "0.8") {
+ $show_locale_warning = true;
+}
+
+//print_r($langs);
+
+//$locale = "en_GB";
+
+//echo $locale."\n\n\n";
+
+putenv("LC_ALL=$locale");
+setlocale(LC_ALL, $locale);
+bindtextdomain("messages", $locales_dir);
+textdomain("messages");
+
+?>
Modified: trunk/community/website/index.php
===================================================================
--- trunk/community/website/index.php 2007-10-04 14:56:57 UTC (rev 554)
+++ trunk/community/website/index.php 2007-10-04 18:38:41 UTC (rev 555)
@@ -4,21 +4,17 @@
<table class="columns">
<tr>
<td class="left">
- <span class="section">information</span>
+ <span class="section"><?=_("information")?></span>
<div class="section">
<div class="sectionTop"></div>
<div class="row">
- <a href="http://wiki.debian.org/DebianMed">Visit our Wiki page</a>
+ <a href="http://wiki.debian.org/DebianMed"><?=_("Visit our Wiki page")?></a>
</div>
<div class="row">
- The Debian-Med project presents packages that are
- associated with medicine, pre-clinical research, and
- life science. Its developments are mostly focused on
- three areas for the moment: medical practice, imaging
- and bioinformatics.
+ <?=_("The Debian-Med project presents packages that are associated with medicine, pre-clinical research, and life science. Its developments are mostly focused on three areas for the moment: medical practice, imaging and bioinformatics.")?>
</div>
</div>
- <span class="section">members</span>
+ <span class="section"><?=_("members")?></span>
<div class="section">
<div class="sectionTop"></div>
<div class="row">
@@ -36,12 +32,12 @@
switch ($details["role"]) {
case "admin":
$img = "/img/wh_green.png";
- $alt = "Project Administrator";
+ $alt = _("Project Administrator");
break;
case "developer":
default:
$img = "/img/wh_grey.png";
- $alt = "Project Developer";
+ $alt = _("Project Developer");
}
?>
<tr><td>
@@ -55,43 +51,43 @@
</div>
<table class="related">
<tr><td>
- <img src="/img/wh_green.png" alt="Green Wheel" />
- Project Administrators
+ <img src="/img/wh_green.png" alt="<?=_("Green Wheel")?>" />
+ <?=_("Project Administrator")?>
</td></tr>
<tr><td>
- <img src="/img/wh_grey.png" alt="Grey Wheel" />
- Project Developers
+ <img src="/img/wh_grey.png" alt="<?=_("Grey Wheel")?>" />
+ <?=_("Project Developer")?>
</td></tr>
</table>
</div>
</div>
- <span class="section">pages</span>
+ <span class="section"><?=_("pages")?></span>
<div class="section">
<div class="sectionTop"></div>
<div class="row">
<ul>
- <li><a href="/bugs.php">Bugs Page</a></li>
+ <li><a href="/bugs.php"><?=_("Bugs Page")?></a></li>
<li>…</li>
</ul>
</div>
</div>
- <span class="section">UTC time</span>
+ <span class="section"><?=_("UTC time")?></span>
<div class="section">
<div class="sectionTop"></div>
<div class="row"><?=date("r", time())?></div>
</div>
</td>
<td class="main">
- <span class="section">recent activity</span>
+ <span class="section"><?=_("recent activity")?></span>
<div class="section">
<div class="sectionTop"></div>
<div class="row">
<table width="100%">
<tr>
- <th>date</th>
- <th>author</th>
- <th>content</th>
- <th>link</th>
+ <th><?=_("date")?></th>
+ <th><?=_("author")?></th>
+ <th><?=_("content")?></th>
+ <th><?=_("link")?></th>
</tr>
<?php
include_once("inc/lastRSS.php");
@@ -120,7 +116,7 @@
</table>
</div>
</div>
- <span class="section">todo</span>
+ <span class="section"><?=_("todo")?></span>
<div class="section">
<div class="sectionTop"></div>
<div class="row">
@@ -149,8 +145,7 @@
</tr>
</table>
<hr />
-<small>Please, note that this is a SVN export of our website. It might break during
-SVN commits.</small>
+<small><?=_("Please, note that this is a SVN export of our website. It might break during SVN commits.")?></small>
<?php
require_once("inc/footer.inc.php")
?>
Added: trunk/community/website/locale/it/LC_MESSAGES/messages.mo
===================================================================
(Binary files differ)
Property changes on: trunk/community/website/locale/it/LC_MESSAGES/messages.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/community/website/locale/it/LC_MESSAGES/messages.po
===================================================================
--- trunk/community/website/locale/it/LC_MESSAGES/messages.po (rev 0)
+++ trunk/community/website/locale/it/LC_MESSAGES/messages.po 2007-10-04 18:38:41 UTC (rev 555)
@@ -0,0 +1,140 @@
+# Translation file for Debian-Med homepage.
+# Copyright (C) 2007, Debian-Med Team <debian-med at lists.debian.org>
+# This file is distributed under the GNU General Public License v2+.
+# David Paleino <d.paleino at gmail.com>, 2007.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: 0.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-10-04 20:34+0200\n"
+"PO-Revision-Date: 2007-10-04 20:23+0200\n"
+"Last-Translator: David Paleino <d.paleino at gmail.com>\n"
+"Language-Team: Italian <it at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: bugs.php:12 bugs.php:16
+msgid "all"
+msgstr "tutti"
+
+#: bugs.php:41
+msgid "summary"
+msgstr "riassunto"
+
+#: bugs.php:45 bugs.php:56
+msgid "Bugs for package"
+msgstr "Bugs per il pacchetto"
+
+#: bugs.php:49
+msgid "Total bugs"
+msgstr "Bugs totali"
+
+#: details.php:14
+msgid "Cannot create parser\n"
+msgstr "Impossibile creare il parser\n"
+
+#: details.php:70
+msgid "Received"
+msgstr "Ricevuto"
+
+#: details.php:75
+msgid "Commit Message"
+msgstr "Messaggio di Commit"
+
+#: details.php:78
+msgid "Author"
+msgstr "Autore"
+
+#: details.php:82
+msgid "Revision"
+msgstr "Revisione"
+
+#: details.php:89
+msgid "Modified Files"
+msgstr "File Modificati"
+
+#: index.php:7
+msgid "information"
+msgstr "informazioni"
+
+#: index.php:11
+msgid "Visit our Wiki page"
+msgstr "Visita la nostra pagina Wiki"
+
+#: index.php:14
+msgid ""
+"The Debian-Med project presents packages that are associated with medicine, "
+"pre-clinical research, and life science. Its developments are mostly focused "
+"on three areas for the moment: medical practice, imaging and bioinformatics."
+msgstr ""
+"Il progetto Debian-Med presenta pacchetti che sono associati con la "
+"medicina, la ricerca pre-clinica, e le scienze della via. Il suo sviluppo è "
+"principalmente concentrato su tre aree per il momento: attività mediche, "
+"imaging e bioinformatica."
+
+#: index.php:17
+msgid "members"
+msgstr "membri"
+
+#: index.php:35 index.php:55
+msgid "Project Administrator"
+msgstr "Amministratore Progetto"
+
+#: index.php:40 index.php:59
+msgid "Project Developer"
+msgstr "Sviluppatore Progetto"
+
+#: index.php:54
+msgid "Green Wheel"
+msgstr "Ingranaggio Verde"
+
+#: index.php:58
+msgid "Grey Wheel"
+msgstr "Ingranaggio Grigio"
+
+#: index.php:64
+msgid "pages"
+msgstr "pagine"
+
+#: index.php:69
+msgid "Bugs Page"
+msgstr "Pagina Bugs"
+
+#: index.php:74
+msgid "UTC time"
+msgstr "orario UTC"
+
+#: index.php:81
+msgid "recent activity"
+msgstr "attività recenti"
+
+#: index.php:87
+msgid "date"
+msgstr "data"
+
+#: index.php:88
+msgid "author"
+msgstr "autore"
+
+#: index.php:89
+msgid "content"
+msgstr "contenuto"
+
+#: index.php:90
+msgid "link"
+msgstr "link"
+
+#: index.php:119
+msgid "todo"
+msgstr "da fare"
+
+#: index.php:148
+msgid ""
+"Please, note that this is a SVN export of our website. It might break during "
+"SVN commits."
+msgstr ""
+"Per favore, nota che questo è un export SVN del nostro sito web. Potrebbe "
+"avere dei problemi durante i commits."
Added: trunk/community/website/locale/messages.pot
===================================================================
--- trunk/community/website/locale/messages.pot (rev 0)
+++ trunk/community/website/locale/messages.pot 2007-10-04 18:38:41 UTC (rev 555)
@@ -0,0 +1,132 @@
+# Translation file for Debian-Med homepage.
+# Copyright (C) 2007, Debian-Med Team <debian-med at lists.debian.org>
+# This file is distributed under the GNU General Public License v2+.
+# David Paleino <d.paleino at gmail.com>, 2007.
+#
+#, fuzzy
+msgid ""
+msgstr "Project-Id-Version: 0.1\n"
+ "Report-Msgid-Bugs-To: \n"
+ "POT-Creation-Date: 2007-10-04 20:23+0200\n"
+ "PO-Revision-Date: YEAR-MM-DD HO:MI+ZONE\n"
+ "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+ "Language-Team: LANGUAGE <LL at li.org>\n"
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8bit\n"
+
+#: bugs.php:12 bugs.php:16
+msgid "all"
+msgstr ""
+
+#: bugs.php:43
+msgid "summary"
+msgstr ""
+
+#: bugs.php:47 bugs.php:58
+msgid "Bugs for package"
+msgstr ""
+
+#: bugs.php:51
+msgid "Total bugs"
+msgstr ""
+
+#: details.php:14
+msgid "Cannot create parser\n"
+msgstr ""
+
+#: details.php:70
+msgid "Received"
+msgstr ""
+
+#: details.php:75
+msgid "Commit Message"
+msgstr ""
+
+#: details.php:78
+msgid "Author"
+msgstr ""
+
+#: details.php:82
+msgid "Revision"
+msgstr ""
+
+#: details.php:89
+msgid "Modified Files"
+msgstr ""
+
+#: index.php:7
+msgid "information"
+msgstr ""
+
+#: index.php:11
+msgid "Visit our Wiki page"
+msgstr ""
+
+#: index.php:14
+msgid "The Debian-Med project presents packages that are associated with "
+ "medicine, pre-clinical research, and life science. Its developments "
+ "are mostly focused on three areas for the moment: medical practice, "
+ "imaging and bioinformatics."
+msgstr ""
+
+#: index.php:17
+msgid "members"
+msgstr ""
+
+#: index.php:35 index.php:55
+msgid "Project Administrator"
+msgstr ""
+
+#: index.php:40 index.php:59
+msgid "Project Developer"
+msgstr ""
+
+#: index.php:54
+msgid "Green Wheel"
+msgstr ""
+
+#: index.php:58
+msgid "Grey Wheel"
+msgstr ""
+
+#: index.php:64
+msgid "pages"
+msgstr ""
+
+#: index.php:69
+msgid "Bugs Page"
+msgstr ""
+
+#: index.php:74
+msgid "UTC time"
+msgstr ""
+
+#: index.php:81
+msgid "recent activity"
+msgstr ""
+
+#: index.php:87
+msgid "date"
+msgstr ""
+
+#: index.php:88
+msgid "author"
+msgstr ""
+
+#: index.php:89
+msgid "content"
+msgstr ""
+
+#: index.php:90
+msgid "link"
+msgstr ""
+
+#: index.php:119
+msgid "todo"
+msgstr ""
+
+#: index.php:148
+msgid "Please, note that this is a SVN export of our website. It might "
+ "break during SVN commits."
+msgstr ""
More information about the debian-med-commit
mailing list