1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Issue #6 Language File Optimization.

This commit is contained in:
Cameron
2015-07-08 14:52:16 -07:00
parent af53d2dd3d
commit e6ef1483da
12 changed files with 84 additions and 38 deletions

View File

@@ -10,21 +10,26 @@
* With code from Izydor and Lolo.
*
*/
require_once("../class2.php");
if (!defined('e107_INIT'))
{
require_once("../class2.php");
}
if (!getperms("L"))
{
header("location:".e_BASE."index.php");
exit;
}
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_lancheck.php');
$e_sub_cat = 'language';
// require_once("auth.php");
$frm = e107::getForm();
$mes = e107::getMessage();
$lck = new lancheck;
// $lck = new lancheck;
/*
@@ -297,14 +302,26 @@ class lancheck
var $core_plugins = array();
var $core_themes = array("bootstrap");
var $core_themes = array("bootstrap3");
var $errorsOnly = false;
var $coreImage = array();
private $thirdPartyPlugins = true;
function __construct()
{
$this->core_plugins = e107::getPlugin()->getCorePlugins();
}
public function thirdPartyPlugins($val)
{
$this->thirdPartyPlugins = $val;
}
function init()
public function init()
{
$ns = e107::getRender();
$tp = e107::getParser();
@@ -314,7 +331,7 @@ class lancheck
$this->core_themes[] = $pref['sitetheme'];
$this->core_themes = array_unique($this->core_themes);
$this->core_plugins = e107::getPlugin()->getCorePlugins();
if(E107_DEBUG_LEVEL > 0)
{
@@ -886,20 +903,43 @@ class lancheck
return array();
}
require_once(e_HANDLER."file_class.php");
$fl = new e_file;
$fl = e107::getFile();
$ret = array();
if($lang_array = $fl->get_files($comp_dir, ".php$","standard",$depth)){
sort($lang_array);
}
if(strpos($comp_dir,e_LANGUAGEDIR) !== false)
{
$regexp = "#.php#";
$mode = 'core';
}
else
{
$regexp = "#".$lang."#";
$mode = 'plugins';
}
$regexp = (strpos($comp_dir,e_LANGUAGEDIR) !== FALSE) ? "#.php#" : "#".$lang."#";
// $regexp = (strpos($comp_dir,e_LANGUAGEDIR) !== FALSE) ? "#.php#" : "#".$lang."#";
foreach($lang_array as $f)
{
if($mode == 'plugins')
{
$tmpDir = str_replace($comp_dir,'',$f['path']);
// echo "<br />".$tmpDir;
list($pluginDirectory, $other) = explode("/",$tmpDir, 2);
if($mode == 'plugins' && ($this->thirdPartyPlugins !== true) && !in_array($pluginDirectory, $this->core_plugins))
{
continue;
}
}
if(preg_match($regexp,$f['path'].$f['fname']) && is_file($f['path'].$f['fname']))
{
$allData = file_get_contents($f['path'].$f['fname']);

View File

@@ -1258,7 +1258,7 @@ class mailout_main_ui extends e_admin_ui
</colgroup>
<tbody>
<tr>
<td>".LAN_MAILOUT_32."</td>
<td>".LAN_EMAIL."</td>
<td><div class='input-append'>".$frm->text('mail_bounce_email2', $pref['mail_bounce_email'], 40, 'size=xlarge');
if(!empty($pref['mail_bounce_email']))
@@ -1316,7 +1316,7 @@ class mailout_main_ui extends e_admin_ui
</colgroup>
<tbody>";
$bouncePrefs = array('mail_bounce_email'=>LAN_MAILOUT_32, 'mail_bounce_pop3'=>LAN_MAILOUT_33, 'mail_bounce_user'=>LAN_MAILOUT_34, 'mail_bounce_pass'=>LAN_PASSWORD);
$bouncePrefs = array('mail_bounce_email'=>LAN_EMAIL, 'mail_bounce_pop3'=>LAN_MAILOUT_33, 'mail_bounce_user'=>LAN_MAILOUT_34, 'mail_bounce_pass'=>LAN_PASSWORD);
foreach($bouncePrefs as $key =>$label)
{

View File

@@ -241,7 +241,7 @@ class users_admin_ui extends e_admin_ui
'user_loginname' => array('title' => LAN_USER_02, 'tab'=>0, 'type' => 'text', 'data'=>'str', 'width' => 'auto'), // User name
'user_login' => array('title' => LAN_USER_03, 'tab'=>0, 'type' => 'text', 'data'=>'str', 'width' => 'auto'), // Real name (no real vetting)
'user_customtitle' => array('title' => LAN_USER_04, 'tab'=>0, 'type' => 'text', 'data'=>'str', 'width' => 'auto'), // No real vetting
'user_password' => array('title' => LAN_USER_05, 'tab'=>0, 'type' => 'method', 'data'=>'str', 'width' => 'auto'), //TODO add md5 option to form handler?
'user_password' => array('title' => LAN_PASSWORD, 'tab'=>0, 'type' => 'method', 'data'=>'str', 'width' => 'auto'), //TODO add md5 option to form handler?
'user_sess' => array('title' => 'Session', 'tab'=>0, 'noedit'=>true, 'type' => 'text', 'width' => 'auto'), // Photo
'user_image' => array('title' => LAN_USER_07, 'tab'=>0, 'type' => 'dropdown', 'data'=>'str', 'width' => 'auto'), // Avatar
'user_email' => array('title' => LAN_EMAIL, 'tab'=>0, 'type' => 'text', 'inline'=>true, 'data'=>'str', 'width' => 'auto'),

View File

@@ -4392,7 +4392,7 @@ class e_form
</tbody>
</table>";
$text .= "<div class='alert alert-block alert-info center middle'>".LAN_NO_RECORDS."</div>"; // not prone to column-count issues.
$text .= "<div class='alert alert-block alert-info center middle'>".LAN_NO_RECORDS_FOUND."</div>"; // not prone to column-count issues.
}
else
{

View File

@@ -50,19 +50,23 @@ class language{
"bs" => "Bosnian",
"br" => "Breton",
"bg" => "Bulgarian",
"my" => "Burmese",
"ca" => "Catalan",
"cs" => "Czech",
"ch" => "Chamorro",
"ce" => "Chechen",
"cn" => "ChineseSimp",
"tw" => "ChineseTrad",
"cv" => "Chuvash",
"kw" => "Cornish",
"co" => "Corsican",
"cy" => "Welsh",
"da" => "Danish",
"de" => "German",
"nl" => "Dutch",
"dz" => "Dzongkha",
"el" => "Greek",
"de" => "German",
"en" => "English",
"eo" => "Esperanto",
"et" => "Estonian",
@@ -74,9 +78,10 @@ class language{
"fr" => "French",
"fy" => "Frisian",
"gd" => "Gaelic",
"el" => "Greek",
"ga" => "Irish",
"gl" => "Gallegan",
"gv" => "Manx",
"gn" => "Guarani",
"gu" => "Gujarati",
"ha" => "Hausa",
@@ -123,13 +128,14 @@ class language{
"mn" => "Mongolian",
"mi" => "Maori",
"ms" => "Malay",
"my" => "Burmese",
"gv" => "Manx",
"na" => "Nauru",
"nv" => "Navajo",
"ng" => "Ndonga",
"ne" => "Nepali",
"nl" => "Dutch",
"no" => "Norwegian",
"ny" => "Chichewa",
@@ -176,13 +182,14 @@ class language{
"ts" => "Tsonga",
"tk" => "Turkmen",
"tr" => "Turkish",
"tw" => "ChineseTrad",
"ug" => "Uighur",
"uk" => "Ukrainian",
"ur" => "Urdu",
"uz" => "Uzbek",
"vi" => "Vietnamese",
"cy" => "Welsh",
"wo" => "Wolof",
"xh" => "Xhosa",
"yi" => "Yiddish",
@@ -407,7 +414,7 @@ class language{
*/
function toNative($lang)
{
return ($this->names[$lang]) ? $this->names[$lang] : $lang;
return (!empty($this->names[$lang])) ? $this->names[$lang] : $lang;
}
/**
@@ -655,7 +662,7 @@ class language{
*/
public function getList()
{
return $this->list;
return $this->list;
}
}

