! Move plugin languages to a folder rather than the main SMF languages (install.xml, Admin.php, Subs.php)
Jeremy D

Jeremy D commited on 2011-11-02 10:23:48
Showing 4 changed files, with 7 additions and 3 deletions.

... ...
@@ -269,6 +269,8 @@ require_once($sourcedir . '/sd_source/SimpleDesk-SSI.php');]]></add>
269 269
 			<add><![CDATA[	// Add SimpleDesk to the list of possible places to look.
270 270
 	$themes['shd'] = array('name' => 'SimpleDesk', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_language');
271 271
 	$lang_dirs['shd'] = $settings['default_theme_dir'] . '/languages/sd_language';
272
+	$themes['shd_plugins'] = array('name' => 'SimpleDesk Plugins', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_plugins_lang');
273
+	$lang_dirs['shd_plugins'] = $settings['default_theme_dir'] . '/languages/sd_plugins_lang';
272 274
 
273 275
 ]]></add>
274 276
 		</operation>
... ...
@@ -35,6 +35,8 @@
35 35
 // If we have found SSI.php and we are outside of SMF, then we are running standalone.
36 36
 if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
37 37
 	require_once(dirname(__FILE__) . '/SSI.php');
38
+elseif (file_exists(getcwd() . '/SSI.php') && !defined('SMF'))
39
+	require_once(getcwd() . '/SSI.php');
38 40
 elseif (!defined('SMF')) // If we are outside SMF and can't find SSI.php, then throw an error
39 41
 	die('<b>Error:</b> Cannot install - please verify you put this file in the same place as SMF\'s SSI.php.');
40 42
 elseif (@version_compare(PHP_VERSION, '4.3.0', '<'))
... ...
@@ -111,7 +111,7 @@ function shd_admin_plugins()
111 111
 		'vietnamese',
112 112
 	);
113 113
 	$langtemplates = array();
114
-	$langfilelist = @opendir($settings['default_theme_dir'] . '/languages/');
114
+	$langfilelist = @opendir($settings['default_theme_dir'] . '/languages/sd_plugins_lang/');
115 115
 	while ($langfile_entry = readdir($langfilelist))
116 116
 	{
117 117
 		if (preg_match('~([a-z0-9]+)\.([a-z\-\_]+)(-utf8)?\.php$~i', $langfile_entry, $matches))
... ...
@@ -135,7 +135,7 @@ function shd_admin_plugins()
135 135
 			if (!empty($include[0]))
136 136
 				$plugins[$id]['languages'] = array_keys($langtemplates[$include[0]]);
137 137
 			foreach ($include as $langfile)
138
-				shd_load_language($langfile);
138
+				shd_load_language('sd_plugins_lang/' . $langfile);
139 139
 		}
140 140
 
141 141
 		// 3.3 Sort out some strings - now we've loaded the lang file
... ...
@@ -1544,7 +1544,7 @@ function shd_load_plugin_langfiles($hook = '')
1544 1544
 
1545 1545
 	$filelist = explode(',', $modSettings['shd_includelang_' . $hook]);
1546 1546
 	foreach ($filelist as $file)
1547
-		shd_load_language($file);
1547
+		shd_load_language('sd_plugins_lang/' . $file);
1548 1548
 }
1549 1549
 
1550 1550
 /**
1551 1551