#!/bin/bash
#
# [Quick Box :: Set German Language function]
#
# QuickLab REPOS
# QuickLab _ packages  :   https://github.com/QuickBox/quickbox_packages
# LOCAL REPOS
# Local _ packages   :   /etc/QuickBox/packages
# Author             :   QuickBox.IO | JMSolo
# URL                :   https://quickbox.io
#
# QuickBox Copyright (C) 2017 QuickBox.io
# Licensed under GNU General Public License v3.0 GPL-3 (in short)
#
#   You may copy, distribute and modify the software as long as you track
#   changes/dates in source files. Any modifications to our software
#   including (via compiler) GPL-licensed code must also be made available
#   under the GPL along with build & install instructions.
#

locale='de_DE.UTF-8'
language='lang_de'

cat >/srv/rutorrent/home/inc/localize.php<<LCL
<?php
    \$locale = 'de_DE.UTF-8';
    \$language = 'lang_de';
    setlocale(LC_ALL, $locale);
    require (\$_SERVER['DOCUMENT_ROOT']."/lang/$language");

    function T(\$str)
    {
        global \$L;
        if (isset(\$L[\$str]))
            return \$L[\$str];
        else
            return \$str;
    }

?>
LCL

chown www-data: /srv/rutorrent/home/inc/localize.php
service apache2 reload
