Admin template cannot accept the translation from the i18n file

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Admin template cannot accept the translation from the i18n file

Post by ahmed31916 » 06 Nov 2022, 08:32

Hello Aimeos,

I used to translate texts like this : "$this->translate( 'client', 'Text' )" in the client templates folder, of the extension.

Now, I'm trying to edit the translations in the subpart: "packages\test\templates\admin\jqadm\product\item.php", in the admin template, of the extension. I wrote "$this->translate( 'client', 'Text' )", but it cannot accept the translation from the file "packages\test\i18n\en.po". Why?

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Admin template cannot accept the translation from the i18n file

Post by aimeos » 06 Nov 2022, 19:42

The translation domain is "admin", not "client" in the admin backend.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: Admin template cannot accept the translation from the i18n file

Post by ahmed31916 » 06 Nov 2022, 19:51

Ok, also "admin" doesn't work.

In another hand, if I used "admin", where I should to store "en.po" file extended?

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Admin template cannot accept the translation from the i18n file

Post by aimeos » 08 Nov 2022, 18:36

ahmed31916 wrote: 06 Nov 2022, 19:51 In another hand, if I used "admin", where I should to store "en.po" file extended?
In the ./i18n/ directory of your extension. Please remember that you have to use msgfmt command to create a binary MO file from your .php file:
https://aimeos.org/docs/latest/developer/translations/

The easiest way is to add translations to your ./config/shop.php:
https://aimeos.org/docs/latest/laravel/ ... anslations
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply