Auto translate Fix

This commit is contained in:
Ibnu Maksum
2024-02-13 17:41:55 +07:00
parent 8baf977a9a
commit 459b9b30f1
10 changed files with 1611 additions and 1618 deletions

View File

@ -1,5 +1,4 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
@ -148,20 +147,14 @@ function _notify($msg, $type = 'e')
if (empty($config['language'])) {
$config['language'] = 'english';
}
if (empty($_SESSION['Lang'])) {
$lan_file = File::pathFixer('system/lan/' . $config['language'] . '.json');
if (file_exists($lan_file)) {
$_L = json_decode(file_get_contents($lan_file), true);
} else {
$_L['nux_created_by'] = 'Auto Generated by iBNuX Script';
$_SESSION['Lang'] = $_L;
if (file_exists($lan_file)) {
file_put_contents(File::pathFixer('system/lan/' . $config['language'] . '/common.lan.json'), json_encode($_L));
}
}
$lan_file = File::pathFixer('system/lan/' . $config['language'] . '.json');
if (file_exists($lan_file)) {
$_L = json_decode(file_get_contents($lan_file), true);
$_SESSION['Lang'] = $_L;
} else {
$_L = $_SESSION['Lang'];
$_L['author'] = 'Auto Generated by iBNuX Script';
$_SESSION['Lang'] = $_L;
file_put_contents($lan_file, json_encode($_L));
}
$ui = new Smarty();