View File

@@ -1022,6 +1022,7 @@ function show_emessage($mode, $message, $line = 0, $file = "") {
}
// include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_error.php");
global $mySQLdefaultdb;
$emessage[1] = "<b>".LAN_ERROR_25."</b>";
$emessage[2] = "<b>".LAN_ERROR_26."</b>";
@@ -1029,7 +1030,7 @@ function show_emessage($mode, $message, $line = 0, $file = "") {
$emessage[4] = "<b>".LAN_ERROR_28."</b>";
$emessage[5] = LAN_ERROR_29;
$emessage[6] = "<b>".LAN_ERROR_30."</b>";
$emessage[7] = "<b>".LAN_ERROR_31."</b>";
$emessage[7] = "<b>".$tp->lanVars(LAN_ERROR_31, $mySQLdefaultdb)."</b>";
/*$emessage[8] = "
<div style='text-align:center; font: 12px Verdana, Tahoma'><b>".LAN_ERROR_32." </b><br /><br />
".chr(36)."ADMIN_DIRECTORY = \"e107_admin/\";<br />

View File

@@ -109,6 +109,9 @@ define("LAN_RATING", "Rating");
define("LAN_IMAGE","Image");
define("LAN_ABOUT", "About");
define("LAN_TITLE", "Title");
define("LAN_USER", "User");
define("LAN_EMAIL","Email address");
define("LAN_ENTER_USRNAME_EMAIL", "Please enter your username or email"); // admin php hover field admin name
define("LAN_PWD_REQUIRED", "Password is required"); // admin php hover field admin password

View File

@@ -326,13 +326,13 @@ define("LAN_COMMENTMAN", "Comments Manager");
define("LAN_LIST", "List");
define("LAN_FILTER", "Filter");
define("LAN_NO_RECORDS", "No Records Found");
// define("LAN_NO_RECORDS", "No Records Found");
define("LAN_STATUS", "Status");
define("LAN_URL", "URL");
define("LAN_USER", "User");
define("LAN_OWNER", "Owner");
define("LAN_EMAIL","Email address");
define("LAN_ID", "ID");

View File

@@ -42,7 +42,7 @@ define("LAN_MAILOUT_28", "Save Changes");
define("LAN_MAILOUT_29", "seconds");
define("LAN_MAILOUT_30", "Used mostly with SMTP keepalive. A pause of more than 30 seconds may cause the browser to time-out");
define("LAN_MAILOUT_31", "Bounced Email Processing");
define("LAN_MAILOUT_32", "Email address");
// define("LAN_MAILOUT_32", "Email address");
define("LAN_MAILOUT_33", "Incoming Mail server");
define("LAN_MAILOUT_34", "Account (user) Name");
// define("LAN_MAILOUT_35", "Password");

View File

@@ -44,7 +44,7 @@ define("LAN_ERROR_27", "[3]: Core settings saved - backup made active.");
define("LAN_ERROR_28", "[4]: No core backup found. Check that your database has valid content. If not, please run the <a href='".e_FILE_ABS."resetcore/resetcore.php'>Reset_Core</a> utility to rebuild your core settings. <br />After rebuilding your core please save a backup from the admin/sql screen.");
define("LAN_ERROR_29", "[5]: Field(s) have been left blank. Please resubmit the form and fill in the required fields.");
define("LAN_ERROR_30", "[6]: Unable to form a valid connection to mySQL. Please check that your e107_config.php contains the correct information.");
define("LAN_ERROR_31", "[7]: mySQL is running but database ({$mySQLdefaultdb}) couldn't be connected to.<br />Please check it exists and that your configuration file contains the correct information.");
define("LAN_ERROR_31", "[7]: mySQL is running but database [x] couldn't be connected to.<br />Please check it exists and that your configuration file contains the correct information.");
define("LAN_ERROR_32", "To complete the upgrade, copy the following text into your e107_config.php file:");
define("LAN_ERROR_33", "Processing error! Normally, I would redirect to the home page.");

View File

@@ -35,10 +35,10 @@ define("LAN_USER_01","Display name");
define("LAN_USER_02","Login Name");
define("LAN_USER_03","Real Name");
define("LAN_USER_04","Custom title");
define("LAN_USER_05","Password");
// define("LAN_USER_05","Password"); //LAN_PASSWORD
define("LAN_USER_06","Photograph");
define("LAN_USER_07","Avatar");
define("LAN_USER_08","Email address");
// define("LAN_USER_08","Email address");
define("LAN_USER_09","Signature");
define("LAN_USER_10","Hide email");
//define("LAN_USER_11","XUP file");

View File

@@ -1,17 +1,12 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2009 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/languages/English/English_log.php,v $
* $Revision$
* $Date$
* $Author$
*/
/**