[geeklog-cvs] tools/lm/include calendar.inc, NONE, 1.1 core.inc, NONE, 1.1

Dirk Haun dhaun at qs1489.pair.com
Sun Apr 27 13:11:15 EDT 2008


Update of /cvsroot/geeklog/tools/lm/include
In directory qs1489.pair.com:/tmp/cvs-serv72462/include

Added Files:
	calendar.inc core.inc 
Log Message:
Moved updating code into includes, allowing to support plugins


--- NEW FILE: calendar.inc ---
<?php

/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// | Geeklog 1.5                                                               |
// +---------------------------------------------------------------------------+
// | calendar.inc                                                              |
// |                                                                           |
// | Update a calendar language file by merging it with english.php            |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2008 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.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//
// $Id: calendar.inc,v 1.1 2008/04/27 17:11:13 dhaun Exp $

// save the english text strings
$ENG_CAL_1 = $LANG_CAL_1;
$ENG_CAL_SEARCH = $_LANG_CAL_SEARCH;
$ENG_CAL_2 = $LANG_CAL_2;
$ENG_CAL_ADMIN = $LANG_CAL_ADMIN;
$ENG_CAL_MESSAGE = $LANG_CAL_MESSAGE;

$ENG_MSG4 = PLG_calendar_MESSAGE4;
$ENG_MSG17 = PLG_calendar_MESSAGE17;
$ENG_MSG18 = PLG_calendar_MESSAGE18;
$ENG_MSG24 = PLG_calendar_MESSAGE24;
$ENG_MSG26 = PLG_calendar_MESSAGE26;
$ENG_MSG3001 = PLG_calendar_MESSAGE3001;

$ENG_configsections['calendar'] = $LANG_configsections['calendar'];
$ENG_confignames['calendar'] = $LANG_confignames['calendar'];
$ENG_configsubgroups['calendar'] = $LANG_configsubgroups['calendar'];
$ENG_fs['calendar'] = $LANG_fs['calendar'];
$ENG_configselects['calendar'] = $LANG_configselects['calendar'];

// now load the language file we want to update
require_once $langfile;

echo "\nglobal \$LANG32;\n\n";

separator();
echo "# Array Format:\n";
echo "# \$LANGXX[YY]:  \$LANG - variable name\n";
echo "#               XX    - file id number\n";
echo "#               YY    - phrase id number\n";
separator();
echo "\n";
echo "# index.php";

mergeArrays($ENG_CAL_1, $LANG_CAL_1, 'LANG_CAL_1', false);
mergeArrays($ENG_CAL_SEARCH, $_LANG_CAL_SEARCH, '_LANG_CAL_SEARCH', false);

echo "\n";
separator();
echo "# calendar.php (\$LANG30)\n";
mergeArrays($ENG_CAL_2, $LANG_CAL_2, 'LANG_CAL_2', false);

echo "\n";
separator();
echo "# admin/plugins/calendar/index.php, formerly admin/event.php (\$LANG22)\n";
mergeArrays($ENG_CAL_ADMIN, $LANG_CAL_ADMIN, 'LANG_CAL_ADMIN', false);
mergeArrays($ENG_CAL_MESSAGE, $LANG_CAL_MESSAGE, 'LANG_CAL_MESSAGE', false);

echo "\n";

mergeString($ENG_MSG4, $PLG_calendar_MESSAGE4, 'PLG_calendar_MESSAGE4');
mergeString($ENG_MSG17, $PLG_calendar_MESSAGE17, 'PLG_calendar_MESSAGE17');
mergeString($ENG_MSG18, $PLG_calendar_MESSAGE18, 'PLG_calendar_MESSAGE18');
mergeString($ENG_MSG24, $PLG_calendar_MESSAGE24, 'PLG_calendar_MESSAGE24');
mergeString($ENG_MSG26, $PLG_calendar_MESSAGE26, 'PLG_calendar_MESSAGE26');

echo "\n";
echo "// Messages for the plugin upgrade\n";
mergeString($ENG_MSG3001, $PLG_calendar_MESSAGE3001, 'PLG_calendar_MESSAGE3001');
echo "\$PLG_calendar_MESSAGE3002 = \$LANG32[9];\n";

echo "\n";
echo "// Localization of the Admin Configuration UI";

mergeArrays($ENG_configsections['calendar'], $LANG_configsections['calendar'], "LANG_configsections['calendar']", false);
mergeArrays($ENG_confignames['calendar'], $LANG_confignames['calendar'], "LANG_confignames['calendar']", false);
mergeArrays($ENG_configsubgroups['calendar'], $LANG_configsubgroups['calendar'], "LANG_configsubgroups['calendar']", false);
mergeArrays($ENG_fs['calendar'], $LANG_fs['calendar'], "LANG_fs['calendar']", false);
echo "\n";
echo "// Note: entries 0, 1, 6, 9, 12 are the same as in \$LANG_configselects['Core']";
mergeArrays($ENG_configselects['calendar'], $LANG_configselects['calendar'], "LANG_configselects['calendar']", false);

?>

--- NEW FILE: core.inc ---
<?php

