[geeklog-cvs] tools: Added support for install script language files and updat...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Feb 21 13:46:55 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/d1819f2e9466
changeset: 24:d1819f2e9466
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Feb 21 19:43:00 2009 +0100
description:
Added support for install script language files and updated for Geeklog 1.6

diffstat:

5 files changed, 165 insertions(+), 20 deletions(-)
lm/README              |    5 +-
lm/include/core.inc    |   10 ++--
lm/include/install.inc |  118 ++++++++++++++++++++++++++++++++++++++++++++++++
lm/lm.php              |   28 +++++++++--
lm/uplng.sh            |   24 ++++++---

diffs (truncated from 340 to 300 lines):

diff -r c8968b9f3449 -r d1819f2e9466 lm/README
--- a/lm/README	Sat Feb 21 17:09:21 2009 +0100
+++ b/lm/README	Sat Feb 21 19:43:00 2009 +0100
@@ -1,4 +1,4 @@
-lm.php v1.0.1
+lm.php v1.0.2
 
 This script merges a Geeklog (foreign) language file with the english.php
 language file, so that new strings added to english.php are automatically added
@@ -44,7 +44,7 @@
 
     http://lists.geeklog.net/mailman/listinfo/geeklog-translations
 
-Copyright (C) 2004-2008 by Dirk Haun, <dirk AT haun-online DOT de>,
+Copyright (C) 2004-2009 by Dirk Haun, <dirk AT haun-online DOT de>,
 and released under the GNU General Public License v2.
 
 
@@ -60,4 +60,5 @@
 0.9   moved updating code into includes; now supports plugins
 1.0   now supports core language files and all 5 default plugins
 1.0.1 fixed handling of <br> tags and fixed accidentally created <brXHTML> tags
+1.0.2 added support for install script language files
 
diff -r c8968b9f3449 -r d1819f2e9466 lm/include/core.inc
--- a/lm/include/core.inc	Sat Feb 21 17:09:21 2009 +0100
+++ b/lm/include/core.inc	Sat Feb 21 19:43:00 2009 +0100
@@ -2,13 +2,13 @@
 
 /* Reminder: always indent with 4 spaces (no tabs). */
 // +---------------------------------------------------------------------------+
-// | Geeklog 1.5                                                               |
+// | Geeklog 1.6                                                               |
 // +---------------------------------------------------------------------------+
 // | core.inc                                                                  |
 // |                                                                           |
 // | Update a core language file by merging it with english.php                |
 // +---------------------------------------------------------------------------+
-// | Copyright (C) 2004-2008 by the following authors:                         |
+// | Copyright (C) 2004-2009 by the following authors:                         |
 // |                                                                           |
 // | Author:  Dirk Haun         - dirk AT haun-online DOT de                   |
 // +---------------------------------------------------------------------------+
@@ -28,8 +28,6 @@
 // | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
 // |                                                                           |
 // +---------------------------------------------------------------------------+
