Ad Widget

Collapse

Problem with changing the language [Debian]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zbychok14
    Junior Member
    • Aug 2020
    • 7

    #1

    Problem with changing the language [Debian]

    Hello, after installing zabbix, I wanted to change the language in the Web interface. After changing the language in the user's profile, the language does not change. Instruction from the site https://techexpert.tips/zabbix/zabbi...face-language/ doesn't work.

    You have any tips ?






    Click image for larger version

Name:	Screenshot_1.png
Views:	7236
Size:	53.8 KB
ID:	406729
    Code:
    ~$locale -a
    C
    C.UTF-8
    pl_PL.utf8
    POSIX
    pt_BR.utf8
    ru_RU.utf8
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Did you click the update button after selecting your language?

    Comment

    • zbychok14
      Junior Member
      • Aug 2020
      • 7

      #3
      Of course, no matter which language I choose, English remains

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #4
        Which web server do you use? What version of PHP? Is the gettext php module loaded?
        Is file frontend.mo in locale/pt/LC_MESSAGES/ ?
        Last edited by Hamardaban; 11-08-2020, 20:45.

        Comment

        • Atsushi
          Senior Member
          • Aug 2013
          • 2028

          #5
          I built Zabbix 5.0.2 environment on Debian 10 and tried it. First, I added the pt_BR.utf8 locale with the following command.

          Code:
          # dpkg-reconfigure locales
          After adding, I restarted apache2.

          Code:
          # systemctl restart apache2
          Then, pt_BR can be selected as the language of the user profile, so when I select it and click Update, the language is changed.
          Check the web server log to see if any errors have occurred.

          Comment

          • zbychok14
            Junior Member
            • Aug 2020
            • 7

            #6
            Click image for larger version  Name:	Screenshot_1.png Views:	15 Size:	24.1 KB ID:	406859
            Click image for larger version

Name:	Screenshot_2.png
Views:	7832
Size:	26.4 KB
ID:	406927Click image for larger version

Name:	Screenshot_3.png
Views:	7813
Size:	37.2 KB
ID:	406928
            Originally posted by Hamardaban
            Which web server do you use? What version of PHP? Is the gettext php module loaded?
            Is file frontend.mo in locale/pt/LC_MESSAGES/ ?

            I am using the default web server in debian 10
            Code:
            # php -v
            PHP 7.3.19-1~deb10u1 (cli) (built: Jul 5 2020 06:46:45) ( NTS )
            Copyright (c) 1997-2018 The PHP Group
            Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
            with Zend OPcache v7.3.19-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies

            So the frontend.mo file is the language folder


            Originally posted by Atsushi
            I built Zabbix 5.0.2 environment on Debian 10 and tried it. First, I added the pt_BR.utf8 locale with the following command.

            Code:
            # dpkg-reconfigure locales
            After adding, I restarted apache2.

            Code:
            # systemctl restart apache2
            Then, pt_BR can be selected as the language of the user profile, so when I select it and click Update, the language is changed.
            Check the web server log to see if any errors have occurred.

            I did the setup with your help but the problem is still there.
            In apache and zabbix logs I do not see any errors related to this.


            Last edited by zbychok14; 13-08-2020, 09:42.

            Comment

            • zbychok14
              Junior Member
              • Aug 2020
              • 7

              #7

              Apache logs
              Code:
              Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
              Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
              [Fri Sep 04 07:49:39.971277 2020] [mpm_prefork:notice] [pid 741] AH00163: Apache/2.4.38 (Debian) mod_perl/2.0.10 Perl/v5.28.1 configured -- resuming normal operations
              [Fri Sep 04 07:49:39.971330 2020] [core:notice] [pid 741] AH00094: Command line: '/usr/sbin/apache2'
              [Fri Sep 04 07:49:40.634076 2020] [perl:error] [pid 742] [client 192.168.1.145:55431] Can't call method "rollback" on an undefined value at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Server/System.pm line 282.\n
              [Fri Sep 04 09:28:13.717761 2020] [mpm_prefork:notice] [pid 741] AH00169: caught SIGTERM, shutting down
              Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
              Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
              [Fri Sep 04 09:28:14.569524 2020] [mpm_prefork:notice] [pid 2179] AH00163: Apache/2.4.38 (Debian) mod_perl/2.0.10 Perl/v5.28.1 configured -- resuming normal operations
              [Fri Sep 04 09:28:14.569573 2020] [core:notice] [pid 2179] AH00094: Command line: '/usr/sbin/apache2'
              [Fri Sep 04 09:29:54.221925 2020] [mpm_prefork:notice] [pid 2179] AH00169: caught SIGTERM, shutting down
              Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
              Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
              [Fri Sep 04 09:29:55.059433 2020] [mpm_prefork:notice] [pid 2815] AH00163: Apache/2.4.38 (Debian) mod_perl/2.0.10 Perl/v5.28.1 configured -- resuming normal operations
              [Fri Sep 04 09:29:55.059506 2020] [core:notice] [pid 2815] AH00094: Command line: '/usr/sbin/apache2'
              [Fri Sep 04 09:33:36.725574 2020] [mpm_prefork:notice] [pid 2815] AH00169: caught SIGTERM, shutting down
              Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
              Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
              [Fri Sep 04 09:33:37.573663 2020] [mpm_prefork:notice] [pid 2900] AH00163: Apache/2.4.38 (Debian) mod_perl/2.0.10 Perl/v5.28.1 configured -- resuming normal operations
              [Fri Sep 04 09:33:37.573714 2020] [core:notice] [pid 2900] AH00094: Command line: '/usr/sbin/apache2'
              [Fri Sep 04 09:34:36.333349 2020] [mpm_prefork:notice] [pid 2900] AH00169: caught SIGTERM, shutting down
              Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
              "error.log" 25 lines, 3395 characters
              Which web server do you use? What version of PHP? Is the gettext php module loaded?
              Is file frontend.mo in locale/pt/LC_MESSAGES/ ?
              Click image for larger version

