summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--].gitignore0
-rwxr-xr-x[-rw-r--r--].hgignore0
-rw-r--r--admin/admin_languages_inc.php46
-rw-r--r--admin/index.php2
-rw-r--r--admin/schema_inc.php12
-rwxr-xr-xajax_translate.php4
-rwxr-xr-xedit_languages.php7
-rwxr-xr-xget_strings.php519
-rwxr-xr-x[-rw-r--r--]icons/google-favicon.pngbin993 -> 993 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/de-at.gifbin361 -> 361 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/de.gifbin362 -> 362 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/en-uk.gifbin382 -> 382 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/en.gifbin367 -> 367 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/es.gifbin360 -> 360 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/fi.gifbin371 -> 371 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/fr.gifbin366 -> 366 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/it.gifbin366 -> 366 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/tk.gifbin371 -> 371 bytes
-rwxr-xr-x[-rw-r--r--]icons/languages/zh-cn.gifbin366 -> 366 bytes
-rwxr-xr-x[-rw-r--r--]icons/pkg_languages.gifbin1621 -> 1621 bytes
-rwxr-xr-x[-rw-r--r--]icons/pkg_languages.pngbin2378 -> 2378 bytes
-rwxr-xr-ximport.php5
-rwxr-xr-xincludes/classes/Babelfish.php50
-rwxr-xr-xincludes/classes/Bablotron.php278
-rwxr-xr-xincludes/classes/BitLanguage.php67
-rwxr-xr-xincludes/classes/LibertyTranslations.php9
-rw-r--r--index.php2
-rw-r--r--lang/ar/language.php4
-rw-r--r--lang/ca/language.php7
-rw-r--r--lang/cn/language.php4
-rw-r--r--lang/cs/language.php4
-rw-r--r--lang/da/language.php4
-rwxr-xr-xlang/de/language.php4
-rw-r--r--lang/el/language.php4
-rw-r--r--lang/en-uk/language.php4
-rw-r--r--lang/es/language.php4
-rwxr-xr-xlang/fi/language.php4
-rwxr-xr-xlang/fr/language.php4
-rw-r--r--lang/he/language.php4
-rw-r--r--lang/hr/language.php4
-rw-r--r--lang/hu/language.php4
-rw-r--r--lang/it/language.php4
-rw-r--r--lang/ja/language.php4
-rw-r--r--lang/ko/language.php4
-rw-r--r--lang/masters.php9
-rw-r--r--lang/nl/language.php4
-rw-r--r--lang/no/language.php4
-rw-r--r--lang/pl/language.php4
-rw-r--r--lang/pt-br/language.php4
-rw-r--r--lang/pt/language.php4
-rwxr-xr-xlang/ro/language.php4
-rwxr-xr-xlang/ru/language.php4
-rw-r--r--lang/sb/language.php4
-rw-r--r--lang/sk/language.php4
-rw-r--r--lang/sl/language.php4
-rw-r--r--lang/sr-latn/language.php4
-rw-r--r--lang/sr/language.php4
-rw-r--r--lang/sv/language.php4
-rw-r--r--lang/tr/language.php4
-rw-r--r--lang/tv/language.php4
-rw-r--r--lang/tw/language.php4
-rw-r--r--lang/uk/language.php4
-rw-r--r--lang/zh-cn/language.php4
-rwxr-xr-xliberty_plugins/data.tr.php4
-rwxr-xr-xliberty_plugins/data.translated.php19
-rwxr-xr-xmaster_strings.php13
-rwxr-xr-x[-rw-r--r--]modules/help_mod_switch_language_dropdown.tpl0
-rwxr-xr-x[-rw-r--r--]modules/help_mod_switch_language_links.tpl0
-rw-r--r--modules/index.php2
-rw-r--r--modules/mod_switch_language_dropdown.php2
-rwxr-xr-x[-rw-r--r--]modules/mod_switch_language_dropdown.tpl0
-rw-r--r--modules/mod_switch_language_links.php2
-rwxr-xr-x[-rw-r--r--]modules/mod_switch_language_links.tpl0
-rwxr-xr-x[-rw-r--r--]templates/admin_languages.tpl0
-rwxr-xr-x[-rw-r--r--]templates/i18n_service_icons.tpl0
-rwxr-xr-x[-rw-r--r--]templates/import_languages.tpl0
-rwxr-xr-x[-rw-r--r--]templates/import_resolve.tpl0
-rw-r--r--templates/index.php2
-rwxr-xr-x[-rw-r--r--]templates/language_master_strings.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_languages.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_languages_admin.tpl0
-rwxr-xr-x[-rw-r--r--]templates/select_translations.tpl0
-rwxr-xr-xtranslate_strings.php9
83 files changed, 592 insertions, 614 deletions
diff --git a/.gitignore b/.gitignore
index 45f8873..45f8873 100644..100755
--- a/.gitignore
+++ b/.gitignore
diff --git a/.hgignore b/.hgignore
index 68aa467..68aa467 100644..100755
--- a/.hgignore
+++ b/.hgignore
diff --git a/admin/admin_languages_inc.php b/admin/admin_languages_inc.php
index ce8fcf9..90c533b 100644
--- a/admin/admin_languages_inc.php
+++ b/admin/admin_languages_inc.php
@@ -1,42 +1,42 @@
<?php
-$formLanguageToggles = array(
- 'i18n_browser_languages' => array(
+$formLanguageToggles = [
+ 'i18n_browser_languages' => [
'label' => 'Browser Language Recognition',
'note' => 'This will automatically recognise what the browsers default language is set to and display that language.<br />Please make sure you import appropriate languages first and disable / remove languages you don\'t want to support since loading a language for the first time will induce a lot of database traffic and might cause your system to slow down temporarily.',
- ),
- 'i18n_content_translation' => array(
+ ],
+ 'i18n_content_translation' => [
'label' => 'Content Translation',
'note' => 'This will activate the content translation service. Users will be given links to content in alternate languages, and prompted to create translation while editing content.',
- 'warning' => 'Please note that this feature is experimental.'
- ),
- 'i18n_interactive_translation' => array(
+ 'warning' => 'Please note that this feature is experimental.',
+ ],
+ 'i18n_interactive_translation' => [
'label' => 'Interactive Translations',
'note' => 'This will help you translate your site very effitiently by giving you direct access to the correct translation page.<br />Once you are done translating, make sure you turn this feature off and clear the language cache.<br />This feature only works when you set <em>$smarty_force_compile</em> to true in your <em>config/kernel/config_inc.php</em> file',
'page' => 'TranslationTutorial',
- 'link' => array(
+ 'link' => [
'title' => 'Language cache',
'package' => 'languages',
- 'file' => 'edit_languages.php'
- ),
- ),
- 'i18n_interactive_bittranslation' => array(
+ 'file' => 'edit_languages.php',
+ ],
+ ],
+ 'i18n_interactive_bittranslation' => [
'label' => 'Interactive bitTranslations',
'note' => 'If you have a <a href="https://bitweaver.org/forums/viewtopic.php?t=948">translators account</a> on bitweaver.org, the translation links will redirect you there that you can modify the tranlations there. Due to the different setup on bitweaver.org, there might be strings that are not available for translation on that server.',
- ),
- 'i18n_record_untranslated' => array(
+ ],
+ 'i18n_record_untranslated' => [
'label' => 'Record untranslated',
'note' => 'This will record any untranslated language strings.',
- ),
- 'i18n_track_translation_usage' => array(
+ ],
+ 'i18n_track_translation_usage' => [
'label' => 'Track Translation Usage',
'note' => 'Track which strings are used in your version of bitweaver so only the currently used strings appear while editing translations. You must clear your language and templates cache after enabling this option.',
- 'link' => array(
+ 'link' => [
'title' => 'Language cache',
'package' => 'languages',
- 'file' => 'edit_languages.php'
- ),
- ),
-);
+ 'file' => 'edit_languages.php',
+ ],
+ ],
+];
$gBitSmarty->assign( 'formLanguageToggles',$formLanguageToggles );
// Handle Update
@@ -45,9 +45,9 @@ if( isset( $_REQUEST["prefs"] )) {
simple_set_toggle( $toggle, LANGUAGES_PKG_NAME );
}
- $pref_byref_values = array(
+ $pref_byref_values = [
"bitlanguage",
- );
+ ];
foreach( $pref_byref_values as $britem ) {
byref_set_value( $britem, null, LANGUAGES_PKG_NAME );
}
diff --git a/admin/index.php b/admin/index.php
index 3e305fe..c0437d0 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -1,4 +1,4 @@
-<?php
+<?php
// This is not a package.
header ("location: ../index.php");
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index d577c43..35b33dc 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -1,6 +1,6 @@
<?php
-$tables = [
+$tables = [
'i18n_languages' => "
lang_code C(32) PRIMARY,
@@ -60,18 +60,18 @@ $gBitInstaller->registerSchemaIndexes( LANGUAGES_PKG_NAME, $indices );
//);
//$gBitInstaller->registerSchemaSequences( LIBERTY_PKG_NAME, $sequences );
-$gBitInstaller->registerPackageInfo( LANGUAGES_PKG_NAME, [
+$gBitInstaller->registerPackageInfo( LANGUAGES_PKG_NAME, [
'description' => "This package allows you to translate your site into a different language.",
'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
] );
// ### Default Preferences
-$gBitInstaller->registerPreferences( LANGUAGES_PKG_NAME, [
+$gBitInstaller->registerPreferences( LANGUAGES_PKG_NAME, [
[ LANGUAGES_PKG_NAME, 'i18n_record_untranslated','y' ],
] );
// ### Default UserPermissions
-$gBitInstaller->registerUserPermissions( LANGUAGES_PKG_NAME, [
+$gBitInstaller->registerUserPermissions( LANGUAGES_PKG_NAME, [
[ 'p_languages_create', 'Can create new languages', 'admin', LANGUAGES_PKG_NAME],
[ 'p_languages_edit', 'Can edit translations', 'editors', LANGUAGES_PKG_NAME],
[ 'p_languages_delete', 'Can delete languages', 'admin', LANGUAGES_PKG_NAME],
@@ -79,7 +79,7 @@ $gBitInstaller->registerUserPermissions( LANGUAGES_PKG_NAME, [
[ 'p_languages_import', 'Can import and export language files', 'editors', LANGUAGES_PKG_NAME],
] );
-$gBitInstaller->registerSchemaDefault( LANGUAGES_PKG_NAME, [
+$gBitInstaller->registerSchemaDefault( LANGUAGES_PKG_NAME, [
"INSERT INTO `".BIT_DB_PREFIX."i18n_languages` (`lang_code`,`native_name`,`english_name`,`right_to_left`) VALUES ('ar', 'ﺎﻠﻋﺮﺒﻳﺓ', 'Arabic','y' )",
"INSERT INTO `".BIT_DB_PREFIX."i18n_languages` (`lang_code`,`native_name`,`english_name`) VALUES ('ca', 'Català', 'Catalan')",
"INSERT INTO `".BIT_DB_PREFIX."i18n_languages` (`lang_code`,`native_name`,`english_name`) VALUES ('cs', 'Český', 'Czech')",
@@ -122,7 +122,7 @@ $gBitInstaller->registerSchemaDefault( LANGUAGES_PKG_NAME, [
] );
// Package requirements
-$gBitInstaller->registerRequirements( LANGUAGES_PKG_NAME, [
+$gBitInstaller->registerRequirements( LANGUAGES_PKG_NAME, [
'liberty' => [ 'min' => '5.0.0' ],
'users' => [ 'min' => '5.0.0' ],
'kernel' => [ 'min' => '5.0.0' ],
diff --git a/ajax_translate.php b/ajax_translate.php
index 06a8975..6e7e40f 100755
--- a/ajax_translate.php
+++ b/ajax_translate.php
@@ -39,8 +39,8 @@ if( !empty( $_REQUEST['lang'] ) && !empty( $_REQUEST['source_hash'] ) ) {
$preppedTranslation = preg_replace( '/<smarty /', '{', $translation );
// needs to be a full tag so we can cleanly de-tagify after translation
$preppedTranslation = preg_replace( '/><\/smarty>/', '}', $preppedTranslation );
-
- print json_encode( array( 'lang_code' => $_REQUEST['lang'], 'source_hash' => $_REQUEST['source_hash'], 'translation' => $preppedTranslation ) );
+
+ print json_encode( [ 'lang_code' => $_REQUEST['lang'], 'source_hash' => $_REQUEST['source_hash'], 'translation' => $preppedTranslation ] );
}
}
}
diff --git a/edit_languages.php b/edit_languages.php
index b3921f8..36eed06 100755
--- a/edit_languages.php
+++ b/edit_languages.php
@@ -29,7 +29,6 @@ if( !empty( $_REQUEST['un_trans'] ) ) {
$gBitSmarty->assign( 'unTrans', 1 );
}
-
if( !empty( $_REQUEST['clear_cache'] ) ) {
$gBitLanguage->clearCache();
$gBitSmarty->assign( 'saveSuccess', tra( 'System template and language cache have been cleared.' ) );
@@ -77,11 +76,11 @@ if( !empty( $_REQUEST['clear_cache'] ) ) {
} else {
$formHash['delete_lang_code'] = $_REQUEST['lang'];
$formHash['delete_language'] = true;
- $msgHash = array(
+ $msgHash = [
'label' => tra('Delete Language'),
'confirm_item' => tra('Are you sure you want to remove this language?') . ' ' . $languages[$_REQUEST['lang']]['native_name'],
'warning' => tra('This will permanently remove the languages and all translations.'),
- );
+ ];
$gBitSystem->confirmDialog( $formHash,$msgHash );
}
}
@@ -104,6 +103,6 @@ if( !empty( $_REQUEST['clear_cache'] ) ) {
$gBitSmarty->assign( 'editDescription', true );
}
-$gBitSystem->display( 'bitpackage:languages/edit_languages.tpl', tra( 'Edit Languages' ) , array( 'display_mode' => 'edit' ));
+$gBitSystem->display( 'bitpackage:languages/edit_languages.tpl', tra( 'Edit Languages' ) , [ 'display_mode' => 'edit' ]);
?>
diff --git a/get_strings.php b/get_strings.php
index cee9820..8dd3f78 100755
--- a/get_strings.php
+++ b/get_strings.php
@@ -26,17 +26,15 @@
* @var string groupwrite : Sets the generated files permissions to allow the generated language.php also be group writable. This is good for translators if they do not have root access to tiki but are in the same group as the webserver. Please remember to have write access removed when translation is finished for security reasons. (Run script again whithout this parameter)
*/
-
-
////////////////////////////////////////////////////////////////////////////
/// functions
-$addPHPslashes = Array ("\n" => '\n',
+$addPHPslashes = ["\n" => '\n',
"\r" => '\r',
"\t" => '\t',
'\\' => '\\\\',
'$' => '\$',
- '"' => '\"');
+ '"' => '\"', ];
function addphpslashes ($string) {
// Translate as in "Table 7-1 Escaped characters" in the PHP manual
@@ -54,27 +52,26 @@ function addphpslashes ($string) {
return strtr ($string, $addPHPslashes);
}
-
-$removePHPslashes = Array ('\n' => "\n",
+$removePHPslashes = ['\n' => "\n",
'\r' => "\r",
'\t' => "\t",
'\\\\' => '\\',
'\$' => '$',
- '\"' => '"');
+ '\"' => '"', ];
function removephpslashes ($string) {
- // $string = str_replace ('\n', "\n", $string);
+ // $string = str_replace ('\n', "\n", $string);
// $string = str_replace ('\r', "\r", $string);
// $string = str_replace ('\t', "\t", $string);
// $string = str_replace ('\\\\', '\\', $string);
// $string = str_replace ('\$', '$', $string);
// $string = str_replace ('\"', '"', $string);
// We skip the exotic regexps for octal an hexadecimal
- // notation - \{0-7]{1,3} and \x[0-9A-Fa-f]{1,2} - since they
+ // notation - \{0-7]{1,3} and \x[0-9A-Fa-f]{1,2} - since they
// should not apper in english strings.
if (preg_match ('/\{0-7]{1,3}|\x[0-9A-Fa-f]{1,2}/', $string, $match)) {
- trigger_error ("Octal or hexadecimal string '".$match[1]."' not supported",
- E_WARNING);
+ trigger_error ("Octal or hexadecimal string '".$match[1]."' not supported",
+ E_WARNING, );
}
// return $string;
@@ -94,28 +91,28 @@ function collect_files ($dir)
global $files;
$handle = opendir ($dir);
while (false !== ($file = readdir ($handle))) {
- // Skip current and parent directory
- // also skip other directories which may contain source code
- // that should not be translated (the directories normally contain
- // temporary results etc.)
- // Please note that these directories will be skipped on all levels
- if ('.' == $file || '..' == $file ||
- 'lang' == $file || 'templates_c' == $file || 'dump' == $file ||
- 'util' == $file || 'gallery2' == $file || 'shopping' == $file ||
- 'temp' == $file || 'img' == $file || 'cache' == $file) {
- continue;
- }
+ // Skip current and parent directory
+ // also skip other directories which may contain source code
+ // that should not be translated (the directories normally contain
+ // temporary results etc.)
+ // Please note that these directories will be skipped on all levels
+ if ('.' == $file || '..' == $file ||
+ 'lang' == $file || 'templates_c' == $file || 'dump' == $file ||
+ 'util' == $file || 'gallery2' == $file || 'shopping' == $file ||
+ 'temp' == $file || 'img' == $file || 'cache' == $file) {
+ continue;
+ }
- $filepath = $dir . '/' . $file;
- if (preg_match ("/.*\.(tpl|php)$/", $file)) {
- print("File: $filepath<br />");
- $files[] = $filepath;
- }
- else {
- if (is_dir ($filepath)) {
+ $filepath = $dir . '/' . $file;
+ if (preg_match ("/.*\.(tpl|php)$/", $file)) {
+ print("File: $filepath<br />");
+ $files[] = $filepath;
+ }
+ else {
+ if (is_dir ($filepath)) {
collect_files ($filepath);
- }
- }
+ }
+ }
}
closedir ($handle);
}
@@ -123,26 +120,25 @@ function collect_files ($dir)
function addToWordlist (&$wordlist, $sentence) {
global $spelling;
if ($spelling) {
- // Perhapps regexphandling must be improved?!
- // Spellcheckers seems to handle special chars quite OK however.
- $words = preg_split ("/[\s]+/", $sentence);
-
- foreach ($words as $dummy => $word) {
- $wordlist[strtolower($word)] = 1;
- }
+ // Perhapps regexphandling must be improved?!
+ // Spellcheckers seems to handle special chars quite OK however.
+ $words = preg_split ("/[\s]+/", $sentence);
+
+ foreach ($words as $dummy => $word) {
+ $wordlist[strtolower($word)] = 1;
+ }
}
}
-
function writeFile_and_User ($fd, $outstring) {
print (nl2br ($outstring));
fwrite ($fd, $outstring);
}
function writeTranslationPair ($fd, $key, $val) {
- writeFile_and_User ($fd,
- '"' . addphpslashes ($key) . '"' . " => " .
- '"' . addphpslashes ($val) . '",');
+ writeFile_and_User ($fd,
+ '"' . addphpslashes ($key) . '"' . " => " .
+ '"' . addphpslashes ($val) . '",', );
}
////////////////////////////////////////////////////////////////////////////
@@ -163,31 +159,29 @@ $group_w = isset ($_REQUEST['groupwrite']);
$nohelp = isset ($_REQUEST['nohelp']);
$nosections = isset ($_REQUEST['nosections']);
-
// Get the language(s)
-$languages = Array();
+$languages = [];
print "Languages: ";
if (isset ($_REQUEST["lang"])) {
$lang = $_REQUEST["lang"];
$languages[] = $lang;
- print ("$lang");
+ print ("$lang");
}
else {
$handle=opendir ('lang');
while (false !== ($lang = readdir ($handle))) {
- if($lang == '.' || $lang == '..')
- continue;
- print("$lang ");
- $languages[] = $lang;
+ if($lang == '.' || $lang == '..')
+ continue;
+ print("$lang ");
+ $languages[] = $lang;
}
closedir ($handle);
-}
-print "<br />";
-
+}
+print "<br />";
-$files = Array();
+$files = [];
-$wordlist = Array ();
+$wordlist = [];
## When collecting files we need to add a file since the directory which it
## is placed in is excluded. We should keep hardwiring to a minimum.
@@ -197,52 +191,49 @@ $wordlist = Array ();
collect_files ( BIT_ROOT_PATH );
hardwire_file ( LANGUAGES_PKG_INCLUDE_PATH.'lang_mapping_inc.php');
-
-
$oldEndMarker = '##end###';
$endMarker = '###end###';
foreach ($languages as $sel) {
unset ($lang);
unset ($to_translate);
- unset ($translated);
+ unset ($translated);
unset ($modulename);
unset ($unused);
unset ($dictionary);
- $to_translate = Array ();
- $modulename = Array ();
- $translated = Array ();
+ $to_translate = [];
+ $modulename = [];
+ $translated = [];
if ($patch) {
- $origPatch = "lang/$sel/language.patch";
- if (!file_exists ($origPatch)) {
- die ("No patch file .../$origPatch exisits");
- }
- require $origPatch;
- $patchLang = $lang;
- unset ($lang);
+ $origPatch = "lang/$sel/language.patch";
+ if (!file_exists ($origPatch)) {
+ die ("No patch file .../$origPatch exisits");
+ }
+ require $origPatch;
+ $patchLang = $lang;
+ unset ($lang);
}
require "lang/$sel/language.php";
if (isset ($lang[$oldEndMarker])) {
- unset ($lang[$oldEndMarker]);
+ unset ($lang[$oldEndMarker]);
}
if (isset ($lang[$endMarker])) {
- unset ($lang[$endMarker]);
+ unset ($lang[$endMarker]);
}
$unused = $lang;
$dictionary = $lang;
-
if ($group_w) {
- // We set umask to zero value to allow proper chmod later
- // (Is this really nesserary? Does not chmod work independently of umask?)
- $old_umask = umask (0);
+ // We set umask to zero value to allow proper chmod later
+ // (Is this really nesserary? Does not chmod work independently of umask?)
+ $old_umask = umask (0);
}
$fw = fopen( LANGUAGES_PKG_PATH."lang/$sel/new_language.php",'w');
-
+
print "&lt;";
fwrite($fw,"<");
writeFile_and_User ($fw, "?php");
@@ -253,225 +244,217 @@ foreach ($languages as $sel) {
writeFile_and_User ($fw, " // -*- coding:utf-8 -*-\n");
if (!$nohelp) {
- // Good to have instructions for translators in the release file.
- // The comments get filtered away by Smarty anyway
- writeFile_and_User ($fw, "// parameters:\n");
- writeFile_and_User ($fw, "// lang=xx : only tranlates language 'xx',\n");
- writeFile_and_User ($fw, "// if not given all languages are translated\n");
- writeFile_and_User ($fw, "// comments : generate all comments (equal to close&module)\n");
- writeFile_and_User ($fw, "// close : look for similar strings that are allready translated and\n");
- writeFile_and_User ($fw, "// generate a commet if a 'match' is made\n");
- writeFile_and_User ($fw, "// module : generate comments that describes in which .php and/or .tpl\n");
- writeFile_and_User ($fw, "// module(s) a certain string was found (useful for checking\n");
- writeFile_and_User ($fw, "// translations in context)\n");
-
- writeFile_and_User ($fw, "// patch : looks for the file 'language.patch' in the same directory\n");
- writeFile_and_User ($fw, "// as the corresponding language.php and overrides any strings\n");
- writeFile_and_User ($fw, "// in language.php - good if a user does not agree with\n");
- writeFile_and_User ($fw, "// some translations or if only changes are sent to the maintaner\n");
+ // Good to have instructions for translators in the release file.
+ // The comments get filtered away by Smarty anyway
+ writeFile_and_User ($fw, "// parameters:\n");
+ writeFile_and_User ($fw, "// lang=xx : only tranlates language 'xx',\n");
+ writeFile_and_User ($fw, "// if not given all languages are translated\n");
+ writeFile_and_User ($fw, "// comments : generate all comments (equal to close&module)\n");
+ writeFile_and_User ($fw, "// close : look for similar strings that are allready translated and\n");
+ writeFile_and_User ($fw, "// generate a commet if a 'match' is made\n");
+ writeFile_and_User ($fw, "// module : generate comments that describes in which .php and/or .tpl\n");
+ writeFile_and_User ($fw, "// module(s) a certain string was found (useful for checking\n");
+ writeFile_and_User ($fw, "// translations in context)\n");
- writeFile_and_User ($fw, "// spelling : generates a file 'spellcheck_me.txt' that contains the\n");
- writeFile_and_User ($fw, "// words used in the translation.It is then easy to check this\n");
- writeFile_and_User ($fw, "// file for spelling errors (corrections must be done in\n ");
- writeFile_and_User ($fw, "// 'language.php, however)\n");
+ writeFile_and_User ($fw, "// patch : looks for the file 'language.patch' in the same directory\n");
+ writeFile_and_User ($fw, "// as the corresponding language.php and overrides any strings\n");
+ writeFile_and_User ($fw, "// in language.php - good if a user does not agree with\n");
+ writeFile_and_User ($fw, "// some translations or if only changes are sent to the maintaner\n");
+ writeFile_and_User ($fw, "// spelling : generates a file 'spellcheck_me.txt' that contains the\n");
+ writeFile_and_User ($fw, "// words used in the translation.It is then easy to check this\n");
+ writeFile_and_User ($fw, "// file for spelling errors (corrections must be done in\n ");
+ writeFile_and_User ($fw, "// 'language.php, however)\n");
- writeFile_and_User ($fw, "// groupwrite : Sets the generated files permissions to allow the generated\n");
- writeFile_and_User ($fw, "// language.php also be group writable. This is good for\n");
- writeFile_and_User ($fw, "// translators if they do not have root access to tiki but\n");
- writeFile_and_User ($fw, "// are in the same group as the webserver. Please remember\n");
- writeFile_and_User ($fw, "// to have write access removed when translation is finished\n");
- writeFile_and_User ($fw, "// for security reasons. (Run script again without this\n");
- writeFile_and_User ($fw, "// parameter)\n");
+ writeFile_and_User ($fw, "// groupwrite : Sets the generated files permissions to allow the generated\n");
+ writeFile_and_User ($fw, "// language.php also be group writable. This is good for\n");
+ writeFile_and_User ($fw, "// translators if they do not have root access to tiki but\n");
+ writeFile_and_User ($fw, "// are in the same group as the webserver. Please remember\n");
+ writeFile_and_User ($fw, "// to have write access removed when translation is finished\n");
+ writeFile_and_User ($fw, "// for security reasons. (Run script again without this\n");
+ writeFile_and_User ($fw, "// parameter)\n");
+ writeFile_and_User ($fw, "// Examples:\n");
+ writeFile_and_User ($fw, "// http://www.neonchart.com/get_strings.php?lang=sv\n");
+ writeFile_and_User ($fw, "// Will translate langauage 'sv' and (almost) avoiding comment generation\n\n");
-
-
- writeFile_and_User ($fw, "// Examples:\n");
- writeFile_and_User ($fw, "// http://www.neonchart.com/get_strings.php?lang=sv\n");
- writeFile_and_User ($fw, "// Will translate langauage 'sv' and (almost) avoiding comment generation\n\n");
-
- writeFile_and_User ($fw, "// http://www.neonchart.com/get_strings.php?lang=sv&comments\n");
- writeFile_and_User ($fw, "// Will translate langauage 'sv' and generate all possible comments.\n");
- writeFile_and_User ($fw, "// This is the most usefull mode when working on a translation.\n\n");
- writeFile_and_User ($fw, "// http://www.neonchart.com/get_strings.php?lang=sv&nohelp&nosections\n");
- writeFile_and_User ($fw, "// These options will only provide the minimal amout of comments.\n");
- writeFile_and_User ($fw, "// Usefull mode when preparing a translation for distribution.\n\n");
- writeFile_and_User ($fw, "// http://www.neonchart.com/get_strings.php?nohelp&nosections\n");
- writeFile_and_User ($fw, "// Prepare all languages for release \n\n");
+ writeFile_and_User ($fw, "// http://www.neonchart.com/get_strings.php?lang=sv&comments\n");
+ writeFile_and_User ($fw, "// Will translate langauage 'sv' and generate all possible comments.\n");
+ writeFile_and_User ($fw, "// This is the most usefull mode when working on a translation.\n\n");
+ writeFile_and_User ($fw, "// http://www.neonchart.com/get_strings.php?lang=sv&nohelp&nosections\n");
+ writeFile_and_User ($fw, "// These options will only provide the minimal amout of comments.\n");
+ writeFile_and_User ($fw, "// Usefull mode when preparing a translation for distribution.\n\n");
+ writeFile_and_User ($fw, "// http://www.neonchart.com/get_strings.php?nohelp&nosections\n");
+ writeFile_and_User ($fw, "// Prepare all languages for release \n\n");
}
-
// Start generating the lang array
- writeFile_and_User ($fw, "\n\$lang=Array(\n");
-
- foreach ($files as $file) {
- $fp = fopen ($file, "r");
- $data = fread ($fp, filesize ($file));
- fclose ($fp);
-
- unset ($words); $words = Array ();
- unset ($uqwords); $uqwords = Array ();
- unset ($sqwords); $sqwords = Array ();
- unset ($dqwords); $dqwords = Array ();
+ writeFile_and_User ($fw, "\n\$lang=Array(\n");
+ foreach ($files as $file) {
+ $fp = fopen ($file, "r");
+ $data = fread ($fp, filesize ($file));
+ fclose ($fp);
- // PM for unusual regexps
- // (?m) sets PCRE_MULTILINE which makes '^' and '$' ignore '\n'
- // (?s) sets PCRE_DOTALL which makes that '.' also matches '\n'
- // ?: below makes that the pharentesis is not extracted int the outarray
- // +? below is the nongreedy version of the ? operator
+ unset ($words); $words = [];
+ unset ($uqwords); $uqwords = [];
+ unset ($sqwords); $sqwords = [];
+ unset ($dqwords); $dqwords = [];
+ // PM for unusual regexps
+ // (?m) sets PCRE_MULTILINE which makes '^' and '$' ignore '\n'
+ // (?s) sets PCRE_DOTALL which makes that '.' also matches '\n'
+ // ?: below makes that the pharentesis is not extracted int the outarray
+ // +? below is the nongreedy version of the ? operator
- if (preg_match ("/\.php$/", $file)) {
- // Do not translate PHP comments (we only filter the "safe" cases)
- // Calling php -w <filename> would take care of all comments,
- // but that does not go well with safe-mode.
- $data = preg_replace ("/(?s)\/\*.*?\*\//", "", $data); // C comments
- $data = preg_replace ("/(?m)^\s*\/\/.*\$/", "", $data); // C++ comments
- $data = preg_replace ("/(?m)^\s*\#.*\$/", "", $data); // shell comments
+ if (preg_match ("/\.php$/", $file)) {
+ // Do not translate PHP comments (we only filter the "safe" cases)
+ // Calling php -w <filename> would take care of all comments,
+ // but that does not go well with safe-mode.
+ $data = preg_replace ("/(?s)\/\*.*?\*\//", "", $data); // C comments
+ $data = preg_replace ("/(?m)^\s*\/\/.*\$/", "", $data); // C++ comments
+ $data = preg_replace ("/(?m)^\s*\#.*\$/", "", $data); // shell comments
- // Only extract tra () and hawtra () in .php-files
+ // Only extract tra () and hawtra () in .php-files
- // Extract from SINGLE qouted strings
- preg_match_all ('/(?s)[^a-zA-Z0-9_\x7f-\xff](?:haw)?tra\s*\(\s*\'(.+?)\'\s*\)/', $data, $sqwords);
+ // Extract from SINGLE qouted strings
+ preg_match_all ('/(?s)[^a-zA-Z0-9_\x7f-\xff](?:haw)?tra\s*\(\s*\'(.+?)\'\s*\)/', $data, $sqwords);
- // Extract from DOUBLE quoted strings
- preg_match_all ('/(?s)[^a-zA-Z0-9_\x7f-\xff](?:haw)?tra\s*\(\s*"(.+?)"\s*\)/', $data, $dqwords);
- }
+ // Extract from DOUBLE quoted strings
+ preg_match_all ('/(?s)[^a-zA-Z0-9_\x7f-\xff](?:haw)?tra\s*\(\s*"(.+?)"\s*\)/', $data, $dqwords);
+ }
- if (preg_match ("/\.tpl$/", $file)) {
- // Do not translate text in Smarty comments: {* Smarty comment *}
- $data = preg_replace ('/(?s)\{\*.*?\*\}/', '', $data); // Smarty comment
+ if (preg_match ("/\.tpl$/", $file)) {
+ // Do not translate text in Smarty comments: {* Smarty comment *}
+ $data = preg_replace ('/(?s)\{\*.*?\*\}/', '', $data); // Smarty comment
- // Strings of the type {$perms[user].type} need (should)
- // not be translated
- $data = preg_replace ('/(?s)\{tr\}\s*\{[$][^\}]*?\}\s*\{\/tr\}/','',$data);
+ // Strings of the type {$perms[user].type} need (should)
+ // not be translated
+ $data = preg_replace ('/(?s)\{tr\}\s*\{[$][^\}]*?\}\s*\{\/tr\}/','',$data);
- // Only extract ... in .tpl-files
- preg_match_all ('/(?s)\{tr\}(.+?)\{\/tr\}/', $data, $uqwords);
- }
+ // Only extract ... in .tpl-files
+ preg_match_all ('/(?s)\{tr\}(.+?)\{\/tr\}/', $data, $uqwords);
+ }
- // Transfer UNqouted words (if any) to the words array
- if (count ($uqwords) > 0) {
- $words = $uqwords[1];
- }
+ // Transfer UNqouted words (if any) to the words array
+ if (count ($uqwords) > 0) {
+ $words = $uqwords[1];
+ }
- // Transfer SINGLEqouted words (if any) to the words array
- if (count ($sqwords) > 0) {
- foreach (array_unique ($sqwords[1]) as $sqword) {
+ // Transfer SINGLEqouted words (if any) to the words array
+ if (count ($sqwords) > 0) {
+ foreach (array_unique ($sqwords[1]) as $sqword) {
// Strip the extracted strings from escapes
// (these will not be reinserted during generation, since ' need
// not be escaped when string delimeters are double quotes)
$word = preg_replace ("/\\'/", "'", $sqword);
- $words[$word] = $word;
- }
- }
+ $words[$word] = $word;
+ }
+ }
- // Transfer DOUBLEqouted words (if any) to the words array
- if (count ($dqwords) > 0) {
- foreach (array_unique ($dqwords[1]) as $dqword) {
+ // Transfer DOUBLEqouted words (if any) to the words array
+ if (count ($dqwords) > 0) {
+ foreach (array_unique ($dqwords[1]) as $dqword) {
// Strip the extracted strings from escapes
// (these will be reinserted during generation)
-
+
$word = removephpslashes ($dqword);
- $words["$word"] = "$word";
- }
- }
+ $words["$word"] = "$word";
+ }
+ }
- foreach (array_unique ($words) as $word) {
- if (isset ($lang[$word])) {
+ foreach (array_unique ($words) as $word) {
+ if (isset ($lang[$word])) {
if (!isset ($translated[$word])) {
$translated[$word] = $lang[$word];
}
unset ($unused[$word]);
- }
- else {
+ }
+ else {
if (!isset ($to_translate[$word])) {
$to_translate[$word]=$word;
}
- }
-
- if (isset ($modulename[$word])) {
+ }
+
+ if (isset ($modulename[$word])) {
if (!strpos ($modulename[$word], $file)) {
$modulename[$word] = $modulename[$word] .', '. $file;
}
- }
- else {
+ }
+ else {
$modulename[$word] = $file;
- }
- }
+ }
+ }
} // foreach ($files as $file)
-
//////////////////////////////////////////////
if ($patch) {
- foreach ($unused as $key => $val) {
- if (isset ($patchLang[$key])) {
+ foreach ($unused as $key => $val) {
+ if (isset ($patchLang[$key])) {
$unused[$key] = $patchLang[$key];
- }
- }
-
- foreach ($to_translate as $key => $val) {
- if (isset ($patchLang[$key])) {
+ }
+ }
+
+ foreach ($to_translate as $key => $val) {
+ if (isset ($patchLang[$key])) {
// $to_translate[$key] = $patchLang[$key];
// We are removing words from the to_translate list,
// since they are provided by the patch
unset ($to_translate[$key]);
- }
- }
-
- foreach ($translated as $key=>$val) {
- if (isset ($patchLang[$key])) {
+ }
+ }
+
+ foreach ($translated as $key=>$val) {
+ if (isset ($patchLang[$key])) {
$translated[$key] = $patchLang[$key];
- }
- }
+ }
+ }
}
unset ($unused['']);
if (count ($unused) > 0) {
- writeFile_and_User ($fw, "// ### Start of unused words\n");
- writeFile_and_User ($fw, "// ### Please remove manually!\n");
- writeFile_and_User ($fw, "// ### N.B. Legitimate strings may be marked");
- writeFile_and_User ($fw, "// ### as unused!\n");
- writeFile_and_User ($fw, "// ### Please see https://bitweaver.org/wiki/index.php?page=UnusedWords for furhter info.\n");
- foreach ($unused as $key => $val) {
- writeTranslationPair ($fw, $key, $val);
- addToWordlist ($wordlist, $val);
- writeFile_and_User ($fw, "\n");
- }
- writeFile_and_User ($fw, "// ### end of unused words\n\n");
+ writeFile_and_User ($fw, "// ### Start of unused words\n");
+ writeFile_and_User ($fw, "// ### Please remove manually!\n");
+ writeFile_and_User ($fw, "// ### N.B. Legitimate strings may be marked");
+ writeFile_and_User ($fw, "// ### as unused!\n");
+ writeFile_and_User ($fw, "// ### Please see https://bitweaver.org/wiki/index.php?page=UnusedWords for furhter info.\n");
+ foreach ($unused as $key => $val) {
+ writeTranslationPair ($fw, $key, $val);
+ addToWordlist ($wordlist, $val);
+ writeFile_and_User ($fw, "\n");
+ }
+ writeFile_and_User ($fw, "// ### end of unused words\n\n");
}
unset ($to_translate['']);
if (count ($to_translate) > 0) {
- if ('en' != $sel && !$nosections) {
- writeFile_and_User ($fw, "// ### start of untranslated words\n");
- writeFile_and_User ($fw,
- "// ### uncomment value pairs as you translate\n");
- }
- foreach ($to_translate as $key => $val) {
- writeFile_and_User ($fw, "// ");
- writeTranslationPair ($fw, $key, $val);
- addToWordlist ($wordlist, $val);
- if ($module || $close) {
+ if ('en' != $sel && !$nosections) {
+ writeFile_and_User ($fw, "// ### start of untranslated words\n");
+ writeFile_and_User ($fw,
+ "// ### uncomment value pairs as you translate\n", );
+ }
+ foreach ($to_translate as $key => $val) {
+ writeFile_and_User ($fw, "// ");
+ writeTranslationPair ($fw, $key, $val);
+ addToWordlist ($wordlist, $val);
+ if ($module || $close) {
$closeText = "";
$moduleText = "";
if ($close) {
$dist = 256;
foreach ($dictionary as $english=>$trans) {
- $d = levenshtein (strtolower (substr ($key, 0, 255)),
- strtolower (substr ($english, 0, 255)));
- if ($d < $dist) {
- $dist = $d;
- $closeTrans = $trans;
- $closeEnglish = $english;
- }
+ $d = levenshtein (strtolower (substr ($key, 0, 255)),
+ strtolower (substr ($english, 0, 255)), );
+ if ($d < $dist) {
+ $dist = $d;
+ $closeTrans = $trans;
+ $closeEnglish = $english;
+ }
}
-
+
if ($dist < 1 + strlen ($key)/5) {
- $closeText = ' // ## CLOSE: "' . addphpslashes ($closeEnglish) .
- '" => "' . addphpslashes ($closeTrans) . '"';
+ $closeText = ' // ## CLOSE: "' . addphpslashes ($closeEnglish) .
+ '" => "' . addphpslashes ($closeTrans) . '"';
}
}
@@ -480,60 +463,60 @@ foreach ($languages as $sel) {
}
writeFile_and_User ($fw, "{$closeText}{$moduleText}");
- }
- writeFile_and_User ($fw, "\n");
- }
- if ('en' != $sel && !$nosections) {
- writeFile_and_User ($fw, "// ### end of untranslated words\n");
- writeFile_and_User ($fw, "// ###\n\n");
- }
+ }
+ writeFile_and_User ($fw, "\n");
+ }
+ if ('en' != $sel && !$nosections) {
+ writeFile_and_User ($fw, "// ### end of untranslated words\n");
+ writeFile_and_User ($fw, "// ###\n\n");
+ }
}
if ('en' != $sel && !$nosections) {
- writeFile_and_User($fw, "// ###\n");
- writeFile_and_User ($fw,"// ### start of possibly untranslated words\n");
- writeFile_and_User($fw, "// ###\n\n");
+ writeFile_and_User($fw, "// ###\n");
+ writeFile_and_User ($fw,"// ### start of possibly untranslated words\n");
+ writeFile_and_User($fw, "// ###\n\n");
}
foreach ($translated as $key => $val) {
- if ($key == $val) {
- writeTranslationPair ($fw, $key, $val);
- addToWordlist ($wordlist, $val);
- if ($module) {
+ if ($key == $val) {
+ writeTranslationPair ($fw, $key, $val);
+ addToWordlist ($wordlist, $val);
+ if ($module) {
writeFile_and_User ($fw, ' // '. $modulename[$key]);
- }
- writeFile_and_User ($fw, "\n");
- }
+ }
+ writeFile_and_User ($fw, "\n");
+ }
}
if ('en' != $sel && !$nosections) {
- writeFile_and_User($fw, "// ###\n");
- writeFile_and_User($fw, "// ### end of possibly untranslated words\n");
- writeFile_and_User($fw, "// ###\n\n");
+ writeFile_and_User($fw, "// ###\n");
+ writeFile_and_User($fw, "// ### end of possibly untranslated words\n");
+ writeFile_and_User($fw, "// ###\n\n");
}
foreach($translated as $key => $val) {
- if ($key != $val) {
- writeTranslationPair ($fw, $key, $val);
- addToWordlist ($wordlist, $val);
- if ($module) {
+ if ($key != $val) {
+ writeTranslationPair ($fw, $key, $val);
+ addToWordlist ($wordlist, $val);
+ if ($module) {
writeFile_and_User ($fw, ' // '. $modulename[$key]);
- }
- writeFile_and_User ($fw, "\n");
- }
+ }
+ writeFile_and_User ($fw, "\n");
+ }
}
writeFile_and_User ($fw, '"'.$endMarker.'"=>"'.$endMarker.'");'."\n");
- print "?&gt;<br />\n";
- fwrite ($fw, '?>'."\n");
+ print "?&gt;<br />\n";
+ fwrite ($fw, '?>'."\n");
fclose ($fw);
if ($spelling) {
- $fw = fopen("lang/$sel/spellcheck_me.txt", 'w');
- ksort ($wordlist);
- reset ($wordlist);
- foreach ($wordlist as $word => $dummy) {
- fwrite ($fw, "$word\n");
- }
+ $fw = fopen("lang/$sel/spellcheck_me.txt", 'w');
+ ksort ($wordlist);
+ reset ($wordlist);
+ foreach ($wordlist as $word => $dummy) {
+ fwrite ($fw, "$word\n");
+ }
- fclose ($fw);
+ fclose ($fw);
}
@unlink ("lang/$sel/old.php");
@@ -541,10 +524,10 @@ foreach ($languages as $sel) {
rename ("lang/$sel/new_language.php","lang/$sel/language.php");
if ($group_w) {
- // chmod the file to be writeable also by group for users that do not
- // have root acces
- chmod ("lang/$sel/language.php", 0664);
+ // chmod the file to be writeable also by group for users that do not
+ // have root acces
+ chmod ("lang/$sel/language.php", 0664);
- umask($old_umask); // Reset umask back to original value
+ umask($old_umask); // Reset umask back to original value
}
} \ No newline at end of file
diff --git a/icons/google-favicon.png b/icons/google-favicon.png
index 81e390d..81e390d 100644..100755
--- a/icons/google-favicon.png
+++ b/icons/google-favicon.png
Binary files differ
diff --git a/icons/languages/de-at.gif b/icons/languages/de-at.gif
index 87e1217..87e1217 100644..100755
--- a/icons/languages/de-at.gif
+++ b/icons/languages/de-at.gif
Binary files differ
diff --git a/icons/languages/de.gif b/icons/languages/de.gif
index 75728dd..75728dd 100644..100755
--- a/icons/languages/de.gif
+++ b/icons/languages/de.gif
Binary files differ
diff --git a/icons/languages/en-uk.gif b/icons/languages/en-uk.gif
index 3e16ff8..3e16ff8 100644..100755
--- a/icons/languages/en-uk.gif
+++ b/icons/languages/en-uk.gif
Binary files differ
diff --git a/icons/languages/en.gif b/icons/languages/en.gif
index 8f198f7..8f198f7 100644..100755
--- a/icons/languages/en.gif
+++ b/icons/languages/en.gif
Binary files differ
diff --git a/icons/languages/es.gif b/icons/languages/es.gif
index c27d65e..c27d65e 100644..100755
--- a/icons/languages/es.gif
+++ b/icons/languages/es.gif
Binary files differ
diff --git a/icons/languages/fi.gif b/icons/languages/fi.gif
index 8d3a191..8d3a191 100644..100755
--- a/icons/languages/fi.gif
+++ b/icons/languages/fi.gif
Binary files differ
diff --git a/icons/languages/fr.gif b/icons/languages/fr.gif
index 43d0b80..43d0b80 100644..100755
--- a/icons/languages/fr.gif
+++ b/icons/languages/fr.gif
Binary files differ
diff --git a/icons/languages/it.gif b/icons/languages/it.gif
index d79e90e..d79e90e 100644..100755
--- a/icons/languages/it.gif
+++ b/icons/languages/it.gif
Binary files differ
diff --git a/icons/languages/tk.gif b/icons/languages/tk.gif
index e407d55..e407d55 100644..100755
--- a/icons/languages/tk.gif
+++ b/icons/languages/tk.gif
Binary files differ
diff --git a/icons/languages/zh-cn.gif b/icons/languages/zh-cn.gif
index b052530..b052530 100644..100755
--- a/icons/languages/zh-cn.gif
+++ b/icons/languages/zh-cn.gif
Binary files differ
diff --git a/icons/pkg_languages.gif b/icons/pkg_languages.gif
index fe93dbd..fe93dbd 100644..100755
--- a/icons/pkg_languages.gif
+++ b/icons/pkg_languages.gif
Binary files differ
diff --git a/icons/pkg_languages.png b/icons/pkg_languages.png
index acedf80..acedf80 100644..100755
--- a/icons/pkg_languages.png
+++ b/icons/pkg_languages.png
Binary files differ
diff --git a/import.php b/import.php
index 7d2c200..b7e9796 100755
--- a/import.php
+++ b/import.php
@@ -95,7 +95,7 @@ if (isset($_REQUEST["import"])) {
header ("Content-Disposition: attachment; filename=language-".$langCode.".php");
echo $data;
exit (0);
- } else {
+ }
// This file MUST be name "...txt" for security reasons.
// if the file ended with .php - an evil editor could enter evil shit into a translation, and export it to your temp dir, and then execute it.
// XOXO spiderr
@@ -104,7 +104,6 @@ if (isset($_REQUEST["import"])) {
fwrite( $file, $data );
fclose( $file );
$impMsg['success'] = "Language file has been exported to <a href=\"".TEMP_PKG_URL.$fileName."\">$fileName</a>";
- }
// unset this massive array to free up memory
unset( $gBitLanguage->mStrings[$_REQUEST['export_lang_code']] );
@@ -116,6 +115,6 @@ $gBitSmarty->assign('expLanguages', $expLanguages );
$gBitSmarty->assign( 'impmsg', $impMsg );
-$gBitSystem->display( $mid, 'Languages Im/Export' , array( 'display_mode' => 'display' ));
+$gBitSystem->display( $mid, 'Languages Im/Export' , [ 'display_mode' => 'display' ]);
?>
diff --git a/includes/classes/Babelfish.php b/includes/classes/Babelfish.php
index 8029db5..bcf1b73 100755
--- a/includes/classes/Babelfish.php
+++ b/includes/classes/Babelfish.php
@@ -34,7 +34,7 @@ class Babelfish {
if (!isset($_SERVER['SERVER_PORT'])) {
return $rv;
}
-
+
if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) {
if ($_SERVER['SERVER_PORT'] != 443) {
$rv .= ':' . $_SERVER['SERVER_PORT'];
@@ -47,7 +47,7 @@ class Babelfish {
return $rv;
}
-
+
/**
* Return babelfish URL to translate \c $lang_from to \c $lang_to
*
@@ -55,22 +55,22 @@ class Babelfish {
* @param lang_to
*/
function url($lang_from, $lang_to) {
- static $url_map = array(
+ static $url_map = [
'en' => 'english',
'fr' => 'french',
'de' => 'german',
'it' => 'italian',
'es' => 'spanish',
'pt' => 'portugese',
- );
+ ];
$lang_from = strtolower($lang_from);
$lang_to = strtolower($lang_to);
-
+
if (!isset($url_map[$lang_from])) {
return '';
}
-
+
$url = 'http://jump.altavista.com/translate_' . $url_map[$lang_from] . '.go' .
'?http://babelfish.altavista.com/babelfish/tr?doit=done' .
'&amp;lp=' . $lang_from . '_' . $lang_to .
@@ -91,8 +91,8 @@ class Babelfish {
* @param lang_from Language to translate from
*/
function links($lang_from = 'en') {
- static $fishes = array(
- 'en' => array( # English
+ static $fishes = [
+ 'en' => [ # English
'de' => '&Uuml;bersetzen&nbsp;Sie&nbsp;diese&nbsp;Seite&nbsp;ins&nbsp;Deutsche',
'es' => 'Traduzca&nbsp;esta&nbsp;paginaci&oacute;n&nbsp;a&nbsp;espa&ntilde;ol',
'fr' => 'Traduisez&nbsp;cette&nbsp;page&nbsp;en&nbsp;fran&ccedil;ais',
@@ -101,28 +101,28 @@ class Babelfish {
'zh' => '&#x7ffb;&#x8bd1;&#x8fd9;&#x9875;&#x6210;&#x6c49;&#x8bed;&nbsp;(CN)',
'ja' => '&#x65e5;&#x672c;&#x8a9e;&#x306b;&#x3053;&#x306e;&#x30da;&#x30fc;&#x30b8;&#x3092;&#x7ffb;&#x8a33;&#x3057;&#x306a;&#x3055;&#x3044;&nbsp;(Nihongo)',
'ko' => '&#xd55c;&#xad6d;&#xc778;&#xc73c;&#xb85c;&nbsp;&#xc774;&nbsp;&#xd398;&#xc774;&#xc9c0;&#xb97c;&nbsp;&#xbc88;&#xc5ed;&#xd558;&#xc2ed;&#xc2dc;&#xc694;&nbsp;(Hangul)',
- ),
- 'fr' => array( # French
+ ],
+ 'fr' => [ # French
'de' => '&Uuml;bersetzen&nbsp;Sie&nbsp;diese&nbsp;Seite&nbsp;in&nbsp;Deutschen',
'en' => 'Translate&nbsp;this&nbsp;page&nbsp;into&nbsp;English',
- ),
- 'de' => array( # German
+ ],
+ 'de' => [ # German
'en' => 'Translate&nbsp;this&nbsp;page&nbsp;into&nbsp;English',
'fr' => 'Traduisez&nbsp;cette&nbsp;page&nbsp;en&nbsp;fran&ccedil;ais',
- ),
- 'it' => array( # Italian
+ ],
+ 'it' => [ # Italian
'en' => 'Translate&nbsp;this&nbsp;page&nbsp;into&nbsp;English',
- ),
- 'es' => array( # Spanish
+ ],
+ 'es' => [ # Spanish
'en' => 'Translate&nbsp;this&nbsp;page&nbsp;into&nbsp;English',
- ),
- 'pt' => array( # Portugese
+ ],
+ 'pt' => [ # Portugese
'en' => 'Translate&nbsp;this&nbsp;page&nbsp;into&nbsp;English',
- ),
- 'ru' => array( # Russian
+ ],
+ 'ru' => [ # Russian
'en' => 'Translate&nbsp;this&nbsp;page&nbsp;into&nbsp;English',
- ),
- );
+ ],
+ ];
// \todo Use phpsniff or PEAR's Net_UserAgent_Detect to detect the browser type
// as Netscape 4.x and possibly others displays '&#xabcd;' literally
@@ -139,9 +139,9 @@ class Babelfish {
$a = [];
foreach ($fishes[$lang_from] as $lang_to => $msg) {
- $a[] = array('target' => $lang_to,
- 'href' => Babelfish::url($lang_from, $lang_to),
- 'msg' => $msg);
+ $a[] = ['target' => $lang_to,
+ 'href' => Babelfish::url($lang_from, $lang_to),
+ 'msg' => $msg, ];
}
return $a;
diff --git a/includes/classes/Bablotron.php b/includes/classes/Bablotron.php
index ca33be6..83c4be0 100755
--- a/includes/classes/Bablotron.php
+++ b/includes/classes/Bablotron.php
@@ -29,144 +29,144 @@
*/
class Bablotron extends BitBase
{
- /**
- * @todo Variable is scoped here but not really used in this scope below.
- */
- public $words;
- /**
- * Used to store the current language.
- *
- * @todo Not sure where this gets set from. Is used in other libraries.
- */
- public $lan;
- /**
- * @todo Empty variable - does nothing
- */
- public $db;
- /**
- * Spellchecking and finding of alternative words
- */
- function __construct( $lan )
- {
- parent::__construct();
- $this->lan = $lan;
- }
- /**
- * @todo Empty function - does nothing
- */
- function sql_error($query, $result)
- {
- return;
- }
- /**
- * Spellchecks a line of text
- * @param text line of text
- * @param threshold the similarity threshold
- * @returns array a list of alternative words if spelt incorrectly
- */
- function spellcheck_text($text, $threshold = 5)
- {
- $words = preg_split("/\s/", $text);
- $results = [];
- foreach ($words as $word)
- {
- if (!$this->word_exists($word))
- {
- $results[$word] = $this->find_similar_words($word, $threshold);
- }
- }
- return $results;
- }
- /**
- * Spellchecks a word
- * @param word the word
- * @param threshold the similarity threshold
- * @returns array a list of alternative words if spelt incorrectly
- */
- function spellcheck_word($word, $threshold = 5)
- {
- $results = [];
- if (!$this->word_exists($word))
- {
- $results[$word] = $this->find_similar_words($word, $threshold);
- }
- return $results;
- }
- /**
- * Spellchecks a line of text
- * @param text line of text
- * @param threshold Not used @todo param threshold Not used
- * @return array a list of incorrectly spelt words or words not found in the database
- */
- function quick_spellcheck_text($text, $threshold = 5)
- {
- $words = preg_split("/\s/", $text);
- $results = [];
- foreach ($words as $word)
- {
- if (!$this->word_exists($word))
- {
- $results[] = $word;
- }
- }
- return $results;
- }
- /**
- * Lists similar words by relevance threshold.
- * @param word the word
- * @param threshold the similarity threshold
- * @return array of similar words and Levenshtein distance
- */
- function find_similar_words($word, $threshold)
- {
- $similar = [];
- $tbl = 'babl_words_' . $this->lan;
- $word = addslashes( ( trim( $word ) ) );
- $sndx = substr($word, 0, 2);
- $query = "select `word` AS word from `$tbl` where `di`=?";
- @$result = $this->mDb->query($query, array($sndx));
- while ($res = $result->fetchRow() )
- {
- $tword = $res["word"];
- $lev = levenshtein($tword, $word);
- if (count($similar) < $threshold)
- {
- $similar[$tword] = $lev;
- asort ($similar);
- }
- else
- {
- // If the array is full then if the lev is better than the worst lev
- // then update $keys = array_keys($similar);
- $last_key = $keys[count($keys) - 1];
- if ($lev < $similar[$last_key])
- {
- unset ($similar[$last_key]);
- $similar[$tword] = $lev;
- asort ($similar);
- }
- }
- }
- return $similar;
- }
- /**
- * Checks if a word exists
- * @param word the word
- * @return int number of matches
- */
- function word_exists($word)
- {
- $tbl = 'babl_words_' . $this->lan;
- $word = addslashes( ( trim( $word ) ) );
- $query = "select `word` AS word from `$tbl` where `word`=?";
- $result = $this->mDb->query($query,array($word));
- return $result->numRows();
- }
- /**
- * @todo Empty function - does nothing
- */
- function find_similar($word, $threshold)
- {
- }
+ /**
+ * @todo Variable is scoped here but not really used in this scope below.
+ */
+ public $words;
+ /**
+ * Used to store the current language.
+ *
+ * @todo Not sure where this gets set from. Is used in other libraries.
+ */
+ public $lan;
+ /**
+ * @todo Empty variable - does nothing
+ */
+ public $db;
+ /**
+ * Spellchecking and finding of alternative words
+ */
+ function __construct( $lan )
+ {
+ parent::__construct();
+ $this->lan = $lan;
+ }
+ /**
+ * @todo Empty function - does nothing
+ */
+ function sql_error($query, $result)
+ {
+
+ }
+ /**
+ * Spellchecks a line of text
+ * @param text line of text
+ * @param threshold the similarity threshold
+ * @returns array a list of alternative words if spelt incorrectly
+ */
+ function spellcheck_text($text, $threshold = 5)
+ {
+ $words = preg_split("/\s/", $text);
+ $results = [];
+ foreach ($words as $word)
+ {
+ if (!$this->word_exists($word))
+ {
+ $results[$word] = $this->find_similar_words($word, $threshold);
+ }
+ }
+ return $results;
+ }
+ /**
+ * Spellchecks a word
+ * @param word the word
+ * @param threshold the similarity threshold
+ * @returns array a list of alternative words if spelt incorrectly
+ */
+ function spellcheck_word($word, $threshold = 5)
+ {
+ $results = [];
+ if (!$this->word_exists($word))
+ {
+ $results[$word] = $this->find_similar_words($word, $threshold);
+ }
+ return $results;
+ }
+ /**
+ * Spellchecks a line of text
+ * @param text line of text
+ * @param threshold Not used @todo param threshold Not used
+ * @return array a list of incorrectly spelt words or words not found in the database
+ */
+ function quick_spellcheck_text($text, $threshold = 5)
+ {
+ $words = preg_split("/\s/", $text);
+ $results = [];
+ foreach ($words as $word)
+ {
+ if (!$this->word_exists($word))
+ {
+ $results[] = $word;
+ }
+ }
+ return $results;
+ }
+ /**
+ * Lists similar words by relevance threshold.
+ * @param word the word
+ * @param threshold the similarity threshold
+ * @return array of similar words and Levenshtein distance
+ */
+ function find_similar_words($word, $threshold)
+ {
+ $similar = [];
+ $tbl = 'babl_words_' . $this->lan;
+ $word = addslashes( ( trim( $word ) ) );
+ $sndx = substr($word, 0, 2);
+ $query = "select `word` AS word from `$tbl` where `di`=?";
+ @$result = $this->mDb->query($query, [$sndx]);
+ while ($res = $result->fetchRow() )
+ {
+ $tword = $res["word"];
+ $lev = levenshtein($tword, $word);
+ if (count($similar) < $threshold)
+ {
+ $similar[$tword] = $lev;
+ asort ($similar);
+ }
+ else
+ {
+ // If the array is full then if the lev is better than the worst lev
+ // then update $keys = array_keys($similar);
+ $last_key = $keys[count($keys) - 1];
+ if ($lev < $similar[$last_key])
+ {
+ unset ($similar[$last_key]);
+ $similar[$tword] = $lev;
+ asort ($similar);
+ }
+ }
+ }
+ return $similar;
+ }
+ /**
+ * Checks if a word exists
+ * @param word the word
+ * @return int number of matches
+ */
+ function word_exists($word)
+ {
+ $tbl = 'babl_words_' . $this->lan;
+ $word = addslashes( ( trim( $word ) ) );
+ $query = "select `word` AS word from `$tbl` where `word`=?";
+ $result = $this->mDb->query($query,[$word]);
+ return $result->numRows();
+ }
+ /**
+ * @todo Empty function - does nothing
+ */
+ function find_similar($word, $threshold)
+ {
+ }
}
?>
diff --git a/includes/classes/BitLanguage.php b/includes/classes/BitLanguage.php
index 616cf66..0a31ae3 100755
--- a/includes/classes/BitLanguage.php
+++ b/includes/classes/BitLanguage.php
@@ -15,6 +15,7 @@
*/
namespace Bitweaver\Languages;
+
use Bitweaver\BitSingleton;
use Bitweaver\KernelTools;
@@ -83,7 +84,7 @@ class BitLanguage extends BitSingleton {
}
public function __sleep() {
- return array_merge( parent::__sleep(), array( 'mLanguageList' ) );
+ return array_merge( parent::__sleep(), [ 'mLanguageList' ] );
}
/**
@@ -145,10 +146,10 @@ class BitLanguage extends BitSingleton {
if( $this->verifyLanguage( $pParamHash ) ) {
if( empty( $pParamHash['update_lang_code'] ) ) {
$query = "INSERT INTO `".BIT_DB_PREFIX."i18n_languages` (`lang_code`,`english_name`,`native_name`,`is_disabled`) values (?,?,?,?)";
- $result = $this->mDb->query( $query, array( $pParamHash['lang_code'], $pParamHash['english_name'], $pParamHash['native_name'], $pParamHash['is_disabled'] ) );
+ $result = $this->mDb->query( $query, [ $pParamHash['lang_code'], $pParamHash['english_name'], $pParamHash['native_name'], $pParamHash['is_disabled'] ] );
} else {
$query = "UPDATE `".BIT_DB_PREFIX."i18n_languages` SET `lang_code`=?, `english_name`=?, `native_name`=?, `is_disabled`=? WHERE `lang_code`=?";
- $result = $this->mDb->query( $query, array( $pParamHash['lang_code'], $pParamHash['english_name'], $pParamHash['native_name'], $pParamHash['is_disabled'], $pParamHash['update_lang_code'] ) );
+ $result = $this->mDb->query( $query, [ $pParamHash['lang_code'], $pParamHash['english_name'], $pParamHash['native_name'], $pParamHash['is_disabled'], $pParamHash['update_lang_code'] ] );
}
}
return count( $this->mErrors ) == 0;
@@ -165,9 +166,9 @@ class BitLanguage extends BitSingleton {
if( !empty( $pLangCode ) ) {
$this->StartTrans();
$query = "DELETE FROM `".BIT_DB_PREFIX."i18n_strings` WHERE `lang_code`=?";
- $result = $this->mDb->query( $query, array( $pLangCode ) );
+ $result = $this->mDb->query( $query, [ $pLangCode ] );
$query = "DELETE FROM `".BIT_DB_PREFIX."i18n_languages` WHERE `lang_code`=?";
- $result = $this->mDb->query( $query, array( $pLangCode ) );
+ $result = $this->mDb->query( $query, [ $pLangCode ] );
$this->CompleteTrans();
}
}
@@ -182,9 +183,9 @@ class BitLanguage extends BitSingleton {
if( !empty( $pSourceHash ) ) {
$this->StartTrans();
$query = "DELETE FROM `".BIT_DB_PREFIX."i18n_strings` WHERE `source_hash`=?";
- $result = $this->mDb->query( $query, array( $pSourceHash ) );
+ $result = $this->mDb->query( $query, [ $pSourceHash ] );
$query = "DELETE FROM `".BIT_DB_PREFIX."i18n_masters` WHERE `source_hash`=?";
- $result = $this->mDb->query( $query, array( $pSourceHash ) );
+ $result = $this->mDb->query( $query, [ $pSourceHash ] );
$this->CompleteTrans();
}
}
@@ -236,7 +237,6 @@ class BitLanguage extends BitSingleton {
return $langs;
}
-
/**
* verifyMastersLoaded verify that master strings are loaded
*
@@ -272,7 +272,7 @@ class BitLanguage extends BitSingleton {
SELECT im.`source_hash` AS `hash_key`, `source`, `package`, im.`source_hash`
FROM `".BIT_DB_PREFIX."i18n_masters` im
WHERE UPPER( `source` ) LIKE ? ORDER BY im.`source`";
- return $this->mDb->getAssoc( $query, array( '%'.strtoupper( $pQuerySource ).'%' ) );
+ return $this->mDb->getAssoc( $query, [ '%'.strtoupper( $pQuerySource ).'%' ] );
}
/**
@@ -332,26 +332,26 @@ class BitLanguage extends BitSingleton {
$this->StartTrans();
$newSourceHash = $this->getSourceHash( $pParamHash['new_source'] );
if( $this->masterStringExists( $newSourceHash ) ) {
- $oldCount = $this->mDb->getOne( "SELECT COUNT(`source_hash`) FROM `".BIT_DB_PREFIX."i18n_strings` WHERE `source_hash`=?", array( $pParamHash['source_hash'] ) );
- $newCount = $this->mDb->getOne( "SELECT COUNT(`source_hash`) FROM `".BIT_DB_PREFIX."i18n_strings` WHERE `source_hash`=?", array( $newSourceHash ) );
+ $oldCount = $this->mDb->getOne( "SELECT COUNT(`source_hash`) FROM `".BIT_DB_PREFIX."i18n_strings` WHERE `source_hash`=?", [ $pParamHash['source_hash'] ] );
+ $newCount = $this->mDb->getOne( "SELECT COUNT(`source_hash`) FROM `".BIT_DB_PREFIX."i18n_strings` WHERE `source_hash`=?", [ $newSourceHash ] );
if( $newCount ) {
$this->mErrors['master'] = 'There was a conflict updating the master string. The new string already has translations entered.';
} else {
// we have updated a master string to an existing master string
$query = "UPDATE `".BIT_DB_PREFIX."i18n_strings` SET `source_hash`=?, `last_modified`=? WHERE `source_hash`=?";
- $trans = $this->mDb->query($query, array( $newSourceHash, time(), $pParamHash['source_hash'] ) );
+ $trans = $this->mDb->query($query, [ $newSourceHash, time(), $pParamHash['source_hash'] ] );
$query = "DELETE FROM `".BIT_DB_PREFIX."i18n_masters` WHERE `source_hash`=?";
- $trans = $this->mDb->query($query, array( $pParamHash['source_hash'] ) );
+ $trans = $this->mDb->query($query, [ $pParamHash['source_hash'] ] );
}
} elseif( $this->masterStringExists( $pParamHash['source_hash'] ) ) {
$query = "UPDATE `".BIT_DB_PREFIX."i18n_strings` SET `source_hash`=?, `last_modified`=? WHERE `source_hash`=?";
- $trans = $this->mDb->query($query, array( $newSourceHash, time(), $pParamHash['source_hash'] ) );
+ $trans = $this->mDb->query($query, [ $newSourceHash, time(), $pParamHash['source_hash'] ] );
$query = "UPDATE `".BIT_DB_PREFIX."i18n_masters` SET `source_hash`=?, `source`=?, `created`=? WHERE `source_hash`=?";
- $trans = $this->mDb->query($query, array( $newSourceHash, $pParamHash['new_source'], time(), $pParamHash['source_hash'] ) );
+ $trans = $this->mDb->query($query, [ $newSourceHash, $pParamHash['new_source'], time(), $pParamHash['source_hash'] ] );
unset( $this->mStrings[$pParamHash['source_hash']] );
} else {
$query = "INSERT INTO `".BIT_DB_PREFIX."i18n_masters` (`source`,`source_hash`, `created`, `package`) VALUES (?,?,?,?)";
- $trans = $this->mDb->query($query, array( $pParamHash['new_source'], $newSourceHash, time(), $package ) );
+ $trans = $this->mDb->query($query, [ $pParamHash['new_source'], $newSourceHash, time(), $package ] );
}
if( count( $this->mErrors ) == 0 ) {
$this->mStrings['master'][$newSourceHash]['source'] = $pParamHash['new_source'];
@@ -361,7 +361,6 @@ class BitLanguage extends BitSingleton {
return count( $this->mErrors ) == 0;
}
-
/**
* importMasterStrings
*
@@ -376,15 +375,15 @@ class BitLanguage extends BitSingleton {
foreach( $lang as $key=>$val ) {
$sourceHash = $this->getSourceHash( $key );
$query = "SELECT * FROM `".BIT_DB_PREFIX."i18n_masters` WHERE `source_hash`=?";
- $trans = $this->mDb->getAssoc($query, array( $sourceHash ) );
+ $trans = $this->mDb->getAssoc($query, [ $sourceHash ] );
if( $trans ) {
if( $pOverwrite ) {
$query = "UPDATE `".BIT_DB_PREFIX."i18n_masters` SET `source`=?, `created`=? WHERE `source_hash`=?";
- $trans = $this->mDb->query($query, array( $val, time(), $sourceHash ) );
+ $trans = $this->mDb->query($query, [ $val, time(), $sourceHash ] );
$count++;
}
} else {
- $this->storeMasterString( array( 'new_source' => $val, 'source_hash' => $sourceHash ) );
+ $this->storeMasterString( [ 'new_source' => $val, 'source_hash' => $sourceHash ] );
$count++;
}
}
@@ -401,13 +400,13 @@ class BitLanguage extends BitSingleton {
*/
public function storeTranslationString( $pLangCode, $pString, $pSourceHash ) {
$query = "DELETE FROM `".BIT_DB_PREFIX."i18n_strings` WHERE `source_hash`=? AND `lang_code`=?";
- $result = $this->mDb->query( $query, array( $pSourceHash, $pLangCode ) );
+ $result = $this->mDb->query( $query, [ $pSourceHash, $pLangCode ] );
// we don't need things where '{$menu.menu_title}' is the full string in the database
// if you change this regexp, please modify the one in kernel/smarty_bit/prefilter.tr.php as well (approx line 76)
if( !empty( $pString ) && !preg_match( '!^(\{\$[^\}]*\})+$!', $pString ) ) {
$query = "INSERT INTO `".BIT_DB_PREFIX."i18n_strings` (`lang_code`,`trans`,`source_hash`, `last_modified`) values (?,?,?,?)";
- $result = $this->mDb->query( $query, array( $pLangCode, $pString, $pSourceHash, time() ) );
+ $result = $this->mDb->query( $query, [ $pLangCode, $pString, $pSourceHash, time() ] );
}
// pretty brutal on mass-saving, but cache always needs purging after translation saved.
$this->clearCache();
@@ -426,7 +425,7 @@ class BitLanguage extends BitSingleton {
FROM `".BIT_DB_PREFIX."i18n_strings` ist
WHERE ist.`source_hash`=?
ORDER BY ist.`lang_code`";
- return $this->mDb->getAssoc( $query, array( $pSourceHash ) );
+ return $this->mDb->getAssoc( $query, [ $pSourceHash ] );
}
/**
@@ -504,13 +503,13 @@ class BitLanguage extends BitSingleton {
foreach( $lang as $key=>$val ) {
$hashKey = $this->getSourceHash( $key );
if( !$this->masterStringExists( $hashKey ) ) {
- $this->storeMasterString( array( 'source_hash' => $hashKey, 'new_source' => $key ) );
+ $this->storeMasterString( [ 'source_hash' => $hashKey, 'new_source' => $key ] );
}
$trans = $this->lookupTranslation( $key, $pLangCode, false );
if( !is_null( $trans ) ) {
if( $pOverwrite ) {
$query = "UPDATE `".BIT_DB_PREFIX."i18n_strings` SET `trans`=?, `last_modified`=? WHERE `source_hash`=? AND `lang_code`=?";
- $trans = $this->mDb->query($query, array( $val, time(), $hashKey, $pLangCode ) );
+ $trans = $this->mDb->query($query, [ $val, time(), $hashKey, $pLangCode ] );
$count++;
} elseif( !empty( $val ) && strtolower( $trans ) != strtolower( $val ) ) {
$this->mImportConflicts[$pLangCode][$hashKey]['import'] = $val;
@@ -521,7 +520,7 @@ class BitLanguage extends BitSingleton {
}
} elseif( !empty( $val ) && (strtolower( $key ) != strtolower( $val )) ) {
$query = "INSERT INTO `".BIT_DB_PREFIX."i18n_strings` (`trans`,`source_hash`,`lang_code`,`last_modified`) VALUES (?,?,?,?)";
- $trans = $this->mDb->query($query, array( $val, $hashKey, $pLangCode, time() ) );
+ $trans = $this->mDb->query($query, [ $val, $hashKey, $pLangCode, time() ] );
$count++;
}
}
@@ -540,7 +539,7 @@ class BitLanguage extends BitSingleton {
if ( $pLangCode ) {
// see if there is anything in the table
$query = "SELECT COUNT(`source_hash`) FROM `".BIT_DB_PREFIX."i18n_strings` ist WHERE ist.`lang_code`=?";
- $count = $this->mDb->getOne($query, array( $pLangCode ) );
+ $count = $this->mDb->getOne($query, [ $pLangCode ] );
if( empty( $count ) ) {
$this->importTranslationStrings( $pLangCode );
}
@@ -562,7 +561,7 @@ class BitLanguage extends BitSingleton {
LEFT OUTER JOIN `".BIT_DB_PREFIX."i18n_strings` ist ON( ist.`source_hash`=im.`source_hash` AND ist.`lang_code`=? )
LEFT OUTER JOIN `".BIT_DB_PREFIX."i18n_version_map` ivm ON( im.`source_hash`=ivm.`source_hash` )
ORDER BY im.`source`";
- $this->mStrings[$pLangCode] = $this->mDb->getAssoc( $query, array( $pLangCode ) );
+ $this->mStrings[$pLangCode] = $this->mDb->getAssoc( $query, [ $pLangCode ] );
}
/**
@@ -641,22 +640,22 @@ class BitLanguage extends BitSingleton {
LEFT OUTER JOIN `".BIT_DB_PREFIX."i18n_version_map` ivm ON( ivm.`source_hash`=im.`source_hash` AND ivm.`version`=? )
LEFT OUTER JOIN `".BIT_DB_PREFIX."i18n_strings` ist ON( im.`source_hash`=ist.`source_hash` AND `lang_code`=? )
WHERE im.`source_hash`=?";
- $ret = $this->mDb->getRow($query, array( BIT_MAJOR_VERSION, $pLangCode, $sourceHash ) );
+ $ret = $this->mDb->getRow($query, [ BIT_MAJOR_VERSION, $pLangCode, $sourceHash ] );
if( $pOverrideUsage && $gBitSystem->isFeatureActive( 'i18n_record_untranslated' ) ) {
$query = "SELECT `source_hash` FROM `".BIT_DB_PREFIX."i18n_masters` WHERE `source_hash`=?";
- $source = $this->mDb->getOne($query, array( $sourceHash ) );
+ $source = $this->mDb->getOne($query, [ $sourceHash ] );
if( empty( $source ) ) {
- $this->storeMasterString( array( 'source_hash' => $sourceHash, 'new_source' => $pString ) );
+ $this->storeMasterString( [ 'source_hash' => $sourceHash, 'new_source' => $pString ] );
}
}
if( $pOverrideUsage && $gBitSystem->isFeatureActive( 'i18n_track_translation_usage' ) ) {
if( empty( $ret['usage_source_hash'] ) ) {
$query = "INSERT INTO `".BIT_DB_PREFIX."i18n_version_map` (`source_hash`,`version`) VALUES (?,?)";
- $trans = $this->mDb->query($query, array( $sourceHash, BIT_MAJOR_VERSION ) );
+ $trans = $this->mDb->query($query, [ $sourceHash, BIT_MAJOR_VERSION ] );
}
}
}
- return isset( $ret['trans'] ) ? $ret['trans'] : null;
+ return $ret['trans'] ?? null;
}
/**
@@ -667,7 +666,7 @@ class BitLanguage extends BitSingleton {
* @return string master string with given source hash
*/
public function getMasterString( $pSourceHash ) {
- return $this->mDb->getOne( "SELECT `source` FROM `" . BIT_DB_PREFIX . "i18n_masters` WHERE `source_hash` = ? ", array( $pSourceHash ) );
+ return $this->mDb->getOne( "SELECT `source` FROM `" . BIT_DB_PREFIX . "i18n_masters` WHERE `source_hash` = ? ", [ $pSourceHash ] );
}
/**
diff --git a/includes/classes/LibertyTranslations.php b/includes/classes/LibertyTranslations.php
index 0527b9b..ad69b03 100755
--- a/includes/classes/LibertyTranslations.php
+++ b/includes/classes/LibertyTranslations.php
@@ -7,6 +7,7 @@
*/
namespace Bitweaver\Languages;
+
use Bitweaver\BitBase;
use Bitweaver\Liberty\LibertyBase;
@@ -23,13 +24,13 @@ use Bitweaver\Liberty\LibertyBase;
global $gBitSystem, $gBitLanguage;
$ret = [];
if( BitBase::verifyId( $this->mContentId ) ) {
- $translationId = $this->mDb->getOne( "SELECT `translation_id` FROM `".BIT_DB_PREFIX."i18n_content_trans_map` WHERE `content_id`=?", array( $this->mContentId ) );
+ $translationId = $this->mDb->getOne( "SELECT `translation_id` FROM `".BIT_DB_PREFIX."i18n_content_trans_map` WHERE `content_id`=?", [ $this->mContentId ] );
if( BitBase::verifyId( $translationId ) ) {
$query = "SELECT lc.`content_id`, lc.`title`, lc.`lang_code`, ictm.`translation_id`
FROM `".BIT_DB_PREFIX."i18n_content_trans_map` ictm
INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON( lc.`content_id`=ictm.`content_id` )
WHERE ictm.`translation_id`=?";
- $result = $this->mDb->query( $query, array( $translationId ) );
+ $result = $this->mDb->query( $query, [ $translationId ] );
while( $aux = $result->fetchRow() ) {
// default to site language
if( empty( $aux['lang_code'] )) {
@@ -60,7 +61,7 @@ use Bitweaver\Liberty\LibertyBase;
// make sure we don't have a translation_id for this content yet
if( BitBase::verifyId( $pParamHash['from_id'] ?? 0 ) ) {
- $pParamHash['translation_id'] = $this->mDb->getOne( "SELECT `translation_id` FROM `".BIT_DB_PREFIX."i18n_content_trans_map` WHERE `content_id`=?", array( $pParamHash['from_id'] ) );
+ $pParamHash['translation_id'] = $this->mDb->getOne( "SELECT `translation_id` FROM `".BIT_DB_PREFIX."i18n_content_trans_map` WHERE `content_id`=?", [ $pParamHash['from_id'] ] );
}
// if we have this page in this translation, we should inform the user somehow.
@@ -157,7 +158,7 @@ die;
function translation_content_store( $pObject, $pParamHash ) {
// if we are creating this content and we have a from_id, we know that we're translating a page
// mInfo['content_id'] isn't set when content is created
- if( empty( $pObject->mInfo['content_id'] ) && BitBase::verifyId( $_REQUEST['i18n']['from_id'] ?? 0 ) ) {
+ if( empty( $pObject->mInfo['content_id'] ) && BitBase::verifyId( $_REQUEST['i18n']['from_id'] ?? 0 ) ) {
$trans = new LibertyTranslations();
$storeHash = $_REQUEST['i18n'];
$storeHash['content_id'] = $pParamHash['content_id'];
diff --git a/index.php b/index.php
index 3e305fe..c0437d0 100644
--- a/index.php
+++ b/index.php
@@ -1,4 +1,4 @@
-<?php
+<?php
// This is not a package.
header ("location: ../index.php");
diff --git a/lang/ar/language.php b/lang/ar/language.php
index 4b6d441..734b8f3 100644
--- a/lang/ar/language.php
+++ b/lang/ar/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Arabic translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:07
-$lang=Array(
+$lang=[
'activity' => 'نشاط',
'Activity name already exists' => 'اسم الفعالية موجود سلفاً',
'Add' => 'اضف',
@@ -495,5 +495,5 @@ $lang=Array(
'Your admin password has been changed' => 'كلمة السر الاشرافية تم تعديلها',
'Your email was sent' => 'قد ارسلت رسالتك',
'You will receive an email with information to login for the first time into this site' => 'سوف تصلك رسالة على البريد الالكتروني تحوي معلومات لدخولك لأول مرة على هذا الموقع ',
-);
+];
?> \ No newline at end of file
diff --git a/lang/ca/language.php b/lang/ca/language.php
index 08c0457..34c9012 100644
--- a/lang/ca/language.php
+++ b/lang/ca/language.php
@@ -36,10 +36,9 @@
// Usefull mode when preparing a translation for distribution.
// http://www.neonchart.com/get_strings.php?nohelp&nosections
-// Prepare all languages for release
+// Prepare all languages for release
-
-$lang=Array(
+$lang=[
// ### Start of unused words
// ### Please remove manually!
// ### N.B. Legitimate strings may be marked// ### as unused!
@@ -4095,5 +4094,5 @@ $lang=Array(
"Traditional Chinese" => "Xinés traditional",
"Ukrainian" => "Ukranià",
"Chinese" => "Xinès",
-"###end###"=>"###end###");
+"###end###"=>"###end###", ];
?>
diff --git a/lang/cn/language.php b/lang/cn/language.php
index 40ccbbf..e38a269 100644
--- a/lang/cn/language.php
+++ b/lang/cn/language.php
@@ -20,7 +20,7 @@
* http://www.osall.com/tiki *
*******************************************************
*/
-$lang=Array(
+$lang=[
"User_versions_for" => "User_versions_for",
"Version" => "版本",
"Date" => "日期",
@@ -3003,5 +3003,5 @@ Set optional paramater -+ln+- to 1 if you need line numbering feature.",//perhap
"There is an error in the plugin data" => "There is an error in the plugin data",
"Change your email" => "Change your email",
"Edit this assigned module:" => "Edit this assigned module:",
-"##end###" => "###end###");
+"##end###" => "###end###", ];
?>
diff --git a/lang/cs/language.php b/lang/cs/language.php
index 07e063f..0214bcb 100644
--- a/lang/cs/language.php
+++ b/lang/cs/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Czech translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:07
-$lang=Array(
+$lang=[
'1 -Lowest-' => '1 - nejnižší',
'2 -Low-' => '2 - nízká',
'3 -Normal-' => '3 - normální',
@@ -4105,5 +4105,5 @@ Po vybrání souboru se prosím vraťte na záložku "Tělo článku" a zvolte "
'Zoom out x2' => 'Zmenšit x2',
'Zoom out x3' => 'Zmenšit x3',
'Zoom out x4' => 'Zmenšit x4',
-);
+];
?> \ No newline at end of file
diff --git a/lang/da/language.php b/lang/da/language.php
index 2f97533..814b915 100644
--- a/lang/da/language.php
+++ b/lang/da/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Danish translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:07
-$lang=Array(
+$lang=[
'+1d' => '+1d',
'+1m' => '+1m',
'+7d' => '+7d',
@@ -2716,5 +2716,5 @@ $lang=Array(
'You will receive an email with your password soon' => 'Du vil snart modtage en email med dine adgangskoder',
'You will remove' => 'Du vil fjerne',
'zone' => 'Zone',
-);
+];
?> \ No newline at end of file
diff --git a/lang/de/language.php b/lang/de/language.php
index b4428d6..e6393c5 100755
--- a/lang/de/language.php
+++ b/lang/de/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the German translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:07
-$lang=Array(
+$lang=[
'-1d' => '-1Tag',
'+1d' => '+1Tag',
'-1m' => '-1Monat',
@@ -5743,4 +5743,4 @@ der Kartendatei:',
'Zimbabwe' => 'Simbabwe',
'zip' => 'PLZ',
'zone' => 'Bereich',
-);
+];
diff --git a/lang/el/language.php b/lang/el/language.php
index b3e8bca..66436cd 100644
--- a/lang/el/language.php
+++ b/lang/el/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Greek translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:07
-$lang=Array(
+$lang=[
'aborted' => 'ακυρώθηκε',
'action' => 'ενέργεια',
'Actions' => 'Ενέργειες',
@@ -462,5 +462,5 @@ $lang=Array(
'You have' => 'Έχεις',
'Your personal Wiki Page' => 'Η προσωπική σου σελίδα Wiki',
'zone' => 'ζώνη',
-);
+];
?> \ No newline at end of file
diff --git a/lang/en-uk/language.php b/lang/en-uk/language.php
index 28bd353..d19087a 100644
--- a/lang/en-uk/language.php
+++ b/lang/en-uk/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:07
-$lang=Array(
+$lang=[
'background color of the node
' => 'background colour of the node
',
@@ -16,5 +16,5 @@ $lang=Array(
' => 'the background colour, use #rrvvbb colour types.
',
'Will display using the indicated HTML color' => 'Will display using the indicated HTML colour',
-);
+];
?> \ No newline at end of file
diff --git a/lang/es/language.php b/lang/es/language.php
index 7d08ef5..d793ba7 100644
--- a/lang/es/language.php
+++ b/lang/es/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Spanish translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:07
-$lang=Array(
+$lang=[
'-1d' => '-1d',
'+1d' => '+1d',
'-1m' => '-1m',
@@ -3426,5 +3426,5 @@ el archivo de mapa:',
'You will receive an email with your password soon' => 'Recibira un email con su clave pronto',
'You will remove' => 'Usted borrará',
'zone' => 'sección',
-);
+];
?> \ No newline at end of file
diff --git a/lang/fi/language.php b/lang/fi/language.php
index c5cc755..36e1dc0 100755
--- a/lang/fi/language.php
+++ b/lang/fi/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Finnish translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:07
-$lang=Array(
+$lang=[
'1 -Lowest-' => '1 -Alin- ',
'2 -Low-' => '2 -Alhainen- ',
'3 -Normal-' => '3 -Normaali- ',
@@ -3317,4 +3317,4 @@ $lang=Array(
'Zimbabwe' => 'Simbabwe ',
'zip' => 'zip ',
'zone' => 'Alue',
-);
+];
diff --git a/lang/fr/language.php b/lang/fr/language.php
index c324a24..bb22275 100755
--- a/lang/fr/language.php
+++ b/lang/fr/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the French translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '-1j',
'+1d' => '+1j',
'-1m' => '-1m',
@@ -4526,4 +4526,4 @@ fichier-carte :',
'Zimbabwe' => 'Zimbabwe',
'zip' => 'code postal',
'zone' => 'zone',
-);
+];
diff --git a/lang/he/language.php b/lang/he/language.php
index 80345bb..0aca2dc 100644
--- a/lang/he/language.php
+++ b/lang/he/language.php
@@ -1,5 +1,5 @@
<?php // -*- coding:utf-8 -*-
-$lang=Array(
+$lang=[
"User_versions_for" => "גרס�ות משתמש עבור",
"Version" => "גרסה",
"Date" => "ת�ריך",
@@ -2961,5 +2961,5 @@ Set optional paramater -+ln+- to 1 if you need line numbering feature.",//perhap
"There is an error in the plugin data" => "There is an error in the plugin data",
"Change your email" => "Change your email",
"Edit this assigned module:" => "Edit this assigned module:",
-"##end###" => "###end###");
+"##end###" => "###end###", ];
?>
diff --git a/lang/hr/language.php b/lang/hr/language.php
index c4d85af..6d1ad3a 100644
--- a/lang/hr/language.php
+++ b/lang/hr/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Croatian translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'+1d' => '+1d',
'+1m' => '+1m',
'+7d' => '+7d',
@@ -2612,5 +2612,5 @@ $lang=Array(
'You will receive an email with information to login for the first time into this site' => 'Primit ćete e-mail sa informacijama za prijavu po prvi put na ovaj site',
'You will remove' => 'Obrisat ćete',
'zone' => 'Zone',
-);
+];
?> \ No newline at end of file
diff --git a/lang/hu/language.php b/lang/hu/language.php
index 231ecde..4ee12e7 100644
--- a/lang/hu/language.php
+++ b/lang/hu/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Hungarian translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'+1d' => '+1n',
'+1m' => '+1p',
'+7d' => '+7n',
@@ -1726,5 +1726,5 @@ $lang=Array(
'Your registration code:' => 'A regisztrációs kódja:',
'You will remove' => 'Most törölném a',
'zone' => 'Zóna',
-);
+];
?> \ No newline at end of file
diff --git a/lang/it/language.php b/lang/it/language.php
index 744d08a..b1cce72 100644
--- a/lang/it/language.php
+++ b/lang/it/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Italian translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'+1d' => '+1d',
'+1m' => '+1m',
'+7d' => '+7d',
@@ -2685,5 +2685,5 @@ Imposta il parametro opzionale (da -+ln+- a 1) se desideri che il codice sia vis
'You will receive an email with your password soon' => 'Tra poco riceverai una email con la password',
'You will remove' => 'Rimuozione di',
'zone' => 'zona',
-);
+];
?> \ No newline at end of file
diff --git a/lang/ja/language.php b/lang/ja/language.php
index fab8b12..cbe30d9 100644
--- a/lang/ja/language.php
+++ b/lang/ja/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Japanese translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '-1日間',
'+1d' => '+1日',
'-1m' => '-1ヶ月間',
@@ -1692,5 +1692,5 @@ image in your browser using',
'Your email address was removed from the list of subscriptors.' => 'Your
email address was removed from the list of subscriptors.',
'Your personal Wiki Page' => '自分のWikiページ',
-);
+];
?> \ No newline at end of file
diff --git a/lang/ko/language.php b/lang/ko/language.php
index ca3b6ba..3c86f13 100644
--- a/lang/ko/language.php
+++ b/lang/ko/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Korean translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '1일전',
'+1d' => '1일후',
'-1m' => '한달전',
@@ -826,5 +826,5 @@ $lang=Array(
'You have to create a gallery first!' => '파일을 업로드할 수 있는 자료실이 없습니다!',
'Your current avatar' => '현재 아바타',
'Your personal Wiki Page' => '개인 위키 페이지',
-);
+];
?> \ No newline at end of file
diff --git a/lang/masters.php b/lang/masters.php
index c00dcd9..e9fbdd2 100644
--- a/lang/masters.php
+++ b/lang/masters.php
@@ -25,10 +25,9 @@
// Usefull mode when preparing a translation for distribution.
// http://www.neonchart.com/get_strings.php?nohelp&nosections
-// Prepare all languages for release
+// Prepare all languages for release
-
-$lang=Array(
+$lang=[
// ### start of untranslated words
// ### uncomment value pairs as you translate
"Child categories" => "Child categories",
@@ -3380,6 +3379,6 @@ $lang=Array(
"Edit Templates" => "Edit templates",
"Referer Stats" => "Referer stats",
"Theme Control" => "Theme control",
- "###end###"=>"###end###"
-);
+ "###end###"=>"###end###",
+];
?>
diff --git a/lang/nl/language.php b/lang/nl/language.php
index 04ebf6f..560234a 100644
--- a/lang/nl/language.php
+++ b/lang/nl/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Dutch translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'+1d' => '+1d',
'1 -Lowest-' => '1 -Laagste-',
'+1m' => '+1m',
@@ -3020,5 +3020,5 @@ Avatar<strong> - Deze plugin is nog niet functioneel.</strong>',
'You will remove' => 'U zal verwijderen:',
'Yugoslavia' => 'Joegoslavië',
'zone' => 'zone',
-);
+];
?> \ No newline at end of file
diff --git a/lang/no/language.php b/lang/no/language.php
index 99e07db..9b39346 100644
--- a/lang/no/language.php
+++ b/lang/no/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Norwegian translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'+1d' => '+1d',
'1 -Lowest-' => '1 -Lavest-',
'+1m' => '+1m',
@@ -3246,5 +3246,5 @@ $lang=Array(
'Zambia' => 'Zambia',
'Zimbabwe' => 'Zimbabwe',
'zone' => 'zon',
-);
+];
?> \ No newline at end of file
diff --git a/lang/pl/language.php b/lang/pl/language.php
index 45e0019..f6d89d7 100644
--- a/lang/pl/language.php
+++ b/lang/pl/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Polish translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'+1d' => '+1d',
'+1m' => '+1m',
'+7d' => '+7d',
@@ -2558,5 +2558,5 @@ $lang=Array(
'You will receive an email with information to login for the first time into this site' => 'You will receive an email with information to login for the first time into this site',
'You will remove' => 'You will remove',
'zone' => 'zone',
-);
+];
?> \ No newline at end of file
diff --git a/lang/pt-br/language.php b/lang/pt-br/language.php
index 7c73b92..5dcd1f6 100644
--- a/lang/pt-br/language.php
+++ b/lang/pt-br/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Brazilian Portuguese translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '-1d',
'+1d' => '+1d',
'-1m' => '-1m',
@@ -3647,5 +3647,5 @@ o arquivo de mapa:',
'Yugoslavia' => 'Iugoslávia',
'Zambia' => 'Zambia',
'zone' => 'Zona',
-);
+];
?> \ No newline at end of file
diff --git a/lang/pt/language.php b/lang/pt/language.php
index 3f96659..2b92f29 100644
--- a/lang/pt/language.php
+++ b/lang/pt/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Portuguese translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '-1d',
'+1d' => '+1d',
'-1m' => '-1m',
@@ -3251,5 +3251,5 @@ o ficheiro de mapa:',
'You will receive an email with information to login for the first time into this site' => 'Você receberá um email com instruções sobre como logar-se pela primeira vez neste site',
'You will remove' => 'Irá remover',
'zone' => 'Zona',
-);
+];
?> \ No newline at end of file
diff --git a/lang/ro/language.php b/lang/ro/language.php
index 1bdc10f..a3b15ac 100755
--- a/lang/ro/language.php
+++ b/lang/ro/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Romanian translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'1 -Lowest-' => '1 -Cel mai scăzut-',
'2 -Low-' => '2 -Scăzut-',
'3 -Normal-' => '3 -Normal-',
@@ -1726,4 +1726,4 @@ $lang=Array(
'Yugoslavia' => 'Iugoslavia',
'Zambia' => 'Zambia',
'Zimbabwe' => 'Zimbabwe',
-);
+];
diff --git a/lang/ru/language.php b/lang/ru/language.php
index 4e34b56..119e5f5 100755
--- a/lang/ru/language.php
+++ b/lang/ru/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Russian translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'#' => '№',
'+1d' => '+1д',
'1 -Lowest-' => '1 -Самый Низкий-',
@@ -4705,4 +4705,4 @@ or use the image URL to include images using the WYSIWYG editor. ' => 'Если
'You will see this name show up<ul><li>when you want to assign the module</li><li>in the \'div\' surrounding the module (for css customisation)</li></ul>' => 'Вы увидете это имя<ul><li>когда вы назначаете модуль</li><li>в \'div\' окружающем модуль (для редактирования css)</li></ul>',
'zone' => 'зона',
'создать Wiki Page' => 'создать вики-страницу',
-);
+];
diff --git a/lang/sb/language.php b/lang/sb/language.php
index d035b77..dbc5d0a 100644
--- a/lang/sb/language.php
+++ b/lang/sb/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Pijin Solomon translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '-1d',
'+1d' => '+1d',
'-1m' => '-1m',
@@ -2920,5 +2920,5 @@ disfala mapfile:',
'You will receive an email with information to login for the first time into this site' => 'Baebae iu tekem wanfala email wea hemi garem informatin abaot hao fo login go long disfala ples/site long festaem blong iu',
'You will remove' => 'Baebae iu tekaotem',
'zone' => 'zone',
-);
+];
?> \ No newline at end of file
diff --git a/lang/sk/language.php b/lang/sk/language.php
index 36b26d3..9959953 100644
--- a/lang/sk/language.php
+++ b/lang/sk/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Slovak translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'+1d' => '+1d',
'+1m' => '+1m',
'+7d' => '+7d',
@@ -2574,5 +2574,5 @@ $lang=Array(
'You will receive an email with information to login for the first time into this site' => 'You will receive an email s information to login for the first time into this site',
'You will remove' => 'Odstránite',
'zone' => 'zone',
-);
+];
?> \ No newline at end of file
diff --git a/lang/sl/language.php b/lang/sl/language.php
index 22c8c68..c716efa 100644
--- a/lang/sl/language.php
+++ b/lang/sl/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Slovenian translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'action' => 'akcija',
'Actions' => 'Akcije',
'Active watches' => 'Aktivni zaznamki',
@@ -630,5 +630,5 @@ $lang=Array(
'Publish Date' => 'Datum objave',
'Puerto Rico' => 'Puerto Riko',
'Puerto_Rico' => 'Puerto Riko',
-);
+];
?> \ No newline at end of file
diff --git a/lang/sr-latn/language.php b/lang/sr-latn/language.php
index 20ea82c..185285c 100644
--- a/lang/sr-latn/language.php
+++ b/lang/sr-latn/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Serbian Latin translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '-1d',
'+1d' => '+1d',
'-1m' => '-1m',
@@ -3072,5 +3072,5 @@ map fajla:',
'You will receive an email with information to login for the first time into this site' => 'Primićete email sa informacijama za loginovanje po prvi put na ovaj sajt',
'You will remove' => 'Obrisaćete',
'zone' => 'Zone',
-);
+];
?> \ No newline at end of file
diff --git a/lang/sr/language.php b/lang/sr/language.php
index cf452e9..5082520 100644
--- a/lang/sr/language.php
+++ b/lang/sr/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Serbian translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '-1d',
'+1d' => '+1d',
'-1m' => '-1m',
@@ -3077,5 +3077,5 @@ map fajla:',
'You will receive an email with information to login for the first time into this site' => 'Primićete email sa informacijama za loginovanje po prvi put na ovaj sajt',
'You will remove' => 'Obrisaćete',
'zone' => 'zone',
-);
+];
?> \ No newline at end of file
diff --git a/lang/sv/language.php b/lang/sv/language.php
index 7b208ac..b43440d 100644
--- a/lang/sv/language.php
+++ b/lang/sv/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Swedish translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '-1d',
'+1d' => '+1d',
'-1m' => '-1m',
@@ -3206,5 +3206,5 @@ kartfilen:',
'You will receive an email with information to login for the first time into this site' => 'Du kommer att erhålla ett e-mejl med information hur du skall logga in första gången på denna sajt',
'You will remove' => 'Du kommer ta bort',
'zone' => 'zon',
-);
+];
?> \ No newline at end of file
diff --git a/lang/tr/language.php b/lang/tr/language.php
index 0f5e40e..97101d6 100644
--- a/lang/tr/language.php
+++ b/lang/tr/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Turkish translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'Add' => 'Ekle',
'Add a new group' => 'Yeni grup ekle',
'Add a new user' => 'Yeni kullanıcı ekle',
@@ -663,5 +663,5 @@ $lang=Array(
'Your registration code' => 'Üyelik kodunuz',
'Your username can only contain numbers, characters, and underscores.' => 'Kullanıcı adı sadece harf, sayı ve alt çizgi içerebilir.',
'Yugoslavia' => 'Yugoslavya',
-);
+];
?> \ No newline at end of file
diff --git a/lang/tv/language.php b/lang/tv/language.php
index a1f5fa5..f2fa3d7 100644
--- a/lang/tv/language.php
+++ b/lang/tv/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'All Fields must be non empty' => 'E tau o fakafonu a vaega katoa',
'Any wiki page is changed' => 'Sose wiki page e mafuli',
'Assign permissions' => 'Fakatoka fakataliaga',
@@ -201,5 +201,5 @@ towards the following URL here on this site:' => 'Ke fakatonu tau device\'s brow
'You must supply all the information, including title and year.' => 'E tau o tuku mai ne koe a fakamatalaga katoa fakatasi mote ulutala mote tausaga.',
'Your admin password has been changed' => 'Tau password faka Admin ko oti ne fakamafuli',
'Your email could not be validated; make sure you email is correct and click register below.' => 'E se talia tau e-mail; onoono o toe fakataonu ko ko toko ei register mai lalo.',
-);
+];
?> \ No newline at end of file
diff --git a/lang/tw/language.php b/lang/tw/language.php
index 8b0037c..11abc73 100644
--- a/lang/tw/language.php
+++ b/lang/tw/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Traditional Chinese translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'+1d' => '+1天',
'+1m' => '+1月',
'+7d' => '+7天',
@@ -2719,5 +2719,5 @@ $lang=Array(
'You will receive an email with your password soon' => '你很快就會收到含有密碼的 email',
'You will remove' => '將會移除',
'zone' => '區域',
-);
+];
?> \ No newline at end of file
diff --git a/lang/uk/language.php b/lang/uk/language.php
index a90a0c6..86ae214 100644
--- a/lang/uk/language.php
+++ b/lang/uk/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Ukrainian translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'-1d' => '-1d',
'+1d' => '+1д',
'-1m' => '-1m',
@@ -2723,5 +2723,5 @@ $lang=Array(
'You will receive an email with information to login for the first time into this site' => 'Ви отримаєте листа з інформацією про те, як зареєструватись (ввійти) на майднанчику вперше',
'You will remove' => 'Ви видалите',
'zone' => 'зона',
-);
+];
?> \ No newline at end of file
diff --git a/lang/zh-cn/language.php b/lang/zh-cn/language.php
index ceb787b..4551de8 100644
--- a/lang/zh-cn/language.php
+++ b/lang/zh-cn/language.php
@@ -1,7 +1,7 @@
<?php
// This language is the Chinese translation of bitweaver and
// it was exported from the bitweaver database on 2008-08-25 08:08
-$lang=Array(
+$lang=[
'+1d' => '+1天',
'+1m' => '+1月',
'+7d' => '+7天',
@@ -2721,5 +2721,5 @@ $lang=Array(
'You will receive an email with your password soon' => '你很快就会收到含有密码的 email',
'You will remove' => '将会移除',
'zone' => '区域',
-);
+];
?> \ No newline at end of file
diff --git a/liberty_plugins/data.tr.php b/liberty_plugins/data.tr.php
index 97cb54d..51bf286 100755
--- a/liberty_plugins/data.tr.php
+++ b/liberty_plugins/data.tr.php
@@ -10,8 +10,8 @@
*/
namespace Bitweaver\Liberty;
+
use Bitweaver\KernelTools;
-use Bitweaver\Liberty\LibertyContent;
/**
* Setup Code
@@ -28,7 +28,7 @@ $pluginParams = [
'description' => KernelTools::tra( "Use this plugin to mark strings for translation. You should only use this for common short strings, and not entire pages." ),
'help_function' => 'data_tr_help',
'syntax' => "",
- 'plugin_type' => DATA_PLUGIN
+ 'plugin_type' => DATA_PLUGIN,
];
$gLibertySystem->registerPlugin( PLUGIN_GUID_DATATR, $pluginParams );
$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATATR );
diff --git a/liberty_plugins/data.translated.php b/liberty_plugins/data.translated.php
index acbc351..4ad6190 100755
--- a/liberty_plugins/data.translated.php
+++ b/liberty_plugins/data.translated.php
@@ -5,6 +5,7 @@
* @subpackage plugins_data
*/
namespace Bitweaver\Liberty;
+
use Bitweaver\KernelTools;
// +----------------------------------------------------------------------+
@@ -39,7 +40,7 @@ $pluginParams = [
'description' => KernelTools::tra("This plugin is used to create a link to a page that contains a translation. The link can be shown as an Icon for the country or as an abreviation for the language."),
'help_function' => 'data_translated_help',
'syntax' => "{TRANSLATED page= lang= flag= }",
- 'plugin_type' => DATA_PLUGIN
+ 'plugin_type' => DATA_PLUGIN,
];
$gLibertySystem->registerPlugin( PLUGIN_GUID_DATATRANSLATED, $pluginParams );
$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATATRANSLATED );
@@ -59,16 +60,16 @@ function data_translated_help() {
// Load Function
function data_translated($data, $params) {
- extract ($params, EXTR_SKIP);
- if (!isset($page) ) { // A Manditory Parameter is missing
- $ret = 'The __page__ parameter was missing from the __~np~{TRANSLATED}~/np~__ plugin.';
+ extract ($params, EXTR_SKIP);
+ if (!isset($page) ) { // A Manditory Parameter is missing
+ $ret = 'The __page__ parameter was missing from the __~np~{TRANSLATED}~/np~__ plugin.';
$ret.= data_translated_help();
- return $ret;
+ return $ret;
}
- if (!isset($lang) ) { // A Manditory Parameter is missing
- $ret = 'The __lang__ parameter was missing from the __~np~{TRANSLATED}~/np~__ plugin.';
+ if (!isset($lang) ) { // A Manditory Parameter is missing
+ $ret = 'The __lang__ parameter was missing from the __~np~{TRANSLATED}~/np~__ plugin.';
$ret.= data_translated_help();
- return $ret;
+ return $ret;
}
$img = '';
@@ -80,7 +81,7 @@ function data_translated($data, $params) {
}
if (isset($flag)) {
if (in_array($flag,$avflags)) {
- $file = USERS_PKG_URL . "icons/flags/" . $flag . ".gif";
+ $file = USERS_PKG_URL . "icons/flags/" . $flag . ".gif";
$img = "<img src='$file' width='18' height='13' vspace='0' hspace='3' alt='($lang)' align='baseline' />";
}
} else {
diff --git a/master_strings.php b/master_strings.php
index dca0f6f..b4075b3 100755
--- a/master_strings.php
+++ b/master_strings.php
@@ -20,18 +20,18 @@ $gBitSmarty->assign( 'languages', $languages );
$feedback = $masterMsg = [];
if( !empty( $_REQUEST['source_hash'] ) && !is_array( $_REQUEST['source_hash'] ) ) {
- $_REQUEST['source_hash'] = array( $_REQUEST['source_hash'] );
+ $_REQUEST['source_hash'] = [ $_REQUEST['source_hash'] ];
}
if( !empty( $_REQUEST['delete_master'] ) && !empty( $_REQUEST['source_hash'] ) ) {
if( empty( $_REQUEST['confirm'] ) ) {
$gBitSystem->setBrowserTitle( tra( 'Confirm Delete' ) );
$formHash['delete_master'] = true;
- $msgHash = array(
+ $msgHash = [
'label' => tra( 'Delete Master Strings' ),
'warning' => tra( 'This will remove the language master string. If you are tracking translations and the string is still used, it will be inserted again, however, any translations associated with it will be lost.' ),
'confirm_item' => tra( "The following Master Strings will be removed" ).":",
- );
+ ];
foreach( $_REQUEST['source_hash'] as $source_hash ) {
$gBitLanguage->loadMasterStrings( $source_hash );
$formHash['input'][] = '<input type="hidden" name="source_hash[]" value="'.$source_hash.'"/>'.htmlentities( $gBitLanguage->mStrings['master'][$source_hash]['source'] );
@@ -67,7 +67,7 @@ if( !empty( $_REQUEST['delete_master'] ) && !empty( $_REQUEST['source_hash'] ) )
$newSourceHash = $gBitLanguage->getSourceHash( $_REQUEST['edit_master'][$sourceHash] );
$gBitLanguage->loadMasterStrings();
if( $newSourceHash != $sourceHash ) {
- if( $gBitLanguage->storeMasterString( array( 'source_hash' => $sourceHash, 'new_source' => $_REQUEST['edit_master'][$sourceHash] ) ) ) {
+ if( $gBitLanguage->storeMasterString( [ 'source_hash' => $sourceHash, 'new_source' => $_REQUEST['edit_master'][$sourceHash] ] ) ) {
unset( $_REQUEST['source_hash'] );
$_REQUEST['source_hash'][] = $newSourceHash;
$tranStrings[$newSourceHash] = $gBitLanguage->getTranslatedStrings( $newSourceHash );
@@ -85,7 +85,7 @@ if( !empty( $_REQUEST['delete_master'] ) && !empty( $_REQUEST['source_hash'] ) )
$gBitLanguage->loadMasterStrings(
null,
( !empty( $_REQUEST['filter'] ) ? $_REQUEST['filter'] : null ),
- ( !empty( $_REQUEST['filter_lang'] ) ? $_REQUEST['filter_lang'] : null )
+ ( !empty( $_REQUEST['filter_lang'] ) ? $_REQUEST['filter_lang'] : null ),
);
// work out what strings to display
@@ -110,7 +110,6 @@ if( !empty( $_REQUEST['delete_master'] ) && !empty( $_REQUEST['source_hash'] ) )
$gBitSmarty->assign( 'masterStrings', $masterStrings );
}
-
if( !empty( $_REQUEST['source_hash'] ) && empty( $_REQUEST['cancel'] ) ) {
foreach( $_REQUEST['source_hash'] as $reqSourceHash ) {
$gBitLanguage->loadMasterStrings( $reqSourceHash );
@@ -127,5 +126,5 @@ if( !empty( $_REQUEST['source_hash'] ) && empty( $_REQUEST['cancel'] ) ) {
// Display the template
$gBitSmarty->assign( 'masterMsg', $masterMsg );
$gBitSmarty->assign( 'feedback', $feedback );
-$gBitSystem->display( 'bitpackage:languages/language_master_strings.tpl', 'Edit Master Strings' , array( 'display_mode' => 'display' ));
+$gBitSystem->display( 'bitpackage:languages/language_master_strings.tpl', 'Edit Master Strings' , [ 'display_mode' => 'display' ]);
?>
diff --git a/modules/help_mod_switch_language_dropdown.tpl b/modules/help_mod_switch_language_dropdown.tpl
index 9e6db5d..9e6db5d 100644..100755
--- a/modules/help_mod_switch_language_dropdown.tpl
+++ b/modules/help_mod_switch_language_dropdown.tpl
diff --git a/modules/help_mod_switch_language_links.tpl b/modules/help_mod_switch_language_links.tpl
index 9e6db5d..9e6db5d 100644..100755
--- a/modules/help_mod_switch_language_links.tpl
+++ b/modules/help_mod_switch_language_links.tpl
diff --git a/modules/index.php b/modules/index.php
index 3e305fe..c0437d0 100644
--- a/modules/index.php
+++ b/modules/index.php
@@ -1,4 +1,4 @@
-<?php
+<?php
// This is not a package.
header ("location: ../index.php");
diff --git a/modules/mod_switch_language_dropdown.php b/modules/mod_switch_language_dropdown.php
index 4d47f24..3cbd7b3 100644
--- a/modules/mod_switch_language_dropdown.php
+++ b/modules/mod_switch_language_dropdown.php
@@ -5,7 +5,7 @@
* @package languages
* @subpackage modules
* @version $Header$
- */
+ */
global $gBitLanguage, $gBitUser;
//vd($_COOKIE);
//vd($_SESSION);
diff --git a/modules/mod_switch_language_dropdown.tpl b/modules/mod_switch_language_dropdown.tpl
index 5a50293..5a50293 100644..100755
--- a/modules/mod_switch_language_dropdown.tpl
+++ b/modules/mod_switch_language_dropdown.tpl
diff --git a/modules/mod_switch_language_links.php b/modules/mod_switch_language_links.php
index cb16e76..f88ca4e 100644
--- a/modules/mod_switch_language_links.php
+++ b/modules/mod_switch_language_links.php
@@ -5,7 +5,7 @@
* @package languages
* @subpackage modules
* @version $Header$
- */
+ */
global $gBitLanguage;
$sel_lang = !empty( $gBitUser->mInfo['bitlanguage'] ) ? $gBitUser->mInfo['bitlanguage'] : $gBitLanguage->mLanguage;
$gBitSmarty->assign( 'sel_lang', $sel_lang );
diff --git a/modules/mod_switch_language_links.tpl b/modules/mod_switch_language_links.tpl
index 46f1329..46f1329 100644..100755
--- a/modules/mod_switch_language_links.tpl
+++ b/modules/mod_switch_language_links.tpl
diff --git a/templates/admin_languages.tpl b/templates/admin_languages.tpl
index 8b4fd79..8b4fd79 100644..100755
--- a/templates/admin_languages.tpl
+++ b/templates/admin_languages.tpl
diff --git a/templates/i18n_service_icons.tpl b/templates/i18n_service_icons.tpl
index c3b241a..c3b241a 100644..100755
--- a/templates/i18n_service_icons.tpl
+++ b/templates/i18n_service_icons.tpl
diff --git a/templates/import_languages.tpl b/templates/import_languages.tpl
index 0c4b2cd..0c4b2cd 100644..100755
--- a/templates/import_languages.tpl
+++ b/templates/import_languages.tpl
diff --git a/templates/import_resolve.tpl b/templates/import_resolve.tpl
index 2931a96..2931a96 100644..100755
--- a/templates/import_resolve.tpl
+++ b/templates/import_resolve.tpl
diff --git a/templates/index.php b/templates/index.php
index 3e305fe..c0437d0 100644
--- a/templates/index.php
+++ b/templates/index.php
@@ -1,4 +1,4 @@
-<?php
+<?php
// This is not a package.
header ("location: ../index.php");
diff --git a/templates/language_master_strings.tpl b/templates/language_master_strings.tpl
index 15b7c3e..15b7c3e 100644..100755
--- a/templates/language_master_strings.tpl
+++ b/templates/language_master_strings.tpl
diff --git a/templates/menu_languages.tpl b/templates/menu_languages.tpl
index ffc393d..ffc393d 100644..100755
--- a/templates/menu_languages.tpl
+++ b/templates/menu_languages.tpl
diff --git a/templates/menu_languages_admin.tpl b/templates/menu_languages_admin.tpl
index c84b2f0..c84b2f0 100644..100755
--- a/templates/menu_languages_admin.tpl
+++ b/templates/menu_languages_admin.tpl
diff --git a/templates/select_translations.tpl b/templates/select_translations.tpl
index 5b1b742..5b1b742 100644..100755
--- a/templates/select_translations.tpl
+++ b/templates/select_translations.tpl
diff --git a/translate_strings.php b/translate_strings.php
index 574c00c..1eb1b1c 100755
--- a/translate_strings.php
+++ b/translate_strings.php
@@ -29,16 +29,15 @@ if( !empty( $_REQUEST['un_trans'] ) ) {
$gBitSmarty->assign( 'unTrans', 1 );
}
-
if( isset( $_REQUEST['save_translations'] ) ) {
$editLang = $_REQUEST['lang'];
$gBitLanguage->loadLanguage( $editLang );
$storedStrings = null;
foreach( $_REQUEST['edit_trans'] as $sourceHash => $string ) {
if( $string != $gBitLanguage->mStrings[$editLang][$sourceHash]['trans'] ) {
- // we need to remove the $_REQUEST slashes here to avoid stuff like:
- // {$gBitSystem->getConfig(\'stuff\')} in the translated strings -
- // it will kill the site since smarty won't be able to interpret
+ // we need to remove the $_REQUEST slashes here to avoid stuff like:
+ // {$gBitSystem->getConfig(\'stuff\')} in the translated strings -
+ // it will kill the site since smarty won't be able to interpret
// the template anymore --xing
if( ini_get( 'magic_quotes_gpc' ) ) {
$string = stripslashes( $string );
@@ -94,5 +93,5 @@ if( !empty( $_REQUEST['hash'] ) ) {
$gBitSmarty->assign( 'tranStrings', $tranStrings );
}
-$gBitSystem->display( 'bitpackage:languages/translate_strings.tpl', tra( 'Edit Translations' ) , array( 'display_mode' => 'edit' ));
+$gBitSystem->display( 'bitpackage:languages/translate_strings.tpl', tra( 'Edit Translations' ) , [ 'display_mode' => 'edit' ]);