-//
-// $Id: core.inc,v 1.3 2008/05/02 15:18:20 dhaun Exp $
 
 /**
 * Helper function: Fix URLs in some language files
@@ -151,6 +149,10 @@
 separator();
 echo "\n";
 
+// http://project.geeklog.net/tracking/view.php?id=801
+$ENG01[95]  = str_replace('Powered By', 'Powered by', $ENG01[95]);
+$LANG01[95] = str_replace('Powered By', 'Powered by', $LANG01[95]);
+
 mergeArrays($ENG01, $LANG01, 'LANG01', 'lib-common.php');
 mergeArrays($ENG03, $LANG03, 'LANG03', 'comment.php');
 mergeArrays($ENG04, $LANG04, 'LANG04', 'users.php');
diff -r c8968b9f3449 -r d1819f2e9466 lm/include/install.inc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lm/include/install.inc	Sat Feb 21 19:43:00 2009 +0100
@@ -0,0 +1,118 @@
+<?php
+
+/* Reminder: always indent with 4 spaces (no tabs). */
+// +---------------------------------------------------------------------------+
+// | Geeklog 1.6                                                               |
+// +---------------------------------------------------------------------------+
+// | install.inc                                                               |
+// |                                                                           |
+// | Update a language file for the install script                             |
+// +---------------------------------------------------------------------------+
+// | Copyright (C) 2009 by the following authors:                              |
+// |                                                                           |
+// | Author:  Dirk Haun         - dirk AT haun-online DOT de                   |
+// +---------------------------------------------------------------------------+
+// |                                                                           |
+// | This program is free software; you can redistribute it and/or             |
+// | modify it under the terms of the GNU General Public License               |
+// | as published by the Free Software Foundation; either version 2            |
+// | of the License, or (at your option) any later version.                    |
+// |                                                                           |
+// | This program is distributed in the hope that it will be useful,           |
+// | but WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
+// | GNU General Public License for more details.                              |
+// |                                                                           |
+// | You should have received a copy of the GNU General Public License         |
+// | along with this program; if not, write to the Free Software Foundation,   |
+// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
+// |                                                                           |
+// +---------------------------------------------------------------------------+
+
+// save the english text strings
+$ENG_INSTALL = $LANG_INSTALL;
+$ENG_SUCCESS = $LANG_SUCCESS;
+$ENG_MIGRATE = $LANG_MIGRATE;
+$ENG_PLUGINS = $LANG_PLUGINS;
+$ENG_BIGDUMP = $LANG_BIGDUMP;
+$ENG_ERROR = $LANG_ERROR;
+$ENG_HELP = $LANG_HELP;
+
+// now load the language file we want to update
+require_once $langfile;
+
+echo "\n";
+separatorThin();
+echo "\n";
+echo '$LANG_CHARSET = \'' . $LANG_CHARSET . "';\n";
+if (!empty($LANG_DIRECTION) && ($LANG_DIRECTION != 'ltr')) {
+    echo '$LANG_DIRECTION = \'' . $LANG_DIRECTION . "';\n";
+}
+echo "\n";
+
+separatorThin();
+echo "// | Array Format:                                                             |\n";
+echo "// | \$LANG_NAME[XX]: \$LANG - variable name                                     |\n";
+echo "// |                 NAME  - where array is used                               |\n";
+echo "// |                 XX    - phrase id number                                  |\n";
+separatorThin();
+echo "\n";
+
+separatorThin();
+echo "// install.php\n";
+mergeArrays($ENG_INSTALL, $LANG_INSTALL, 'LANG_INSTALL', false);
+echo "\n";
+
+separatorThin();
+echo "// success.php\n";
+mergeArrays($ENG_SUCCESS, $LANG_SUCCESS, 'LANG_SUCCESS', false);
+echo "\n";
+
+separatorThin();
+echo "// migrate.php\n";
+mergeArrays($ENG_MIGRATE, $LANG_MIGRATE, 'LANG_MIGRATE', false);
+echo "\n";
+
+separatorThin();
+echo "// install-plugins.php\n";
+mergeArrays($ENG_PLUGINS, $LANG_PLUGINS, 'LANG_PLUGINS', false);
+echo "\n";
+
+separatorThin();
+echo "// bigdump.php\n";
+mergeArrays($ENG_BIGDUMP, $LANG_BIGDUMP, 'LANG_BIGDUMP', false);
+echo "\n";
+
+separatorThin();
+echo "// Error Messages\n";
+mergeArrays($ENG_ERROR, $LANG_ERROR, 'LANG_ERROR', false);
+echo "\n";
+
+separatorThin();
+echo "// help.php\n";
+mergeArrays($ENG_HELP, $LANG_HELP, 'LANG_HELP', false);
+
+// hard-code this here (for now)
+$label = '
+// which texts to use as labels, so they don\'t have to be translated again
+$LANG_LABEL = array(
+    \'site_name\'      => $LANG_INSTALL[32],
+    \'site_slogan\'    => $LANG_INSTALL[33],
+    \'db_type\'        => $LANG_INSTALL[34],
+    \'db_host\'        => $LANG_INSTALL[39],
+    \'db_name\'        => $LANG_INSTALL[40],
+    \'db_user\'        => $LANG_INSTALL[41],
+    \'db_pass\'        => $LANG_INSTALL[42],
+    \'db_prefix\'      => $LANG_INSTALL[43],
+    \'site_url\'       => $LANG_INSTALL[45],
+    \'site_admin_url\' => $LANG_INSTALL[47],
+    \'site_mail\'      => $LANG_INSTALL[48],
+    \'noreply_mail\'   => $LANG_INSTALL[49],
+    \'utf8\'           => $LANG_INSTALL[92],
+    \'migrate_file\'   => $LANG_MIGRATE[6],
+    \'plugin_upload\'  => $LANG_PLUGINS[10]
+);';
+
+echo "$label\n";
+
+?>
diff -r c8968b9f3449 -r d1819f2e9466 lm/lm.php
--- a/lm/lm.php	Sat Feb 21 17:09:21 2009 +0100
+++ b/lm/lm.php	Sat Feb 21 19:43:00 2009 +0100
@@ -3,13 +3,13 @@
 
 /* Reminder: always indent with 4 spaces (no tabs). */
 // +---------------------------------------------------------------------------+