Name:	Screenshot_1.png
Views:	7177
Size:	16.1 KB
ID:	408464



              do you have any ideas?
              Last edited by zbychok14; 04-09-2020, 10:10.

              Comment

              • Hamardaban
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • May 2019
                • 2713

                #8
                Recently, we spent a long time dealing with one person why his translation doesn't work. we went through a lot of options and came to the conclusion that php is incorrectly configured to work with modules and in particular with gettext. Check your settings (phpinfo () to help) and look in the php error log - maybe there are messages about problems.
                Last edited by Hamardaban; 04-09-2020, 12:17.

                Comment

                • zbychok14
                  Junior Member
                  • Aug 2020
                  • 7

                  #9
                  Click image for larger version

Name:	Screenshot_1.png
Views:	7355
Size:	33.0 KB
ID:	410210Click image for larger version

Name:	Screenshot_2.png
Views:	7355
Size:	83.3 KB
ID:	410211Click image for larger version

Name:	Screenshot_3.png
Views:	7415
Size:	102.4 KB
ID:	410212

                  Comment

                  • aughtm
                    Junior Member
                    • Oct 2020
                    • 4

                    #10
                    I have been following your discussion as well as the options considered in https://www.zabbix.com/forum/in-russ...freebsd12-1x64 .

                    What surprises me is that this kind of problem, language option not working in Zabbix 5.0, seems to be rare. In my case, I have Zabbix version 5.0.4 installed and PHP gettext is supported. After I change user profile language to Portugues (pt_BR) and update, the interface continues in English.

                    This PHP code below for test works quite well from terminal, though when executed through a browser from the context document root (/usr/share/zabbix), it confirms 'gettext' is supported but the text is still in English.

                    PHP Code:
                    putenv("LANGUAGE=pt_BR.UTF-8");
                    setlocale(LC_ALL"pt_BR.UTF-8");
                    bindtextdomain("frontend""/usr/share/zabbix/locale");
                    bind_textdomain_codeset("frontend""UTF-8");
                    textdomain ("frontend");
                    if (!
                    function_exists("gettext"))
                    {
                    echo 
                    "gettext extension is NOT AVAILABLE!";
                    }
                    else
                    {
                    echo 
                    "PHP gettext extension is SUPPORTED!\n";
                    echo 
                    "Testing it with 'pt_BR.UTF-8'\n";
                    echo 
                    gettext("Cannot add group") . "\n";
                    echo 
                    _("Cannot delete action") . "\n";

                    Log files shows no error or clue to indicate the reason for this problem. I suspect that it might be some restriction posed by Apache configuration. I must say there is a GLPI application previously installed on the same server which works fine in Portuguese.

                    I hope version 5.2 may resolve it anyway through 'Administration->General->Default language' menu as already suggested.

                    ---------------
                    Debian 10/PHP 7.4.11/Apache 2.4.38/MariaDB 10.5.6/Zabbix 5.0.4

                    Comment

                    • aughtm
                      Junior Member
                      • Oct 2020
                      • 4

                      #11
                      I was able to migrate from Zabbix 5.0.4 to Zabbix 5.2.0 successfully. I set GUI default language and user profile language to Portuguese (pt_BR), restarted Zabbix server and Apache but the GUI continues in English. There must be a turnaround for this behavior that I need to find out. It may have to do with Apache as it seems to restrict PHP gettext working only with Zabbix and not with GLPI. I think the moment I get translation by running that PHP code for test of my previous post through a browser, the problem is over.


                      ---------------
                      Debian 10/PHP 7.4.11/Apache 2.4.38/MariaDB 10.5.6/Zabbix 5.2.0

                      Comment

                      • Atsushi
                        Senior Member
                        • Aug 2013
                        • 2028

                        #12
                        I tried to build multiple new environments. I consisted of Zabbix official package and standard package of each OS. It is possible to switch between multiple languages and switch to each language in all environments.

                        - CentOS 8.2.2004 (Zabbix 5.2.0-1, Apache 2.4.37-21, PHP 7.2.24-1, MySQL 8.0.21-1)
                        - Ubuntu 20.04.1 (Zabbix 5.2.0-1, Apache 2.4.41-4, PHP 7.4.3-4, MySQL 8.0.22-0)
                        - Debian GNU/Linux 10 (Zabbix 5.2.0-1, Apache 2.4.38-3, PHP 7.3.19-1, MariaDB 10.3.25-0)

                        However, the content of "Additional .ini files parsed" in zbychok14's phpinfo was different. In my Debian environment, the following ini does not exist.

                        Code:
                        /etc/php/7.3/apache2/conf.d/20-apcu.ini
                        /etc/php/7.3/apache2/conf.d/20-curl.ini
                        /etc/php/7.3/apache2/conf.d/20-imagick.ini
                        /etc/php/7.3/apache2/conf.d/20-imap.ini
                        /etc/php/7.3/apache2/conf.d/20-intl.ini
                        /etc/php/7.3/apache2/conf.d/20-memcache.ini
                        /etc/php/7.3/apache2/conf.d/20-pspell.ini
                        /etc/php/7.3/apache2/conf.d/20-recode.ini
                        /etc/php/7.3/apache2/conf.d/20-soap.ini
                        /etc/php/7.3/apache2/conf.d/20-tidy.ini
                        /etc/php/7.3/apache2/conf.d/20-xmlrpc.ini
                        /etc/php/7.3/apache2/conf.d/20-zip.ini
                        /etc/php/7.3/apache2/conf.d/25-apcu_bc.ini
                        Last edited by Atsushi; 28-10-2020, 14:03.

                        Comment


                        • Atsushi
                          Atsushi commented
                          Editing a comment
                          I have installed the following packages, but I can still switch languages even after restarting the OS.

                          php-curl
                          php-imagick
                          php-imap
                          php-intl
                          php-memcache
                          php-pspell
                          php-recode
                          php-soap
                          php-tidy
                          php-xmlrpc
                          php-zip
                          php-apcu
                          php-apcu-bc

                        • Atsushi
                          Atsushi commented
                          Editing a comment
                          The browsers I'm using are:
                          - Firefox 82.0.2
                          - Google Chrome 86.0.4240.111
                          - Microsoft Edge 86.0.622.56
                      • aughtm
                        Junior Member
                        • Oct 2020
                        • 4

                        #13
                        According to my former posts, I suspected the actual problem had to do with Apache. However, all mystery was finally revealed as all the blame was on mod_perl. Suffice to execute these two commands:
                        Code:
                        # a2dismod perl
                        # systemctl restart apache2
                        Wow! The user interface was translated into Portuguese. I owe this to this article: PHP: Translations with gettext not working in Apache mod_php but works on command line (caused by mod_perl)
                        https://www.claudiokuenzler.com/blog/1023/php-gettext-translations-not-working-apache-mod_php-cli-works.
                        It was exactly what I needed. It resolved for me.

                        aughtm

                        ------------
                        Debian 10/PHP 7.4.12/Apache 2.4.38/MariaDB 10.5.6/Zabbix 5.2.1

                        Comment

                        • aughtm
                          Junior Member
                          • Oct 2020
                          • 4

                          #14
                          zbychok14

                          I could see by your Apache logs that you may have OCS Inventory installed on you server and it depends on Mod_perl.
                          Scalar value @args[...] better written as $args[...] at /usr/local/share/perl/5.28.1/Apache/Ocsinventory/Interface/AssetCategory.pm line 53.
                          I once had installed OCS Inventory which I removed but left Mod_perl enabled, and this prevented gettext from doing its job.

                          Comment

                          • zbychok14
                            Junior Member
                            • Aug 2020
                            • 7

                            #15
                            Originally posted by aughtm
                            According to my former posts, I suspected the actual problem had to do with Apache. However, all mystery was finally revealed as all the blame was on mod_perl. Suffice to execute these two commands:
                            Code:
                            # a2dismod perl
                            # systemctl restart apache2
                            Wow! The user interface was translated into Portuguese. I owe this to this article: PHP: Translations with gettext not working in Apache mod_php but works on command line (caused by mod_perl)
                            https://www.claudiokuenzler.com/blog/1023/php-gettext-translations-not-working-apache-mod_php-cli-works.
                            It was exactly what I needed. It resolved for me.

                            aughtm

                            ------------
                            Debian 10/PHP 7.4.12/Apache 2.4.38/MariaDB 10.5.6/Zabbix 5.2.1


                            Thank you, the problem is solved

                            Comment

                            Working...