mirror of
https://github.com/unraid/webgui.git
synced 2026-01-20 08:30:14 -06:00
Merge pull request #670 from bergware/mutli-language
Multi-language support
This commit is contained in:
25
plugins/dynamix/LanguageButton.page
Normal file
25
plugins/dynamix/LanguageButton.page
Normal file
@@ -0,0 +1,25 @@
|
||||
Menu="Buttons"
|
||||
Title="English"
|
||||
Icon="icon-u-switch"
|
||||
Code="e982"
|
||||
---
|
||||
<?PHP
|
||||
/* Copyright 2005-2020, Lime Technology
|
||||
* Copyright 2012-2020, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*/
|
||||
?>
|
||||
<script>
|
||||
function LanguageButton() {
|
||||
switchLanguage('');
|
||||
}
|
||||
function switchLanguage(lang) {
|
||||
$.post('/webGui/include/LanguageReset.php',{lang:lang},function(){refresh();});
|
||||
}
|
||||
</script>
|
||||
16
plugins/dynamix/include/LanguageReset.php
Normal file
16
plugins/dynamix/include/LanguageReset.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?PHP
|
||||
/* Copyright 2005-2020, Lime Technology
|
||||
* Copyright 2012-2020, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$lang = $_POST['lang'] ?? '';
|
||||
exec("sed -ri 's/^(locale=\")[^\"]*/\\1$lang/' /boot/config/plugins/dynamix/dynamix.cfg");
|
||||
?>
|
||||
Reference in New Issue
Block a user