Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#3780 by mvnaz
06 Jan 2017, 21:59
Hello everybody, from Ukraine! Firstly I want to say thank to aimeos developers for this nice package. I really like it. Well, I have a problem: I want to translate aimeos, but I can't do it. As I understand aimeos use online translation. But I want to you use .po files and translate it. I see .po files in project/ext/ai-admin-jqadm/admin/i18n. So I want to translate, for example, admin panel.
I add to ru.po file this:

msgid "Latest orders"
msgstr "my text"

But it not working. I saw the same topics on this site, but I not found answer for my question.
I hope for yours help very much.
Great thank!
#3783 by mvnaz
07 Jan 2017, 07:52
Dear Users!) I understand how it work:

'i18n' => array(
'en' => array(
'admin' => array(
'Latest orders' => array('my text'),

and it really work! But I think it is bad way to translate all aimeos package. I want it. I need translate using .po files. I think it will be more comfortable. I can't understand why aimeos do not use .po files and why this files exits consequently)
#3784 by aimeos
07 Jan 2017, 13:17
Here are the options you have:
- To contribute to the official translation, you have to use Transifex
- To overwrite a few strings locally, you can use the configuration as you've mentioned
- If you want to replace more strings with your own translations and your translations are specific to your project, create your own po/mo files

The steps for the last options are:
- Create an extension for your project
- Copy the existing .po file (ru.po) to the same directory structure as in the core extensions
- Change the translations you want to replace
- Remove the strings/translations that should stay the same
- Execute in the directory of the .po file: "msgfmt --statistics -c -o ru ru.po"

This creates the binary mo file (ru) which is used when translations for Russian are requested. If no translation in this available, the translation from the core mo file is used.
#3785 by mvnaz
07 Jan 2017, 13:54
aimeos, thank you very much! Excuse me, I want to clarify something.
1. Where I can get documentation how create aimeos extension for translating ?
2. You say that I must to Copy the existing .po file (ru.po) to the same directory structure as in the core extensions. But in folder myproject/ext/ I see many derictories which contein .po files.

So tell me please how extension structure must be look, and how I must say to aimeos to use this .po files in my extension.

I execute "php msgfmt --statistics -c -o ru ru.po" in myproject\vendor\aimeos\aimeos-core\ext\aomeos-ru-translater\admin\i18n and I see Could not open input file: msgfmt - I create and download archive, help me please, where I have to unzip this, and what I must to do after this

Thank you! You are really help me.
#3786 by aimeos
07 Jan 2017, 15:06
This article should answer your questions:

Copy the existing ru.po file to the same directory in your own extension, e.g. from "./ext/ai-client-html/client/i18n/ru.po" to "./ext/myextname/client/i18n/ru.po".

"msgfmt" is a Unix CLI command. To use it in a Windows environment, you have to install Cygwin and its gettext package first.
#3787 by mvnaz
07 Jan 2017, 15:42
aimeos, I yet have some problems. I install Cygwin, but in windows cmd console I see Could not open input file: msgfmt, and in Cygwin console I see "Could not open input file: msgfmt" too. Where I must execute this comand ? In windows cmd or in Cygwin console ? And why it did't work ? I also installed gettext package