![]() We are mostly using Ubuntu and Docker, so here is what that might look like: RUN apt-get update \ You need to install the locales, gettext, and poedit on your operating system. ![]() To configure gettext in your Docker environment, takes only a few lines of code and 2 minutes of your time. It has been ported to many programming languages, including PHP. The Docker part (likely what you are looking for)įortunately, there are open source tools that make translation of your app easy.Ĭonsider using `gettext`, a GNU project for software application resources internationalization. Developers often overlook the importance of internalization of their app. The signature of the command will be translations:update-po.One thing that sets apart software applications is internalization. ![]() Let's create a command by using the php artisan make:command command, and call it TranslationsUpdatePoCommand for instance. I will also assume you are already using the laravel-gettext package, and you have configured your translations files in its config file. We will be able to use it with PHP's exec function. Once this is done, you have access to xgettext commands. I will not explain it here for every case, if you are using ubuntu server just like me, simply use this command : apt-get install gettext Well, we just have to use exactly the same tool POEdit uses : the xgettext linux command.įor this, you have to install it on your development environment. po files with all of the static texts that are currently written in our project ? */ public function handle () Ģ - Generating and updating. app/Console/Commands/TranslationsParseBladeTemplatesCommand.php You can also update it and put it in the "lang" folder if it makes more sense to you.Įnough talk, here is the file! Just put it in the app/Console/Commands directory and you're good to go :
0 Comments
Leave a Reply. |