How to work with Language files, .po files and overriding

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
pbgswd
Posts: 2
Joined: 12 Feb 2016, 06:13
Location: Vancouver BC Canada
Contact:

How to work with Language files, .po files and overriding

Post by pbgswd » 20 Apr 2016, 21:50

Hi we are working with Aimeos for Laravel and we are doing all we can to understand the software. I havent worked with .po files before and it appears there is a source and compiled version of the file. I dont know what package is used to publish these files. Can anybody tell me?
But I did ask an aimeos developer directly before posting here, and the answer was:
You don't need to. If you want to replace only some strings, you can
overwrite them via the configuration file.
Ok well that is ok, but where is this configuration file?

dev@ubuntu-dev:~/ilar/vendor/aimeos/aimeos-core$ find -type f -name "en.po"
./lib/mshoplib/i18n/en.po
./lib/mshoplib/i18n/code/en.po
./controller/frontend/i18n/en.po
./controller/jobs/i18n/en.po
./client/i18n/country/en.po
./client/i18n/currency/en.po
./client/i18n/en.po
./client/i18n/code/en.po
./client/i18n/language/en.po
./admin/i18n/ext/en.po
./admin/i18n/en.po

............. not what I am looking for, so instead:

vendor/aimeos/aimeos-core$ ls config/
resource.php-dist
Is resource.php-dist the configuration file?
There arent any language references in this file......

Where is the config file I need to find to override entries in .po files?

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

Re: How to work with Language files, .po files and overridin

Post by aimeos » 20 Apr 2016, 21:58

Here you can find the documentation of how to overwrite translations in Laravel:
https://aimeos.org/docs/Laravel/Overwrite_translations
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

pbgswd
Posts: 2
Joined: 12 Feb 2016, 06:13
Location: Vancouver BC Canada
Contact:

Re: How to work with Language files, .po files and overridin

Post by pbgswd » 21 Apr 2016, 22:41

We tried the simplest option, where we added the customization to the shop.php file

Code: Select all

   'i18n' => array(
       'en>' => array(
           'client/code' => array(
               'package-weight' => array('Weight'),
           ),
       ),
   ),
... and it did nothing

in the property template:

echo $enc->html( $this->translate( 'client/code', $propertyItem->getType() ), $enc::TRUST );

Is there some reason why it did nothing? What needs to be done here?

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

Re: How to work with Language files, .po files and overridin

Post by aimeos » 21 Apr 2016, 23:41

pbgswd wrote:

Code: Select all

   'i18n' => array(
       'en>' => array(
           'client/code' => array(
               'package-weight' => array('Weight'),
           ),
       ),
   ),
Your config is wrong: 'en>' (mind the ">" char that shouldn't be there).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply