zerospam / laravel-gettext

Adds localization support to laravel applications using PoEdit and GNU-Gettext.
99 stars 56 forks source link

Scan the directory for gettext strings and add them to .po file #61

Closed Diae-Louali closed 1 year ago

Diae-Louali commented 1 year ago

Is there a way to scan the directories for gettext strings and add them to the .po file programmatically, meaning without having to go through Poedit to achieve that ?

I went through the normal installation configuration steps listed in the documentation, but when php artisan gettext:create or php artisan gettext:update command is executed, it only seems to generate empty .po files only containing the headers.

messages.po :

msgid ""
msgstr ""
"Project-Id-Version: MultilanguageLaravelApplication\n"
"POT-Creation-Date: 2022-09-16 11:59+0200\n"
"PO-Revision-Date: 2022-09-16 11:59+0200\n"
"Last-Translator: James Translator <james@translations.colm>\n"
"Language-Team: James Translator <james@translations.colm>\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.4\n"
"X-Poedit-KeywordsList: _;__;_i;_s;gettext;_n:1,2;ngettext:1,2;dgettext:2\n"
"X-Poedit-Basepath: ../../../../../app\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: Http\n"
"X-Poedit-SearchPath-1: ../resources/views\n"
"X-Poedit-SearchPath-2: Console\n"
"X-Poedit-SearchPath-3: ../storage/framework/messages/\n"