-// | Geeklog 1.5                                                               |
+// | Geeklog 1.6                                                               |
 // +---------------------------------------------------------------------------+
 // | lm.php                                                                    |
 // |                                                                           |
 // | Update a language file by merging it with english.php                     |
 // +---------------------------------------------------------------------------+
-// | Copyright (C) 2004-2008 by the following authors:                         |
+// | Copyright (C) 2004-2009 by the following authors:                         |
 // |                                                                           |
 // | Author:  Dirk Haun         - dirk AT haun-online DOT de                   |
 // +---------------------------------------------------------------------------+
@@ -29,10 +29,8 @@
 // | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
 // |                                                                           |
 // +---------------------------------------------------------------------------+
-//
-// $Id: lm.php,v 1.7 2008/05/06 18:24:35 dhaun Exp $
 
-$VERSION = '1.0.1';
+$VERSION = '1.0.2';
 
 // Prevent PHP from reporting uninitialized variables
 error_reporting( E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR );
@@ -91,6 +89,8 @@
 // load the English language file
 if (empty($module)) {
     require_once 'language/english.php';
+} elseif ($module == 'install') {
+    require_once 'public_html/admin/install/language/english.php';
 } else {
     require_once 'plugins/' . $module . '/language/english.php';
 }
@@ -106,6 +106,11 @@
 function separator()
 {
     echo "###############################################################################\n";
+}
+
+function separatorThin()
+{
+    echo "// +---------------------------------------------------------------------------+\n";
 }
 
 /**
@@ -333,6 +338,15 @@
                 } elseif (strstr($line, '*/') !== false) {
                     // end of credits reached, Spam-X style
                     break;
+                } elseif (strstr($line, '+-----') !== false) {
+                    $nextline = fgets($fh);
+                    $tst = trim($nextline);
+                    if (empty($tst)) {
+                        // end of credits reached, install script style
+                        break;
+                    } else {
+                        $credits[] = $nextline;
+                    }
                 }
             } else {
                 if (strstr ($line, '#####') !== false) {
@@ -341,6 +355,10 @@
                     $credits[] = $line;
                 } elseif (strstr($line, '/**') !== false) {
                     // start of credits, Spam-X style
+                    $firstcomment = true;
+                    $credits[] = $line;
+                } elseif (strstr($line, '/* Reminder:') !== false) {
+                    // start of credits, install script style
                     $firstcomment = true;
                     $credits[] = $line;
                 }
diff -r c8968b9f3449 -r d1819f2e9466 lm/uplng.sh
--- a/lm/uplng.sh	Sat Feb 21 17:09:21 2009 +0100
+++ b/lm/uplng.sh	Sat Feb 21 19:43:00 2009 +0100
@@ -1,13 +1,13 @@
 #!/bin/bash
 # +---------------------------------------------------------------------------+
-# | Geeklog 1.5                                                               |
+# | Geeklog 1.6                                                               |
 # +---------------------------------------------------------------------------+
 # | uplng.sh                                                                  |
 # |                                                                           |
 # | Helper script to update the Geeklog language files,                       |
 # | using the lm.php script.                                                  |
 # +---------------------------------------------------------------------------+
-# | Copyright (C) 2004-2008 by the following authors:                         |
+# | Copyright (C) 2004-2009 by the following authors:                         |
 # |                                                                           |
 # | Author:  Dirk Haun         - dirk AT haun-online DOT de                   |
 # +---------------------------------------------------------------------------+
@@ -27,8 +27,6 @@
 # | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
 # |                                                                           |
 # +---------------------------------------------------------------------------+
-#
-# $Id: uplng.sh,v 1.8 2008/04/29 18:47:45 dhaun Exp $
 
 # Installation and usage:
 # - copy this script into the /path/to/geeklog of a local Geeklog install
@@ -40,14 +38,14 @@
 # just a basedir to save some typing ...
 basedir=/Users/dirk/darwin
 
-# the /path/to/geeklog of your local copy of the CVS repository
-cvspath=$basedir/cvs.geeklog.net/Geeklog-1.x
+# the /path/to/geeklog of your local copy of the Mercurial repository
+cvspath=$basedir/hg.geeklog.net/geeklog/geeklog



More information about the geeklog-cvs mailing list