Welcome, Guest. Please Login or Register.
April 26, 2025, 11:24:42 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Code 1.5.x] Extra Language String Detector 1.0 « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [Code 1.5.x] Extra Language String Detector 1.0  (Read 1066 times)
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
[Code 1.5.x] Extra Language String Detector 1.0
« on: March 09, 2003, 09:03:10 AM »
Reply with quote

Removing extra strings from your lng file can help speed up your board.  This can help you do that, by telling you exactly what is not being used.

Please do not use this if you don't know what you are doing.

Note that this is not under the GPL, despite being distributed as source code.  Do not redistrbiute.

<?php
// Extraneous language file checker, version 1.0.
// Copyright 2003 by [Unknown].  All rights reserved.  Do not redistribute without permission.

$cwd dirname(__FILE__);

// Change this to the language file you want to test.
$language_file $cwd '/english.lng';

define('YaBBSE'1);

require (
$language_file);

$sd dir($cwd '/Sources');
while (
$entry $sd->read())
{
   if (
is_file($cwd '/Sources/' $entry) && $entry != 'index.php' && $entry != 'gpl.txt')
      
$file_list[] = $cwd '/Sources/' $entry;
}
$sd->close();
$file_list[] = $cwd '/SSI.php';
$file_list[] = $cwd '/help.php';
$file_list[] = $cwd '/Printpage.php';
$file_list[] = $cwd '/Reminder.php';

foreach (
$file_list as $file)
{
   
$full implode(''file($file));
   
preg_match_all('/\$txt\[(?:\')?([^\]]+?)(?:\')?\]/i'$full$matches);

   foreach (
$matches[1] as $text)
      if (isset(
$txt[$text]))
         unset (
$txt[$text]);
}

foreach (
$txt as $key => $text)
   
$txt[$key] = htmlspecialchars($text);

ksort($txt);

echo 
'<pre>';
print_r($txt);
echo 
'</pre>';

?>


-[Unknown]
Logged
Zulu
Full Member
***
Posts: 104


I'm no longer a llama, I'm a Monkey

WWW
Re:[Code 1.5.x] Extra Language String Detector 1.0
« Reply #1 on: March 09, 2003, 11:04:37 AM »
Reply with quote

some strings are used in the bottom of the english.lng file too.. In the $img sections ;)
Logged

Webby @ RFI
Formerly known as PtPazuzu
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Code 1.5.x] Extra Language String Detector 1.0
« Reply #2 on: March 09, 2003, 06:09:06 PM »
Reply with quote

Very true, but reading in the lng file to find them isn't gonna work.

Indeed, realize that a few (ie. Logout) are used in $img.

-[Unknown]
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Code 1.5.x] Extra Language String Detector 1.0 « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.012 seconds with 16 queries.