[aur-dev] [PATCH] Move SUPPORTED_LANGS out of config.inc.php
This has no real business being here, and is a pain to update when new languages are shipped. Move it to aur.inc.php instead so it doesn't overwhelm the user-configurable settings file with static stuff. Signed-off-by: Dan McGee <dan@archlinux.org> --- web/lib/aur.inc.php | 28 ++++++++++++++++++++++++++++ web/lib/config.inc.php.proto | 28 ---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index f432697..e784794 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -15,6 +15,34 @@ include_once("version.inc.php"); include_once("acctfuncs.inc.php"); include_once("cachefuncs.inc.php"); +# Languages we have translations for +$SUPPORTED_LANGS = array( + "ca" => "Català", + "cs" => "česky", + "da" => "Dansk", + "de" => "Deutsch", + "en" => "English", + "el" => "Ελληνικά", + "es" => "Español", + "fi" => "Finnish", + "fr" => "Français", + "he" => "עברית", + "hr" => "Hrvatski", + "hu" => "Magyar", + "it" => "Italiano", + "nb_NO" => "Norsk", + "nl" => "Dutch", + "pl" => "Polski", + "pt" => "Português", + "pt_BR" => "Português (Brasil)", + "ro" => "Română", + "ru" => "Русский", + "sr" => "Srpski", + "tr" => "Türkçe", + "uk" => "Українська", + "zh_CN" => "简体中文" +); + # see if the visitor is already logged in # function check_sid($dbh=NULL) { diff --git a/web/lib/config.inc.php.proto b/web/lib/config.inc.php.proto index 61c37f0..ef5918d 100644 --- a/web/lib/config.inc.php.proto +++ b/web/lib/config.inc.php.proto @@ -33,34 +33,6 @@ define("SQL_DEBUG", 0); # to '127.0.0.1:11211'. #define("MEMCACHE_SERVERS", '127.0.0.1:11211'); -# Languages we have translations for -$SUPPORTED_LANGS = array( - "ca" => "Català", - "cs" => "česky", - "da" => "Dansk", - "de" => "Deutsch", - "en" => "English", - "el" => "Ελληνικά", - "es" => "Español", - "fi" => "Finnish", - "fr" => "Français", - "he" => "עברית", - "hr" => "Hrvatski", - "hu" => "Magyar", - "it" => "Italiano", - "nb_NO" => "Norsk", - "nl" => "Dutch", - "pl" => "Polski", - "pt" => "Português", - "pt_BR" => "Português (Brasil)", - "ro" => "Română", - "ru" => "Русский", - "sr" => "Srpski", - "tr" => "Türkçe", - "uk" => "Українська", - "zh_CN" => "简体中文" -); - # Session limit per user $MAX_SESSIONS_PER_USER = 8; -- 1.7.7
On Thu, Oct 20, 2011 at 09:27:18AM -0500, Dan McGee wrote:
This has no real business being here, and is a pain to update when new languages are shipped. Move it to aur.inc.php instead so it doesn't overwhelm the user-configurable settings file with static stuff.
Signed-off-by: Dan McGee <dan@archlinux.org> --- web/lib/aur.inc.php | 28 ++++++++++++++++++++++++++++ web/lib/config.inc.php.proto | 28 ---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-)
Thanks!
On Thu, Oct 20, 2011 at 05:19:30PM +0200, Lukas Fleischer wrote:
On Thu, Oct 20, 2011 at 09:27:18AM -0500, Dan McGee wrote:
This has no real business being here, and is a pain to update when new languages are shipped. Move it to aur.inc.php instead so it doesn't overwhelm the user-configurable settings file with static stuff.
Signed-off-by: Dan McGee <dan@archlinux.org> --- web/lib/aur.inc.php | 28 ++++++++++++++++++++++++++++ web/lib/config.inc.php.proto | 28 ---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-)
Thanks!
... and we should make sure that we set "$SUPPORTED_LANGS" before calling set_lang() in "web/lib/aur.inc.php". Sorry for being imprudent.
On Thu, Oct 20, 2011 at 10:51 AM, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
On Thu, Oct 20, 2011 at 05:19:30PM +0200, Lukas Fleischer wrote:
On Thu, Oct 20, 2011 at 09:27:18AM -0500, Dan McGee wrote:
This has no real business being here, and is a pain to update when new languages are shipped. Move it to aur.inc.php instead so it doesn't overwhelm the user-configurable settings file with static stuff.
Signed-off-by: Dan McGee <dan@archlinux.org> --- web/lib/aur.inc.php | 28 ++++++++++++++++++++++++++++ web/lib/config.inc.php.proto | 28 ---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-)
Thanks!
... and we should make sure that we set "$SUPPORTED_LANGS" before calling set_lang() in "web/lib/aur.inc.php". Sorry for being imprudent.
Ugh. Yeah, this is a mess. Why the hell are we doing both general function defines in this file and actually running code? I feel like the first 16 lines or so should stay here, and boot all the functions to another file. -Dan
participants (3)
-
Dan McGee
-
Dan McGee
-
Lukas Fleischer