khanareeb's avatar

What is the best approach to achieve the Localisation to the Multi vendor Ecommerce? (mcamara package / Without mcamara package )

So I am working on the localisation to my multi-vendor ecommerce platform. So I found the package https://github.com/mcamara/laravel-localization

I just need to implement 2 languages which is english & arabic. My question is that, Is this package helpful ? Does using this package is a good approach ? Or to manually do the localisation code like people does something like

https://www.larashout.com/how-to-create-multilingual-website-using-laravel-localization https://iwconnect.com/creating-a-multilingual-website-using-laravel-localization/

Using the uncessary packages to the websites may contains malware sometimes. So thought to ask here from the experts here .

What will the best approach to achieve this localisation tasks ?

Also the code snippet examples are appreciates if someone suggested the manual approach.. Thanks!

#HappyCoding

0 likes
10 replies
tangtang's avatar

@khanareeb build an Ecommerce site it's more wise if developer just use some their trusted plugin/package source, and what is trusted source look like. in my opinion it always update to the target frame work. and of course the developer still manually check and test the plugin/package before make it to production.

is this mcamara/laravel-localization helpfull ? YES

but does using this package is a good approach ? well depend on what application needed. (what this mean) if developer have no time to do a manual lang just use this plugin/package.

but if developer have more time, recomend it to do manual way for multilingual website.

and if this Ecommerce just English and Arabic, do it with manual way. let the Ecommerce application rush in the flow of data, validation, UI, UX, role for user, transction handling and other process. don't make it more complex for developer with translating plugin/package.

but of course it's just my opinion. there always another way to do the thing. 😁

for snippets, the two link is already do a full tutorial for how to do the manual lang in laravel. I guarante it will work, I have use same way for multilingual website with framework laravel before.

hope this help.

khanareeb's avatar

@tangtang Thank you for the information provided. I know the two URL approaches can do this tasks but looks like if we have a suitable plugin that works on the same thing and not have the vulnerabilities, then i thought I can achieve it with that and save the time and work on the other functional flows.

So thought to ask if someone has a bad experience with mcamara/laravel-localization plugin.

The website is multi vendor and contains alot of data to switch to arabic. So thought to save time

khanareeb's avatar

@martinbean Hello, I am working on the laravel 9. I just finished the website and the client demands to add the localisation for the Arabic as well..

The website has alot of data to switch on the arabic language.. I found this plugin that is a bit convenient i found.. I though to with experts here if they found this plugin vulnerable ever OR good.

My goal is to add the localisation and the regions will be 2 only. English & Arabic. I was confused what the appraoch should i used to achieve this task. .

A manual one OR the plugin one..

martinbean's avatar

I just finished the website and the client demands to add the localisation for the Arabic as well..

@khanareeb OK? So, as long as you have been wrapping your text strings in the helper:

<p>{{ __('I am English text') }}</p>

Then now what you need to do is create a file at lang/ar.json and add the Arabic translations for your text strings.

This really isn’t something you need a package for as again, Laravel offers localization out of the box.

2 likes
khanareeb's avatar

@martinbean Read somewhere on the internet that doing in that way is sometimes not suitable when it comes to SEO. Due to some sort of URL problem. I dont know how much that thing is true.

So thought to ask .. If manual work does increases the development when a single package can do the same thing

khanareeb's avatar

@martinbean @tangtang This is a last question. What if we have the dynamic content. For example if we have the product description. How can we change that description in Arabic because that is dynamic.

Do we have to create the another field to add the arabic description and then set the logic as per the locale?

OR

Do we have another way like lang for dynamic content ?

tangtang's avatar

@khanareeb In my opinion is yes we have to create the another field to add the arabic description and then set the logic as per the locale why I say that ?

a fully automated translation process without manual intervention, may the quality of automated translations not be as high as human translations, and it may not handle complex or context-specific translations well.

but of course the manual translation will take time too. so you can try all option like as @snapey recomend package or this package too stichoza/laravel-translatable. then find what the most suitable for you.

Snapey's avatar

dont forget you will probably also need yo change to rtl format

Please or to participate in this conversation.