motranslator | Translation API for PHP using Gettext MO files | Internationalization library

 by   phpmyadmin PHP Version: 5.2.0 License: GPL-2.0

kandi X-RAY | motranslator Summary

kandi X-RAY | motranslator Summary

motranslator is a PHP library typically used in Utilities, Internationalization applications. motranslator has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has low support. You can download it from GitHub.

Translation API for PHP using Gettext MO files.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              motranslator has a low active ecosystem.
              It has 39 star(s) with 21 fork(s). There are 7 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 22 have been closed. On average issues are closed in 87 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of motranslator is 5.2.0

            kandi-Quality Quality

              motranslator has 0 bugs and 23 code smells.

            kandi-Security Security

              motranslator has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              motranslator code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              motranslator is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              motranslator releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              motranslator saves you 476 person hours of effort in developing the same functionality from scratch.
              It has 1230 lines of code, 76 functions and 11 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed motranslator and discovered the below as its top functions. This is intended to give you an instant insight into motranslator implemented functionality, and help decide if they suit your requirements.
            • List all locale names
            • Load translations from a file .
            • Get translator .
            • Get text for plural form
            • Sanitize plural expression
            • Detects the current locale
            • Returns the plural string .
            • Read unsigned integer .
            • Read an array of integers .
            • Get singleton instance .
            Get all kandi verified functions for this library.

            motranslator Key Features

            No Key Features are available at this moment for motranslator.

            motranslator Examples and Code Snippets

            motranslator,Translator API usage
            PHPdot img1Lines of Code : 29dot img1License : Strong Copyleft (GPL-2.0)
            copy iconCopy
            // Translate string
            echo $translator->gettext('String');
            
            // Translate plural string
            echo $translator->ngettext('String', 'Plural string', $count);
            
            // Translate string with context
            echo $translator->pgettext('Context', 'String');
            
            // Transl  
            motranslator,Gettext compatibility usage
            PHPdot img2Lines of Code : 21dot img2License : Strong Copyleft (GPL-2.0)
            copy iconCopy
            // Load compatibility layer
            PhpMyAdmin\MoTranslator\Loader::loadFunctions();
            
            // Configure
            _setlocale(LC_MESSAGES, 'cs');
            _textdomain('phpmyadmin');
            _bindtextdomain('phpmyadmin', __DIR__ . '/data/locale/');
            _bind_textdomain_codeset('phpmyadmin', 'UTF  
            motranslator,Object API usage
            PHPdot img3Lines of Code : 16dot img3License : Strong Copyleft (GPL-2.0)
            copy iconCopy
            // Create loader object
            $loader = new PhpMyAdmin\MoTranslator\Loader();
            
            // Set locale
            $loader->setlocale('cs');
            
            // Set default text domain
            $loader->textdomain('domain');
            
            // Set path where to look for a domain
            $loader->bindtextdomain('doma  

            Community Discussions

            QUESTION

            Ubuntu 20.04 PhpMyAdmin error 500 with php7.0 - caching_sha2_password]
            Asked 2020-Oct-22 at 12:49

            When I am using php version 7.0 with Ubuntu 20.04 and try open: http://localhost/phpmyadmin/ - then: HTTP ERROR 500 appers.

            When I try open any other page which connect with database, there appears:

            • "Message: mysqli::real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]"
            • "mysqli::real_connect(): (HY000/2054): The server requested authentication method unknown to the client"

            enter image description here enter image description here

            When I change php version to 7.4 - everything is working correct (phpmyadnim and pages)

            I checked logs on version 7.0 (tail /var/log/apache2/error.log) and there is error:

            • "PHP Parse error:syntax error, unexpected 'const' (T_CONST),expecting variable (T_VARIABLE) in /usr/share/php/PhpMyAdmin/MoTranslator/Translator.php on line 58

            enter image description here

            I tried install :

            sudo apt-get install php-mbstring php7.0-mbstring php-gettext

            but everytime I do this - I get information : "Unable to locate package php-gettext"

            On php version 7.4 everything is ok. But I want to use php version 7.0.

            I tried:

            • remove and install phpmyadmin again
            • remove and install php version 7.0 again
            ...

            ANSWER

            Answered 2020-Oct-22 at 12:49

            When running a PHP version before 7.1.16, or PHP 7.2 before 7.2.4, set MySQL 8 Server's default password plugin to mysql_native_password or else you will see errors similar to The server requested authentication method unknown to the client [caching_sha2_password] even when caching_sha2_password is not used.

            This is because MySQL 8 defaults to caching_sha2_password, a plugin that is not recognized by the older PHP (mysqlnd) releases. Instead, change it by setting default_authentication_plugin=mysql_native_password in my.cnf. The caching_sha2_password plugin will be supported in a future PHP release.

            Source https://www.php.net/manual/en/mysqli.requirements.php

            Source https://stackoverflow.com/questions/64480449

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install motranslator

            Please use Composer to install:.

            Support

            The API documentation is available at https://develdocs.phpmyadmin.net/motranslator/.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/phpmyadmin/motranslator.git

          • CLI

            gh repo clone phpmyadmin/motranslator

          • sshUrl

            git@github.com:phpmyadmin/motranslator.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Internationalization Libraries

            formatjs

            by formatjs

            react-i18next

            by i18next

            version

            by sebastianbergmann

            globalize

            by globalizejs

            angular-translate

            by angular-translate

            Try Top Libraries by phpmyadmin

            phpmyadmin

            by phpmyadminPHP

            docker

            by phpmyadminPHP

            sql-parser

            by phpmyadminPHP

            themes

            by phpmyadminPHP

            website

            by phpmyadminPython