Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 56B392E2D98 for ; Fri, 14 Mar 2008 19:13:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 12731-05 for ; Fri, 14 Mar 2008 19:13:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sd-2317.dedibox.fr (sd-2317.dedibox.fr [88.191.17.192]) by postgresql.org (Postfix) with ESMTP id C05862E2D97 for ; Fri, 14 Mar 2008 19:13:29 -0300 (ADT) Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by sd-2317.dedibox.fr (Postfix) with ESMTP id E5A612A18; Fri, 14 Mar 2008 23:13:21 +0100 (CET) Message-ID: <47DAF7E3.8070502@lelarge.info> Date: Fri, 14 Mar 2008 23:10:43 +0100 From: Guillaume Lelarge User-Agent: Thunderbird 2.0.0.12 (X11/20080227) MIME-Version: 1.0 To: PostgreSQL www CC: Magnus Hagander Subject: Patch to make some strings available to translations Content-Type: multipart/mixed; boundary="------------050001090305050304090104" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/355 X-Sequence-Number: 14474 This is a multi-part message in MIME format. --------------050001090305050304090104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I already sent this patch a few months before, but didn't get an answer on it. So, I updated it and hope for the best :) Anyways, a few words on one file of this patch. I had to change system/global/pgpage.php in two ways. First, to add '.UTF-8' to the locale. Without, I couldn't get any gettext translation to work. I wonder if Adrian had to do the same for his translation. I don't think the way I did it is absolutely right, so I would like comments on this. Second, base_href is set to http://www.postgresql.org/, making any links go to the official website. I'm wondering why we didn't use the value of $_SETTINGS['hosted_url'] for example as it can be a local setting. Any comments ? better ways to solve these ? Thanks. Regards. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com --------------050001090305050304090104 Content-Type: text/x-patch; name="pgweb.patch" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="pgweb.patch" Index: system/global/pgpage.php =================================================================== --- system/global/pgpage.php (révision 1995) +++ system/global/pgpage.php (copie de travail) @@ -87,6 +87,7 @@ $locale = $this->language; if (isset($_LANGUAGE_ALIASES[$this->language])) $locale = $_LANGUAGE_ALIASES[$this->language]; + $locale .= '.UTF-8'; putenv('LANG=' . $locale); putenv('LANGUAGE=' . $locale); @@ -183,7 +184,7 @@ if (!isset($_SERVER['ISMASTER']) || $_SERVER['ISMASTER'] != '1') { if ($this->navsection != 'admin') - $this->tpl->setVariable('base_href', 'http://www.postgresql.org/' . $this->url); + $this->tpl->setVariable('base_href', $_SETTINGS['hosted_url'] . $this->url); } } Index: system/global/languages.php =================================================================== --- system/global/languages.php (révision 1995) +++ system/global/languages.php (copie de travail) @@ -33,6 +33,7 @@ $GLOBALS['_LANGUAGE_ALIASES'] = array( 'br' => 'pt_BR', 'en' => 'en_US', + 'fr' => 'fr_FR', 'ru' => 'ru_RU', 'tr' => 'tr_TR' ); Index: template/common.html =================================================================== --- template/common.html (révision 1995) +++ template/common.html (copie de travail) @@ -9,13 +9,13 @@ - - - - + + + + - + @@ -30,14 +30,14 @@
- Skip site navigation (1) - Skip section navigation (2) + func_lang("Skip site navigation") (1) + func_lang("Skip section navigation") (2)

- +

func_lang("Peripheral Links")

@@ -62,7 +62,7 @@
| - The world's most advanced open source database. + func_lang('The world\'s most advanced open source database.')

func_lang("Site Navigation")

Index: template/search.html =================================================================== --- template/search.html (révision 1995) +++ template/search.html (copie de travail) @@ -5,32 +5,32 @@
- - + + - + - + - + - + @@ -44,7 +44,7 @@ -Based on your search term, we recommend the following links: +func_lang("Based on your search term, we recommend the following links"): -

Your search for {searchfor} returned no hits.

+

func_lang("Your search for {searchfor} returned no hits").

-

Results {firsthit}-{lasthit} of {totalhits}.

-

Searching in {searchpages} pages took {searchtime} seconds. -Site search powered by PostgreSQL 8.3.

+

func_lang("Results {firsthit}-{lasthit} of {totalhits}").

+

func_lang("Searching in {searchpages} pages took {searchtime} seconds"). +func_lang("Site search powered by") PostgreSQL 8.3.

-Result pages: {page_links}

+func_lang("Result pages"): {page_links}

{hit_num}. {hit_title} [{hit_rank}]
@@ -69,12 +69,12 @@ {arch_num} . {arch_subject} [{arch_rank}]
-Posted {arch_date} by {arch_author}.
+func_lang("Posted {arch_date} by {arch_author}.")
{arch_abstract}
http://archives.postgresql.org/{arch_list}/{arch_year}-{arch_month}/msg{arch_msgnum}.php

-Result pages: {page_links}

+func_lang("Result pages"): {page_links}

Index: template/download.html =================================================================== --- template/download.html (révision 1995) +++ template/download.html (copie de travail) @@ -1,5 +1,5 @@ -Choose a Mirror +func_lang("Choose a Mirror")

func_lang("Choose a website mirror")

@@ -22,8 +22,7 @@ {urlh}

-

Your download will start automatically from this mirror in 5 seconds unless you select -another mirror in the list below.

+

func_lang("Your download will start automatically from this mirror in 5 seconds unless you select another mirror in the list below.")

You will be automatically redirected to this mirror in 5 seconds unless you Index: template/community-docs.html =================================================================== --- template/community-docs.html (révision 1995) +++ template/community-docs.html (copie de travail) @@ -2,7 +2,7 @@

Search for: func_lang("Search for"):
Include community sitesfunc_lang("Include community sites")
List:func_lang("List"):
Post date:func_lang("Post date"):
Sort by:func_lang("Sort by"):
@@ -23,16 +23,16 @@
-This page is user contributed documentation. See the bottom of the page for information about the author. +func_lang("This page is user contributed documentation. See the bottom of the page for information about the author.")  
- + - + - + - - + +
Updated:func_lang("Updated"): {savedate}
Author:func_lang("Author"): {author_name}
{author_info}
Version history:func_lang("Version history"):
    @@ -43,8 +43,8 @@
Operations:Edit Create subpage (Requires community login)func_lang("Operations"):func_lang("Edit") func_lang("Create subpage") (func_lang("Requires") func_lang("community login"))
Index: template/common-docs.html =================================================================== --- template/common-docs.html (révision 1995) +++ template/common-docs.html (copie de travail) @@ -23,7 +23,7 @@
- +
func_lang("Text Size:") func_lang("Normal") / func_lang("Large")
Index: template/community/survey.html =================================================================== --- template/community/survey.html (révision 1995) +++ template/community/survey.html (copie de travail) @@ -1,5 +1,5 @@ -Community: Survey Results: {page_title} +func_lang("Community: Survey Results:") {page_title}

func_lang("Survey Results")

func_lang("The current results of our {result_title} survey are:")