/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// | Geeklog 1.5                                                               |
// +---------------------------------------------------------------------------+
// | core.inc                                                                  |
// |                                                                           |
// | Update a core language file by merging it with english.php                |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2004-2008 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.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//
// $Id: core.inc,v 1.1 2008/04/27 17:11:13 dhaun Exp $

// save the english text strings
$ENG01 = $LANG01;
// $LANG02 moved to the Calendar plugin as of Geeklog 1.4.1
$ENG03 = $LANG03;
$ENG04 = $LANG04;
$ENGMY = $LANG_MYACCOUNT;
$ENG05 = $LANG05;
// $LANG06 moved to the Links plugin as of Geeklog 1.4.0
// $LANG07 moved to the Polls plugin as of Geeklog 1.4.0
$ENG08 = $LANG08;
$ENG09 = $LANG09;
$ENG10 = $LANG10;
$ENG11 = $LANG11;
$ENG12 = $LANG12;
// there are no $LANG13-$LANG19
$ENG20 = $LANG20;
$ENG21 = $LANG21;
// $LANG22 moved to the Calendar plugin as of Geeklog 1.4.1
// $LANG23 moved to the Links plugin as of Geeklog 1.4.0
$ENG24 = $LANG24;
// $LANG25 moved to the Polls plugin as of Geeklog 1.4.0
// there is no $LANG26
$ENG27 = $LANG27;
$ENG28 = $LANG28;
$ENG29 = $LANG29;
// $LANG30 moved to the Calendar plugin as of Geeklog 1.4.1
$ENG31 = $LANG31;
$ENG32 = $LANG32;
$ENG33 = $LANG33;

$ENGMS = $MESSAGE;
$ENGAC = $LANG_ACCESS;
$ENGDB = $LANG_DB_BACKUP;
$ENGBT = $LANG_BUTTONS;
$ENG404 = $LANG_404;
$ENGLO = $LANG_LOGIN;
$ENGPD = $LANG_PDF;
$ENGTB = $LANG_TRB;
$ENGDI = $LANG_DIR;
$ENGWN = $LANG_WHATSNEW;
$ENGMO = $LANG_MONTH;
$ENGWK = $LANG_WEEK;
$ENGAD = $LANG_ADMIN;

$ENG_commentcodes = $LANG_commentcodes;
$ENG_commentmodes = $LANG_commentmodes;
$ENG_cookiecodes = $LANG_cookiecodes;
$ENG_dateformats = $LANG_dateformats;
$ENG_featurecodes = $LANG_featurecodes;
$ENG_frontpagecodes = $LANG_frontpagecodes;
$ENG_postmodes = $LANG_postmodes;
$ENG_sortcodes = $LANG_sortcodes;
$ENG_trackbackcodes = $LANG_trackbackcodes;

$ENG_CONFIG = $LANG_CONFIG;
$ENG_configsections['Core'] = $LANG_configsections['Core'];
$ENG_confignames['Core'] = $LANG_confignames['Core'];
$ENG_configsubgroups['Core'] = $LANG_configsubgroups['Core'];
$ENG_fs['Core'] = $LANG_fs['Core'];
$ENG_configselects['Core'] = $LANG_configselects['Core'];

unset($LANG_MONTH);
unset($LANG_WEEK);

// now load the language file we want to update
require_once $langfile;

// try to rescue translated day and months names

if (!isset ($LANG_WEEK[1]) && isset ($LANG30[1])) {
    $LANG_WEEK = array ();
    for ($i = 1; $i <= 7; $i++) {
        $LANG_WEEK[$i] = $LANG30[$i];
    }
}

if (!isset ($LANG_MONTH[1]) && isset ($LANG30[13])) {
    $LANG_MONTH = array ();
    for ($i = 1; $i <= 12; $i++) {
        $LANG_MONTH[$i] = $LANG30[$i + 12];
    }
}

echo "\n\$LANG_CHARSET = '$LANG_CHARSET';\n";
if (isset ($LANG_DIRECTION)) {
    echo "\$LANG_DIRECTION = '$LANG_DIRECTION';\n\n";
} else {
    echo "\n";
}

separator();
echo "# Array Format:\n";
echo "# \$LANGXX[YY]:  \$LANG - variable name\n";
echo "#               XX    - file id number\n";
echo "#               YY    - phrase id number\n";
separator();
echo "\n";
separator();
echo "# USER PHRASES - These are file phrases used in end user scripts\n";
separator();
echo "\n";

mergeArrays($ENG01, $LANG01, 'LANG01', 'lib-common.php');
mergeArrays($ENG03, $LANG03, 'LANG03', 'comment.php');
mergeArrays($ENG04, $LANG04, 'LANG04', 'users.php');
mergeArrays($ENGMY,  $LANG_MYACCOUNT, 'LANG_MYACCOUNT', "Customize if need to modify the Tabbed navbar MyAccount panels used.\nArray index key matches preference div id");
mergeArrays($ENG05, $LANG05, 'LANG05', 'index.php');
mergeArrays($ENG08, $LANG08, 'LANG08', 'profiles.php');
mergeArrays($ENG09, $LANG09, 'LANG09', 'search.php');
mergeArrays($ENG10, $LANG10, 'LANG10', 'stats.php');
mergeArrays($ENG11, $LANG11, 'LANG11', 'article.php');
mergeArrays($ENG12, $LANG12, 'LANG12', 'submit.php');

