Форумы / Cotonti / Core Labs / Archive / sed_build_lang

esclkm
#1 27.12.2008 03:32
The most of plugins use lang files/
I think that must exist function, which help us to include in module lang file in one string.Smth like this:
function sed_build_lang($plugin)
{
if (@file_exists($cfg['plugins_dir'].'/'.$plugin.'/lang/'.$plugin.'.'.$usr['lang'].'.lang.php'))
{
	require_once($cfg['plugins_dir'].'/'.$plugin.'/lang/'.$plugin.'.'.$usr['lang'].'.lang.php');
}
else
{
	require_once($cfg['plugins_dir'].'/'.$plugin.'/lang/'$plugin'.en.lang.php');
}
}
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
Trustmaster
#2 27.12.2008 03:47
Well, the thing about langfiles is that plug.inc.php does that automatically. But we can add sed_langfile() function just in some cases when it doesn't (e.g. the name of the langfile is different or it's from a different plugin). Just let's call it sed_langfile similar to sed_skinfile which we already have.
May the Source be with you!