forked from ZwiiCMS-Team/ZwiiCMS
12100 capture function
This commit is contained in:
parent
26dce57cb6
commit
a97a215e0b
@ -26,6 +26,16 @@ class helper
|
|||||||
|
|
||||||
public static function translate($text)
|
public static function translate($text)
|
||||||
{
|
{
|
||||||
|
$target = 'blog';
|
||||||
|
/** Collecte des dialogues des modules */
|
||||||
|
$url = $_SERVER['QUERY_STRING'];
|
||||||
|
$module = explode('/', $url);
|
||||||
|
if ($module === $target)
|
||||||
|
{
|
||||||
|
$dialogues = json_decode(file_get_contents('module/' . $target . '/i18n/fr_FR.json' ), true);
|
||||||
|
$data = array_merge($dialogues,[$text => '']);
|
||||||
|
file_put_contents ('module/' . $target . '/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
|
}
|
||||||
return (array_key_exists($text, core::$dialog) && !empty(core::$dialog[$text]) ? core::$dialog[$text] : $text);
|
return (array_key_exists($text, core::$dialog) && !empty(core::$dialog[$text]) ? core::$dialog[$text] : $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
module/blog/i18n/fr_FR.json
Normal file
3
module/blog/i18n/fr_FR.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user