Translation of mshoplib

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Translation of mshoplib

Post by cnoelker » 12 Aug 2019, 11:56

Hello,
I am able to provide my own translations for strings in the client domain. However, I did not yet find a way to translate the strings in the files in this directory:
Libraries/aimeos/aimeos-core/lib/mshoplib/i18n/

I tried to create en.po and de.po files (and started msgfmt) in
Resources/Private/Extensions/[my extension]/client/i18n/mshop
and also in
Resources/Private/Extensions/[my extension]/client/i18n
Resources/Private/Extensions/[my extension]/lib/mshop

None of these worked. Where is the proper location?

I also tried to provide the translation via typoscript:
plugin.tx_aimeos.settings.i18n.de.0 {
domain = mshop
string = Products out of stock
trans = Das Produkt ist nicht mehr in ausreichender Zahl auf Lager.
}

Still no luck. (Tried with domain mshoplib, too.)

How can I translate the content of mshoplib ?
Claudia

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

Re: Translation of mshoplib

Post by aimeos » 12 Aug 2019, 20:12

The string you want to translate is used here in the code:
https://github.com/aimeos/aimeos-core/b ... ck.php#L69

For .po files (and the files without extension created by msgfmt) the correct location in your own extension is:

Code: Select all

Resources/Private/Extensions/[my extension]/lib/custom/i18n/
You translation for the string via TypoScript is correct:

Code: Select all

plugin.tx_aimeos.settings.i18n.de.0 {
    domain = mshop
    string = Products out of stock
    trans = Das Produkt ist nicht mehr in ausreichender Zahl auf Lager.
}
Only make sure that you don't overwrite that translation afterwards by another one (check in TypoScript Object Browser if the translation is still there).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Translation of mshoplib

Post by cnoelker » 13 Aug 2019, 07:41

Thank you. It works now for translating "Products out of stock", but not for "product.stock.notenough". Both are in the same file:

Translation in en.po
msgid "Products out of stock"
msgstr "Some products are out of stock in the requested quantity."

msgid "product.stock.notenough"
msgstr "Quantity was reduced to max. available quantity."

Translation in de.po
msgid "Products out of stock"
msgstr "Produkt nicht mehr in ausreichender Anzahl auf Lager."

msgid "product.stock.notenough"
msgstr "Menge wurde auf max. verfügbare Menge reduziert."

Any clue for this?

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

Re: Translation of mshoplib

Post by aimeos » 13 Aug 2019, 09:59

The translation domain for the plugin codes is "mshop/code":
https://github.com/aimeos/ai-client-htm ... #L701-L716
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Translation of mshoplib

Post by cnoelker » 13 Aug 2019, 10:23

Why doesn't this work then?

plugin.tx_aimeos.settings.i18n.de.0 {
domain = mshop/code
string = product.stock.notenough
trans = Menge wurde auf max. verfügbare Menge reduziert.
}
plugin.tx_aimeos.settings.i18n.en.0 {
domain = mshop/code
string = product.stock.notenough
trans = Quantity was reduced to max. available quantity.
}

I checked in the TypoScript object browser: These settings are available.

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

Re: Translation of mshoplib

Post by aimeos » 14 Aug 2019, 07:50

What doesn't work? Your TypoScript code doesn't change the translation of the string that belongs to the code
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Translation of mshoplib

Post by cnoelker » 14 Aug 2019, 07:53

The translation does not work. I tried in the .po files and in TypoScript, but nothing works out.

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

Re: Translation of mshoplib

Post by aimeos » 14 Aug 2019, 07:54

You mean "product.stock.notenough" isn't translated at all?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Translation of mshoplib

Post by cnoelker » 14 Aug 2019, 08:29

The translation is the standard provided by aimeos. However, I would like to change the standard translation. And although I tried different ways, I did not succeed.

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

Re: Translation of mshoplib

Post by aimeos » 14 Aug 2019, 08:32

So this doesn't change the translation of the error message at all?

Code: Select all

plugin.tx_aimeos.settings.i18n.de.1000 {
    domain = mshop/code
    string = product.stock.notenough
    trans = Menge reduziert
}
plugin.tx_aimeos.settings.i18n.en.1000 {
    domain = mshop/code
    string = product.stock.notenough
    trans = Quantity reduced
}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply