The best way to organize a localized translation file

As I started creating the project, there will be many entries in the .po translation file. I use Poedit to create them.

My question is what works best for entries in this file? I thought, instead of referencing entries like:

echo _('This is an entry.');

I thought about their organization, like:

echo _('error_pwd');
echo _('error_user_taken');

That, once skipping a translation file, it will output something like:

Password incorrect. Please try again.
Username is already taken. Please try another.

So, all my transfers can be arranged by type, such as error_, msg_, status_, tip_etc.

Has anyone seen how this is done, or any suggestions for a more organized method?

+4
source share
2 answers

!

.

. . , msgid. django, ..

, - , :

PHP

(textdomain()) , gettext(), .

, , msgid ou word ( ) , , .

:

+1

, . Symfony/Laravel:

trans('error.validation');

, , "error.validation"

+1

All Articles