LuckyCoinkydink/lang/plugin_lang.php
2006-08-02 10:07:34 +00:00

156 lines
8.7 KiB
PHP

<?php
function help() {
echo "This helper application lists all missing constants from plugin translations.\n\n";
echo "==================================================\n";
echo "Call Syntax:\n";
echo "\tphp plugin_lang.php [lang]\n";
echo "==================================================\n";
echo "\n";
echo "[lang] needs to replaced with the language you want to compare against.\n";
echo "Example:\n";
echo "\tphp plugin_lang.php de\n";
echo "\tThis command will show all untranslated german strings.\n\n";
}
if (!is_array($argv) || empty($argv[1])) {
echo "==================================================\n";
echo "This tool is intended to be called via commandline!\n";
echo "==================================================\n\n";
help();
die();
}
$lang = preg_replace('@[^a-z0-9]@', '', strtolower($argv[1]));
echo "Probing language $lang\n";
$base = '../plugins/';
$d = @opendir($base);
if (!$d) {
die('Failure');
}
$const = array();
$const['checked'] = get_defined_constants();
while(($file = readdir($d)) !== false) {
if ($file{0} == '.') {
continue;
}
if (!is_dir($base . '/' . $file)) {
continue;
}
$tfile = $base . '/' . $file . '/lang_en.inc.php';
$sfile = $base . '/' . $file . '/lang_' . $lang . '.inc.php';
if (file_exists($tfile)) {
echo "Parsing english language from $file - ";
include $tfile;
$current = get_defined_constants();
$const['native'][$file] = array_diff($current, $const['checked']);
$const['checked'] = array_merge($const['checked'], $current);
echo count($const['native'][$file]) . " constants.\n";
} else {
echo "NOTICE: English language of $file does not exist.\n";
continue;
}
if (file_exists($sfile)) {
echo "Parsing differences for $file - ";
include $sfile;
$current = get_defined_constants();
$const['missing'][$file] = array_diff($current, $const['checked']);
$const['checked'] = array_merge($const['checked'], $current);
echo count($const['missing'][$file]) . " missing constants.\n";
} else {
$const['missing'][$file] = $const['native'][$file];
}
echo "\n";
}
echo "Showing missing constants:\n\n";
foreach($const['missing'] AS $file => $constants) {
echo strtoupper($file) . ":\n";
foreach($constants AS $const => $val) {
echo "\t" . $const . "\n";
echo "\t\t" . $val . "\n";
}
echo "---------------------------\n";
}
@define('INSTALL_RSSFETCHLIMIT', 'Entries to display in Feeds');
@define('INSTALL_RSSFETCHLIMIT_DESC', 'Number of entries to display for each page on the RSS Feed.');
@define('INSTAL_DB_UTF8', 'Enable DB-charset conversion');
@define('INSTAL_DB_UTF8_DESC', 'Issues a MySQL "SET NAMES" query to indicate the required charset for the database. Turn this on or off, if you see weird characters in your blog.');
@define('ONTHEFLYSYNCH', 'Enable on-the-fly media synchronization');
@define('ONTHEFLYSYNCH_DESC', 'If enabled, Serendipity will compare the media database with the files stored on your server and synchronize the database and directory contents.');
@define('USERCONF_CHECK_USERNAME_ERROR', 'The username cannot be left blank.');
@define('FURTHER_LINKS', 'Further Links');
@define('FURTHER_LINKS_S9Y', 'Serendipity Homepage');
@define('FURTHER_LINKS_S9Y_DOCS', 'Serendipity Documentation');
@define('FURTHER_LINKS_S9Y_BLOG', 'Official Blog');
@define('FURTHER_LINKS_S9Y_FORUMS', 'Forums');
@define('FURTHER_LINKS_S9Y_SPARTACUS', 'Spartacus');
@define('COMMENT_IS_DELETED', '(Comment removed)');
@define('CURRENT_AUTHOR', 'Current author');
@define('WORD_NEW', 'New');
@define('SHOW_MEDIA_TOOLBAR', 'Show toolbar within media selector popup?');
@define('MEDIA_KEYWORDS', 'Media keywords');
@define('MEDIA_KEYWORDS_DESC', 'Enter a list of ";" separated words that you want to use as pre-defined keywords for media items.');
@define('MEDIA_EXIF', 'Import EXIF/JPEG image data');
@define('MEDIA_EXIF_DESC', 'If enabled, existing EXIF/JPEG metadata of images will be parsed and stored in the database for display in the media gallery.');
@define('MEDIA_PROP', 'Media properties');
@define('GO_ADD_PROPERTIES', 'Go & enter properties');
@define('MEDIA_PROPERTY_DPI', 'DPI');
@define('MEDIA_PROPERTY_COPYRIGHT', 'Copyright');
@define('MEDIA_PROPERTY_COMMENT1', 'Short Comment');
@define('MEDIA_PROPERTY_COMMENT2', 'Long Comment');
@define('MEDIA_PROPERTY_TITLE', 'Title');
@define('MEDIA_PROP_DESC', 'Enter a list of ";" separated property fields you want to define for each media file');
@define('MEDIA_PROP_MULTIDESC', '(You can append ":MULTI" after any item to indicate that this item will contain long text instead of just some characters)');
@define('STYLE_OPTIONS_NONE', 'This theme/style has no specific options. To see how your template can specify options, read the Technical Documentation on www.s9y.org about "Configuration of Theme options".');
@define('STYLE_OPTIONS', 'Theme/Style options');
@define('PLUGIN_AVAILABLE_COUNT', 'Total: %d plugins.');
@define('SYNDICATION_RFC2616', 'Activate strict RFC2616 RSS-Feed compliance');
@define('SYNDICATION_RFC2616_DESC', 'NOT Enforcing RFC2616 means that all Conditional GETs to Serendipity will return entries last modified since the time of the last request. With that setting to "false", your visitors will get all articles since their last request, which is considered a good thing. However, some Agents like Planet act weird, if that happens, at it also vioaltes RFC2616. So if you set this option to "TRUE" you will compliy with that RFC, but readers of your RSS feed might miss items in their holidays. So either way, either it hearts Aggregators like Planet, or it hurts actual readers of your blog. If you are facing complaints from either side, you can toggle this option. Reference: https://sourceforge.net/tracker/index.php?func=detail&aid=1461728&group_id=75065&atid=542822');
@define('MEDIA_PROPERTY_DATE', 'Associated Date');
@define('MEDIA_PROPERTY_RUN_LENGTH', 'Run-Length');
@define('FILENAME_REASSIGNED', 'Automagically assigned new file name: %s');
@define('MEDIA_UPLOAD_SIZE', 'Max. file upload size');
@define('MEDIA_UPLOAD_SIZE_DESC', 'Enter the maximum filesize for uploaded files in bytes. This setting can be overruled by server-side settings in PHP.ini: upload_max_filesize, post_max_size, max_input_time all take precedence over this option. An empty string means to only use the server-side limits.');
@define('MEDIA_UPLOAD_SIZEERROR', 'Error: You cannot upload files larger than %s bytes!');
@define('MEDIA_UPLOAD_MAXWIDTH', 'Max. width of image files for upload');
@define('MEDIA_UPLOAD_MAXWIDTH_DESC', 'Enter the maximum image width in pixels for uploaded images.');
@define('MEDIA_UPLOAD_MAXHEIGHT', 'Max. height of image files for upload');
@define('MEDIA_UPLOAD_MAXHEIGHT_DESC', 'Enter the maximum image height in pixels for uploaded images.');
@define('MEDIA_UPLOAD_DIMERROR', 'Error: You cannot upload image files larger than %s x %s pixels!');
@define('MEDIA_TARGET', 'Target for this link');
@define('MEDIA_TARGET_JS', 'Popup window (via JavaScript, adaptive size)');
@define('MEDIA_ENTRY', 'Isolated Entry');
@define('MEDIA_TARGET_BLANK', 'Popup window (via target=_blank)');
@define('MEDIA_DYN_RESIZE', 'Allow dynamic image resizing?');
@define('MEDIA_DYN_RESIZE_DESC', 'If enabled, the media selector can return images in any requested size via a GET variable. The results are cached, and thus can create a large filebase if you make intensive use of it.');
@define('MEDIA_DIRECTORY_MOVED', 'Directory and files were successfully moved to %s');
@define('MEDIA_DIRECTORY_MOVE_ERROR', 'Directory and files could not be moved to %s!');
@define('MEDIA_DIRECTORY_MOVE_ENTRY', 'On Non-MySQL databases, iterating through every article to replace the old directory URLs with new directory URLs is not possible. You will need to manually edit your entries to fix new URLs. You can still move your old directory back to where it was, if that is too cumbersome for you.');
@define('MEDIA_DIRECTORY_MOVE_ENTRIES', 'Moved the URL of the moved directory in %s entries.');@define('PLUGIN_ACTIVE', 'Active');
@define('PLUGIN_INACTIVE', 'Inactive');
@define('PREFERENCE_USE_JS', 'Enable advanced JS usage?');
@define('PREFERENCE_USE_JS_DESC', 'If enabled, advanced JavaScript sections will be enabled for better usability, like in the Plugin Configuration section you can use drag and drop for re-ordering plugins.');
@define('PREFERENCE_USE_JS_WARNING', '(This page uses advanced JavaScripting. If you are having functionality issues, please disable the use of advanced JS usage in your personal preferences or disable your browser\'s JavaScript)');
@define('INSTALL_PERMALINK_COMMENTSPATH', 'Path to comments');