Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv9211
Modified Files:
INSTALL NEWS compat.php serendipity_admin_installer.inc.php
serendipity_config.inc.php serendipity_config_local.tpl
serendipity_lang.inc.php
Removed Files:
serendipity_lang_de.inc.php serendipity_lang_en.inc.php
serendipity_lang_es.inc.php
Log Message:
* Added dropdown for languages in the installer
* Added "es" to auto-lang-detection
* Fixed bug with no default values during installation
* Added get_boolean function, check if a string is 'true' or 'false' and return boolean if so
* Moved languages to its own folder
Index: INSTALL
===================================================================
RCS file: /cvsroot/php-blog/serendipity/INSTALL,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- INSTALL 1 Oct 2003 09:29:02 -0000 1.7
+++ INSTALL 21 Jan 2004 18:28:25 -0000 1.8
@@ -52,7 +52,7 @@
-serendipity_admin_overview.inc.php
-serendipity_config.inc.php
-serendipity_functions.inc.php
- -serendipity_lang_en.inc.php
+ -lang/serendipity_lang_*.inc.php
These files are never loaded in the browser, but included (as their
suffix suggests).
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- NEWS 21 Jan 2004 15:51:59 -0000 1.47
+++ NEWS 21 Jan 2004 18:28:25 -0000 1.48
@@ -2,6 +2,8 @@
Version 0.5 ()
------------------------------------
+ * Moved languages to its own folder and added availiable languages as a dropdown in the installer (tomsommer)
+ * Added spanish translation (Luis Cervantes)
* Do not allow our entries to trackback our other entries on creation. References are still inserted. (garvinhicking)
* Added input box to admin entry panel where you can provide an entry id to be directly edited. (garvinhicking)
* Edit an entry directly from your frontend (link beside trackbacks) (garvinhicking)
Index: compat.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/compat.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- compat.php 12 Jan 2004 17:47:38 -0000 1.10
+++ compat.php 21 Jan 2004 18:28:25 -0000 1.11
@@ -76,19 +76,32 @@
}
}
+
// Merge get and post into the serendipity array
$serendipity['GET'] = &$_GET['serendipity'];
$serendipity['POST'] = &$_POST['serendipity'];
$serendipity['COOKIE'] = &$_COOKIE['serendipity'];
+function serendipity_get_bool($item) {
+ $translation = array('true' => true,
+ 'false' => false);
+
+ if ( isset($translation[$item]) ) {
+ return $translation[$item];
+ } else {
+ return $item;
+ }
+}
+
/*
* Some defaults for our config vars.
* They are likely to be overwritten later in the code
*/
$serendipity['templatePath'] = 'templates/';
-if(!isset($serendipity['serendipityPath']))
+if(!isset($serendipity['serendipityPath'])) {
$serendipity['serendipityPath'] = './';
+}
$serendipity['indexFile'] = 'index.php';
/* vim: set sts=4 ts=4 expandtab : */
Index: serendipity_admin_installer.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- serendipity_admin_installer.inc.php 21 Jan 2004 16:36:08 -0000 1.49
+++ serendipity_admin_installer.inc.php 21 Jan 2004 18:28:25 -0000 1.50
@@ -102,6 +102,7 @@
function serendipity_guessInput($type, $name, $value='', $default='') {
switch ($type) {
case 'bool' :
+ $value = serendipity_get_bool($value);
echo '<input id="radio_cfg_' . $name . '_yes" type="radio" name="' . $name . '" value="true" ';
echo (($value == true) ? 'checked="checked"' : ''). ' /><label for="radio_cfg_' . $name . '_yes"> ' . YES . '</label> ';
echo '<input id="radio_cfg_' . $name . '_no" type="radio" name="' . $name . '" value="false" ';
@@ -195,9 +196,15 @@
<?php
for ($x=0; $x<count($value); $x++) {
+ /* If we have a valuelist, then use the value from there */
if (@is_array($from)) {
$value[$x]['value'] = $from[$value[$x]['name']];
}
+
+ /* If the value is never assigned in the valuelist, then use our default value */
+ if (!isset($from[$value[$x]['name']])) {
+ $value[$x]['value'] = $value[$x]['default'];
+ }
?>
<tr>
<td style="border-bottom: 1px #000000 solid" align="left" valign="top" width="75%">
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- serendipity_config.inc.php 7 Jan 2004 17:45:48 -0000 1.44
+++ serendipity_config.inc.php 21 Jan 2004 18:28:25 -0000 1.45
@@ -58,9 +58,6 @@
die(DATABASE_ERROR);
}
-$translation = array('true' => true,
- 'false' => false);
-
/*
* Load Configuration options from the database
*/
@@ -73,9 +70,8 @@
/*
* Convert 'true' and 'false' into booleans
*/
- if ( isset($translation[$row['value']]) ) {
- $row['value'] = $translation[$row['value']];
- }
+ $row['value'] = serendipity_get_bool($row['value']);
+
$serendipity[$row['name']] = $row['value'];
}
Index: serendipity_config_local.tpl
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config_local.tpl,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- serendipity_config_local.tpl 21 Jan 2004 15:07:40 -0000 1.25
+++ serendipity_config_local.tpl 21 Jan 2004 18:28:25 -0000 1.26
@@ -27,8 +27,8 @@
$serendipity['want_mail'] = '{Send mails to admin?|want_mail|bool|1}'; // Do you want to receive emails when comments are posted to your entries?
$serendipity['allowSubscriptions'] = '{Allow users to subscribe to entries?|allowSubscriptions|bool|1}' // Allow users to subscribe to an entry and thereby receive a mail when new comments are made to that entry
$serendipity['blogTitle'] = '{Blog name|blogTitle|string|John Doe's personal blog}'; // The title of your blog
-$serendipity['blogDescription'] = '{Blog description|blogDescription|string|Welcome to my blog...}'; // Description of your blog
-$serendipity['lang'] = '{Language file|lang|string|en}'; // Language (for 'en' you need serendipity_lang_en.inc.php).
+$serendipity['blogDescription'] = '{Blog description|blogDescription|string|My little place on the web...}'; // Description of your blog
+$serendipity['lang'] = '{Language|lang|list|en=>English,de=>German,es=>Spanish}'; // Select the language for your blog
// Appearance and options
# Customize how Serendipity looks and feels
@@ -49,7 +49,7 @@
// Pinging of Weblog Services
# Announcement of new weblog entries
-$serendipity['announce_entries'] = '{Announce Entries|announce_entries|bool|0}'; // Do you want new entries to be announced?
+$serendipity['announce_entries'] = '{Announce Entries|announce_entries|bool|1}'; // Do you want new entries to be announced?
$serendipity['announce_entries_blogs'] = '{blo.gs|announce_entries_blogs|bool|0}'; // Do you want new entries to be announced on blo.gs?
$serendipity['announce_entries_blogrolling'] = '{blogrolling.com|announce_entries_blogrolling|bool|0}'; // Do you want new entries to be announced on blogrolling.com?
$serendipity['announce_entries_technorati'] = '{technorati.com|announce_entries_technorati|bool|0}'; // Do you want new entries to be announced on technorati.com?
Index: serendipity_lang.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- serendipity_lang.inc.php 30 Sep 2003 21:22:00 -0000 1.6
+++ serendipity_lang.inc.php 21 Jan 2004 18:28:25 -0000 1.7
@@ -2,7 +2,7 @@
if (!defined('serendipity_LANG_LOADED') || serendipity_LANG_LOADED !== true) {
// Try and include preferred language from the configurated setting
- if ( @include('serendipity_lang_'. $serendipity['lang'] .'.inc.php') ) {
+ if ( @include($serendipity['serendipityPath'] .'lang/serendipity_lang_'. $serendipity['lang'] .'.inc.php') ) {
// Only here can we truely say the language is loaded
define('serendipity_LANG_LOADED', true);
@@ -10,13 +10,13 @@
} elseif ( IS_installed === false ) { /* -- Auto-Guess -- */
// If no config file is loaded, language includes are not available.
// Now include one. Try to auto-guess the language by looking up the HTTP_ACCEPT_LANGUAGE.
- $supported_languages = array('en', 'de');
+ $supported_languages = array('en', 'de', 'es');
$possible_languages = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
if (is_array($possible_languages)) {
foreach($possible_languages as $index => $lang) {
$preferred_language = preg_replace('|^([^\-_]*)|msU', '\1', $lang);
if (in_array($preferred_language, $supported_languages)) {
- include_once('serendipity_lang_' . $preferred_language . '.inc.php');
+ @include_once($serendipity['serendipityPath'] . 'lang/serendipity_lang_' . $preferred_language . '.inc.php');
break;
} // endif
} // endforeach
@@ -26,7 +26,7 @@
// Do fallback to english
if ( (defined('serendipity_LANG_LOADED') && serendipity_LANG_LOADED === true) || IS_installed === false) {
- include_once('serendipity_lang_en.inc.php');
+ @include_once($serendipity['serendipityPath'] .'lang/serendipity_lang_en.inc.php');
}
}
--- serendipity_lang_de.inc.php DELETED ---
--- serendipity_lang_en.inc.php DELETED ---
--- serendipity_lang_es.inc.php DELETED ---
|