Closed amiraghyan99 closed 3 years ago
I don't know which parameters use for product in msgid maybe for that I can't change this text
If you use Laravel, use
'i18n' => [
'en' => [
'mshop' => [
'Item with ID \"%2$s\" in \"%1$s\" not found' => ['You will need to upgrade the application to view this product \"%2$s\" in \"%1$s\"']
]
]
]
The translation domain is "mshop", see also: https://aimeos.org/docs/latest/laravel/customize/#overwrite-translations
I tired this way too, but don't help me and I use other domains too , again some yes I am using Laravel
Did you try to remove the backslashes ()?
yes
not help again
throw new \Aimeos\MShop\Exception( sprintf( 'Item with ID "%2$s" in "%1$s" not found', $key, $id ) );
this is my en.po
msgid "Item with ID \"%2$s\" in \"%1$s\" not found"
msgstr "You will need to upgrade the application to view this product"
and my shop.php
'i18n' => [
'en' => [
'mshop' => [
'Item with ID "%2$s" in "%1$s" not found' => ['You will need to upgrade the application to view this product']
],
]
],
I run msgfmt --statistics -c -o en en.po command and clear all cache
when I change sprintf( 'Item with ID "%2$s" in "%1$s" not found', $key, $id ) this text from Base.php and translate in en.po it work but we can't change Base.php file because it in vendor folder
throw new \Aimeos\MShop\Exception( sprintf( 'example', $key, $id ) );
msgid "example"
msgstr "123456"
{
"meta": {
"total": 0,
"prefix": null,
"content-baseurl": "example.loc"
, "csrf": {
"name": "_token",
"value": "HirneBi5h6Eo4DOVysVRUhFezOOcLYlrLiarchpQ"
}
},
"links": {
"self": "https://example.loc/syaanh/jsonapi/product?id=1&page%5Boffset%5D=0"
}
,"errors": [{"title":"123456"}]
}
issue in "%2$s" and "%1$s" because it is dynamic value when I use for ID 1 value and for key product.id values it work
Guess it's either the %
or $
character that makes problems during translation lookup. Maybe you have to escape one or both by \
@aimeos
could you change this text to your demo version and share with us if it is work, I tried many options but didn't work
It didn't work because the values have been replaced in the string before it was translated. We've changed that now so it works if you install:
composer req aimeos/aimeos-core:2021.07.x-dev
Hi
could you help me for this issue
I need to change "Item with ID \"44\" in \"product.id\" not found" text to Product not found. for this api https://example.loc/test/jsonapi/product?id=44
but I can't find it from where coming this text I tired add this translation in my ext/example/lib/custom/i18n/en.po file and run gettext command but was not changed
and for others translations working good