separator();
echo "# ADMIN PHRASES - These are file phrases used in admin scripts\n";
separator();
echo "\n";

mergeArrays($ENG20, $LANG20, 'LANG20', 'admin/auth.inc.php');
mergeArrays($ENG21, $LANG21, 'LANG21', 'admin/block.php');
mergeArrays($ENG24, $LANG24, 'LANG24', 'admin/story.php');
mergeArrays($ENG27, $LANG27, 'LANG27', 'admin/topic.php');
mergeArrays($ENG28, $LANG28, 'LANG28', 'admin/user.php');
mergeArrays($ENG29, $LANG29, 'LANG29', 'admin/moderation.php');
mergeArrays($ENG31, $LANG31, 'LANG31', 'admin/mail.php');
mergeArrays($ENG32, $LANG32, 'LANG32', 'admin/plugins.php');
mergeArrays($ENG33, $LANG33, 'LANG33', 'admin/syndication.php');

mergeArrays($ENGMS,  $MESSAGE, 'MESSAGE', 'confirmation and error messages');
mergeArrays($ENGAC,  $LANG_ACCESS, 'LANG_ACCESS');
mergeArrays($ENGDB,  $LANG_DB_BACKUP, 'LANG_DB_BACKUP', 'admin/database.php');
mergeArrays($ENGBT,  $LANG_BUTTONS, 'LANG_BUTTONS');
mergeArrays($ENG404, $LANG_404, 'LANG_404', '404.php');
mergeArrays($ENGLO,  $LANG_LOGIN, 'LANG_LOGIN', 'login form');
mergeArrays($ENGPD,  $LANG_PDF, 'LANG_PDF', 'pdfgenerator.php');
mergeArrays($ENGTB,  $LANG_TRB, 'LANG_TRB', 'trackback.php');
mergeArrays($ENGDI,  $LANG_DIR, 'LANG_DIR', 'directory.php');
mergeArrays($ENGWN,  $LANG_WHATSNEW, 'LANG_WHATSNEW', "\"What's New\" Time Strings\n\nFor the first two strings, you can use the following placeholders.\nOrder them so it makes sense in your language:\n%i    item, \"Stories\"\n%n    amount, \"2\", \"20\" etc.\n%t    time, \"2\" (weeks)\n%s    scale, \"hrs\", \"weeks\"");
mergeArrays($ENGMO,  $LANG_MONTH, 'LANG_MONTH', 'Month names');
mergeArrays($ENGWK,  $LANG_WEEK, 'LANG_WEEK', 'Weekdays');
mergeArrays($ENGAD,  $LANG_ADMIN, 'LANG_ADMIN', "Admin - Strings\n\nThese are some standard strings used by core functions as well as plugins to\ndisplay administration lists and edit pages");

echo "# Localisation of the texts for the various drop-down menus that are actually\n# stored in the database. If these exist, they override the texts from the\n# database.\n";

mergeArrays($ENG_commentcodes, $LANG_commentcodes, 'LANG_commentcodes', false);
mergeArrays($ENG_commentmodes, $LANG_commentmodes, 'LANG_commentmodes', false);
mergeArrays($ENG_cookiecodes, $LANG_cookiecodes, 'LANG_cookiecodes', false);
mergeArrays($ENG_dateformats, $LANG_dateformats, 'LANG_dateformats', false);
mergeArrays($ENG_featurecodes, $LANG_featurecodes, 'LANG_featurecodes', false);
mergeArrays($ENG_frontpagecodes, $LANG_frontpagecodes, 'LANG_frontpagecodes', false);
mergeArrays($ENG_postmodes, $LANG_postmodes, 'LANG_postmodes', false);
mergeArrays($ENG_sortcodes, $LANG_sortcodes, 'LANG_sortcodes', false);
mergeArrays($ENG_trackbackcodes, $LANG_trackbackcodes, 'LANG_trackbackcodes', false);

echo "\n";
separator();
echo "# Localization of the Admin Configuration UI\n";

mergeArrays($ENG_CONFIG, $LANG_CONFIG, 'LANG_CONFIG', false);
mergeArrays($ENG_configsections['Core'], $LANG_configsections['Core'], "LANG_configsections['Core']", false);
mergeArrays($ENG_confignames['Core'], $LANG_confignames['Core'], "LANG_confignames['Core']", false);
mergeArrays($ENG_configsubgroups['Core'], $LANG_configsubgroups['Core'], "LANG_configsubgroups['Core']", false);
mergeArrays($ENG_fs['Core'], $LANG_fs['Core'], "LANG_fs['Core']", false);
mergeArrays($ENG_configselects['Core'], $LANG_configselects['Core'], "LANG_configselects['Core']", false);

?>




More information about the geeklog-cvs mailing list