php-gettext / translator Goto Github PK
View Code? Open in Web Editor NEWGettext translator functions
License: MIT License
Gettext translator functions
License: MIT License
Just wanted to drop a quick thank you for these awesome libraries. It saved me from the headache I got on Windows with setlocale.
Hi!
Is it possible to update the ArrayGenerator
to include empty translations? If yes, then I might create a PR in case it helps.
e.g.:
msgid "key"
msgstr ""
Sorry, I am unable to make this work, can you please tell me what I am doing wrong?
use Gettext\GettextTranslator;
$t = new GettextTranslator();
$t->setLanguage('de_DE');
$t->loadDomain('messages', ROOT . '/Locale');
echo $t->gettext('Welcome to wishthis');
/Locale/de_DE/LC_MESSAGES/messages.po
(created with Poedit)msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2022-03-21 09:58+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Jay Trees <[email protected]>\n"
"Language-Team: \n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.0.1\n"
"X-Poedit-Basepath: ../../../src\n"
"X-Poedit-KeywordsList: __\n"
"X-Poedit-SearchPath-0: .\n"
#: functions/gettext.php:13 pages/home.php:22
msgid "Welcome to wishthis"
msgstr "Willkommen zu wishthis"
home.php
<h2 class="ui header"><?= _('Welcome to wishthis') ?></h2>
The text is not translated, the original is shown when I am expecting the German version.
Like the gettext/gettext Repo in Version 5, this Repo also is configured as not supporting PHP8, meaining, you cant embed it currently in a Composer Project within PHP8, as ^7.2 does not support 8.0. Can this be changed? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.