Quickbox-setup incorrect variable use in function _quickstats()


#1

Hello, while going through the install script I noticed the following lines in the _quickstats() function:

LOCALE=en_GB.UTF-8
LANG=lang_en
sed -i "s/LOCALE/${locale}/g" /srv/rutorrent/home/inc/localize.php
sed -i "s/LANG/${lang}/g" /srv/rutorrent/home/inc/localize.php

(direct link)

Two things caught my attention:

  1. The locale en_GB.UTF-8, while everywhere else it is en_US.UTF-8;

  2. The variable substitution, which doesn’t refer to the just defined vars because the case doesn’t match; e.g.:

    [[email protected] ~]$ LOCALE=en_GB.UTF-8
    [[email protected] ~]$ echo ${locale}
    
    [[email protected] ~]$ echo ${LOCALE}
    en_GB.UTF-8
    

So I believe those two sed expressions should be changed to use uppercase LANG and LOCALE, and GB to US as is custom in the rest of the script.

(Sidenote: what is the rationale behind forcing a locale? Ease bug report/harmonize user installations?)

By the way, is this the preferred way to report bugs at Quickbox? Or is it over the Quicklab repo?

Thanks for your work and community welcoming.


#2

These two edits that are made on the script are non-relative to the rest of the servers function. This only changes the two instances within the localize for languages swapping on the dashboard. There is really no need to address this. We could make the change to save anyone else confusion, however; it really is a very trivial edit that has no effect on anything accept one include file.

Nope, you’re really over thinking it :wink:
Although, I will say that our installation of php7.0-fpm does require an en locale.

Not a bug, however; if you do approach a bug, you can be super awesome and open up a comment and/or pull request for a potential fix, or you can post under the #bugs thread with your findings.