Index: template/navigation/community.html =================================================================== --- template/navigation/community.html (révision 1995) +++ template/navigation/community.html (copie de travail) @@ -15,8 +15,8 @@
  • func_lang("Weekly News")
  • Community login
  • Index: template/navigation/download.html =================================================================== --- template/navigation/download.html (révision 1995) +++ template/navigation/download.html (copie de travail) @@ -1,7 +1,7 @@
    • func_lang("Downloads")
    • func_lang("File Browser")
    • -
    • Community Software +
    • func_lang("Community Software") Index: template/navigation/about.html =================================================================== --- template/navigation/about.html (révision 1995) +++ template/navigation/about.html (copie de travail) @@ -10,7 +10,7 @@
    • func_lang("History")
    • func_lang("Sponsors")
    • func_lang("Latest News")
    • Index: template/about/news.html =================================================================== --- template/about/news.html (révision 1995) +++ template/about/news.html (copie de travail) @@ -1,5 +1,5 @@ -News: {title_headline} +func_lang("News"): {title_headline}

      {headline}

      Index: template/about/newsarchive.html =================================================================== --- template/about/newsarchive.html (révision 1995) +++ template/about/newsarchive.html (copie de travail) @@ -1,5 +1,5 @@ -News +func_lang("News")

      func_lang("News")

      Index: template/about/quotes.html =================================================================== --- template/about/quotes.html (révision 1995) +++ template/about/quotes.html (copie de travail) @@ -1,5 +1,5 @@ -Quote: {title_headline} +func_lang("Quote"): {title_headline}

      func_lang("Featured User")

      Index: template/about/event.html =================================================================== --- template/about/event.html (révision 1995) +++ template/about/event.html (copie de travail) @@ -1,5 +1,5 @@ -Events: {title_event} in {title_location} +func_lang("Events: {title_event} in {title_location}")

      {event}

      Index: template/about/quotesarchive.html =================================================================== --- template/about/quotesarchive.html (révision 1995) +++ template/about/quotesarchive.html (copie de travail) @@ -1,5 +1,5 @@ -Quotes +func_lang("Quotes")

      func_lang("Quotes")

      Index: template/about/eventarchive.html =================================================================== --- template/about/eventarchive.html (révision 1995) +++ template/about/eventarchive.html (copie de travail) @@ -1,5 +1,5 @@ -Events +func_lang("Events")

      func_lang("Events")


      Index: template/about/events-loop.html =================================================================== --- template/about/events-loop.html (révision 1995) +++ template/about/events-loop.html (copie de travail) @@ -6,7 +6,7 @@ func_lang("Date:") {event_date_start} – {event_date_end} - func_lang("Location:") {event_location}
      + func_lang("Location:") {event_location}
      func_lang("Posted by {event_posted_by}")
      {event_summary} func_lang("more...")

      Index: template/index.html =================================================================== --- template/index.html (révision 1995) +++ template/index.html (copie de travail) @@ -27,11 +27,11 @@
      -

      Shortcuts

      +

      func_lang('Shortcuts')

      • @@ -80,7 +80,7 @@
      -

      Support Us

      +

      func_lang('Support Us')

      func_lang("PostgreSQL is free. Please support our work by making a donation"). @@ -91,7 +91,7 @@
      - Latest News + func_lang('Latest News')
      @@ -113,7 +113,7 @@
      - Planet PostgreSQL + func_lang('Planet PostgreSQL')
      @@ -137,13 +137,13 @@
      - Upcoming Events + func_lang('Upcoming Events')
      - Upcoming training + func_lang('Upcoming training')
      Index: .htaccess =================================================================== --- .htaccess (révision 1995) +++ .htaccess (copie de travail) @@ -3,18 +3,15 @@ AddDefaultCharset utf-8 # Pear modules -php_value include_path "/usr/local/www/portal.postgresql.org/pear/lib:." +php_value include_path "/usr/share/php:." # Fire up mod_rewrite RewriteEngine On -# Disallow access to .svn directories -RewriteRule /.svn - [F] - # Rewrite every request except those for # static files to system/handler.php -RewriteRule ^(favicon\.ico|admin|template|layout|files|external|system/handler\.php|system/rss\.php|system/redir\.php|system/communityfiles\.php|system/oldsearch\.php|sync_timestamp|web_sync_timestamp|mirrors.xml|robots.txt) - [L] +RewriteRule ^(favicon\.ico|admin|template|layout|files|external|system/handler\.php|system/rss\.php|system/redir\.php|system/communityfiles\.php|sync_timestamp|robots.txt) - [L] # Redirector RewriteRule ^redir$ /system/redir.php [QSA,L] --------------050001090305050304090104--