motranslator | Translation API for PHP using Gettext MO files | Internationalization library
kandi X-RAY | motranslator Summary
kandi X-RAY | motranslator Summary
Translation API for PHP using Gettext MO files.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- 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 .
motranslator Key Features
motranslator Examples and Code Snippets
// 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
// Load compatibility layer
PhpMyAdmin\MoTranslator\Loader::loadFunctions();
// Configure
_setlocale(LC_MESSAGES, 'cs');
_textdomain('phpmyadmin');
_bindtextdomain('phpmyadmin', __DIR__ . '/data/locale/');
_bind_textdomain_codeset('phpmyadmin', 'UTF
// 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
Trending Discussions on motranslator
QUESTION
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
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:49When 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
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install motranslator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page