Locales in ISPConfig

Discussion in 'Developers' Forum' started by exynenem, Aug 28, 2020.

  1. exynenem

    exynenem Member

    I'm still working on some improvements/changes (among relocating db dir to /log instead of stats/.db) for GoAccess and one of them are locales.
    Right now the locales are being obtained from $conf['language'] which would not always produce a correct locale name which I could use as a value for "LANG=<locale> <command>".

    Is there some function or table in ISPConfig which would provide proper locale names, like for Angola pt_AO?
    If not I would like to add an additional column to the table "country" with the appropriate locale names.

    Forget what I wrote above. I have seen that the language selection when editing a user seems to be compiled by reading the available language files from interface/lib/lang/*.lng.
    So we are speaking only of 25 languages. Without the possiblity of sub-languages like the above Angola example. So the current code which would produce the locale code should be perfectly fine.

    Ok, I was wrong lol. The current code doesn't always produce correct locale codes. For example the utf-8 locale code for Japan would be ja_JP.UTF-8 and not ja_JA.UTF-8. I think I will add correct detection to the cronjob file. I'am not sure, but might be defining the locale code in each lng file still be worth/interesting, maybe even for future use cases?
    Last edited: Aug 28, 2020
  2. exynenem

    exynenem Member

    I was fiddling a bit more around with the language selection in ISPConfig and generating & displaying the GoAccess statistics in other languages.
    There are a few things which I stumbled across which don't seem to be correct. Either my environment is buggy or there are bugs in the code.

    Here is a list:

    1. Some country flags are not correctly displayed, here for example greece, locale code would be el_GR. (minor bug)

    2. Where does the value for $conf['language'] come from? It doesn't seem to be the selected customer language.
    Is this actually intended to be the customer's language? I've oriented myself by the awstats cron code where $conf['language'] is used as well.
    At least in a multiserver environment I get different results than my actual customer's language selection.

    3. Does anyone know how to get utf-8 charset properly working with GoAccess? Here is the current branch on which I am working on: https://git.ispconfig.org/ms217/ispconfig3/-/commits/goaccess-adjustments
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig does not use the '5 digit style' iso locale codes.


    No, it's the language of the hosting company.

Share This Page