translations - adding translations for attributes

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
khizar
Posts: 99
Joined: 19 Jan 2021, 09:51

translations - adding translations for attributes

Post by khizar » 17 Apr 2021, 06:15

Hey aimeos,
i have integrated aimeos with laravel.
versions:
"aimeos/aimeos-laravel": "~2020.10",
"laravel/framework": "^8.12",

i have added missing translations but now i have another problem.My problem is that when i make a new site using command php artisan aimeos:setup <mysite> a site is created with the default attributes
Image
Now i want those attributes to be translated when i change the language on the site.i know that it can be done by
either adding translations to .po files or in the config file.
I mean do i have to add new keys(attribute code) with the translation and in which extension should i do that.
please guide me

khizar
Posts: 99
Joined: 19 Jan 2021, 09:51

Re: translations - adding translations for attributes

Post by khizar » 17 Apr 2021, 06:21

and also please note that for now i can't update my project because it will break applications because there are breaking changes in the code so i have to do it in the current version which i have mentioned

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

Re: translations - adding translations for attributes

Post by aimeos » 19 Apr 2021, 07:06

You can translate the attribute types using .po/MO files or within the configuration. Their translation domain is "client/code", e.g.:

Code: Select all

'i18n' => [
	'ar' => [
		'client/code' => [
			'size' => ['...'],
		]
	]
]
https://github.com/aimeos/ai-client-htm ... rd.php#L95
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

khizar
Posts: 99
Joined: 19 Jan 2021, 09:51

Re: translations - adding translations for attributes

Post by khizar » 19 Apr 2021, 07:18

aimeos wrote: 19 Apr 2021, 07:06 You can translate the attribute types using .po/MO files or within the configuration. Their translation domain is "client/code", e.g.:

Code: Select all

'i18n' => [
	'ar' => [
		'client/code' => [
			'size' => ['...'],
		]
	]
]
https://github.com/aimeos/ai-client-htm ... rd.php#L95
i have tried that but it is not working

Code: Select all

'i18n' => [
		'ar' => [
			'client' => [
				'Name' => ['اسم المسؤول'],
				'Mobile' => ['جوال المسؤول'],
				'City & Address' => ['المدينه والعنوان'],
				'Buisness Category' => ['مجال  النشاط'],
				'Store Name' => ['اسم المتجر'],
				'Commercial Registration' => ['رقم السجل التجاري'],
				'I agree to' => ['قبول الاتفاقيه'],
				'Proceed' => ['تقدم'],
				'Enter OTP' => ['OTP أدخل'],
				'Please enter OTP sent on your mobile no!' => ['الرجاء إدخال OTP المرسل على رقم هاتفك المحمول'],
				'Send Registration Request' => ['إرسال طلب التسجيل'],
				'Email has been sent successfully you will be contacted shortly.' => ['تم استلام طلبكم بنجاح سيتواصل معكم فريقنا في اقرب وقت'],
				'OTP entered is invalid' => ['الذي تم إدخاله غير صالح OTP'],
				'Delivery' => ['التوصيل'],
				'Min Order' => ['اقل طلب'],
				'Delivery Time' => ['المدة'],
				'download' => ['المدة'],
				
				
			],
			'client/code' => [
				'hyperpay.paymentbrand' => ['Payment Brand'],
				'hyperpay.paymentbrand:MADA' => ['MADA'],
				'hyperpay.paymentbrand:VISA' => ['VISA'],
				'hyperpay.paymentbrand:MASTER' => ['MASTER'],
				'size' => ['المدة'],
			]
		],
		'en' => [
			'client/code' => [
				'hyperpay.paymentbrand' => ['Payment Brand'],
				'hyperpay.paymentbrand:MADA' => ['MADA'],
				'hyperpay.paymentbrand:VISA' => ['VISA'],
				'hyperpay.paymentbrand:MASTER' => ['MASTER'],

			]
		],
		// 'ar' => [
		// 	'client/code' => [
		// 		'hyperpay.paymentbrand' => ['Payment Brand'],
		// 		'hyperpay.paymentbrand:MADA' => ['MADA'],
		// 		'hyperpay.paymentbrand:VISA' => ['VISA'],
		// 		'hyperpay.paymentbrand:MASTER' => ['MASTER'],
		// 		'size' => ['المدة'],
		// 	]
		// ]
	],

mahmoud
Posts: 27
Joined: 27 Mar 2020, 22:01

Re: translations - adding translations for attributes

Post by mahmoud » 19 Apr 2021, 23:12

Hi,
You can do that in the file :
config\shop.php
Like this

Code: Select all

'i18n' => [
    'ar' => [
        'client' => [
            'Categories' => ['التصنيفات'],
            '▼ Price' => ['▼ الثمن'],
            '▼ Price' => ['▼ الثمن'],    
            '▼ Name' => ['▼ الإسم'],            
            '▲ Name' => ['▲ الإسم'],
            'Latest' => [' الأحدث '],
            'Your search result' => [' نتيجة البحث '],
             
        ],
    ],
	
],

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

Re: translations - adding translations for attributes

Post by aimeos » 20 Apr 2021, 10:31

At least translation for the "size" attribute code should work in your example.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

khizar
Posts: 99
Joined: 19 Jan 2021, 09:51

Re: translations - adding translations for attributes

Post by khizar » 21 Apr 2021, 06:17

aimeos wrote: 20 Apr 2021, 10:31 At least translation for the "size" attribute code should work in your example.
Hi aimeos, can you provide me the list of all attributes which are added by making site through command so i can translate it all and then i will also provide you the translation but first i need all the attributes which are added

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

Re: translations - adding translations for attributes

Post by aimeos » 21 Apr 2021, 06:24

Which attributes you need/use is dependent on your installation resp. the products you are selling. There are no standard attributes besides the one created by the demo but they are irrelevant for translation. Much more important is that the backend and frontend is fully translated and you can see the resources and their strings here:
https://www.transifex.com/aimeos/aimeos-core/content/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

khizar
Posts: 99
Joined: 19 Jan 2021, 09:51

Re: translations - adding translations for attributes

Post by khizar » 21 Apr 2021, 06:30

aimeos wrote: 21 Apr 2021, 06:24 Which attributes you need/use is dependent on your installation resp. the products you are selling. There are no standard attributes besides the one created by the demo but they are irrelevant for translation. Much more important is that the backend and frontend is fully translated and you can see the resources and their strings here:
https://www.transifex.com/aimeos/aimeos-core/content/
ok.tell me one thing i am bit confused at that .if change the language in the admin panel the list of attribute types(picture i have posted above) will be translated or only the translation will be on the client side i mean on the checkout pages

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

Re: translations - adding translations for attributes

Post by aimeos » 21 Apr 2021, 06:39

Client side only but you can change the Label of these attributes to Arabic in the backend yourself.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply