OFFLINE-GmbH / oc-snipcartshop-plugin

Ecommerce solution for October CMS using snipcart.com as a backend
MIT License
11 stars 4 forks source link

Translated messages #25

Closed alxy closed 6 years ago

alxy commented 6 years ago

Hi,

I like that this plugin is fully localized, however I am having a bit of an issue with the component flash messages: https://github.com/OFFLINE-GmbH/oc-snipcartshop-plugin/blob/develop/components/Product.php#L94 They appear to take the settings from the backend or the application language, but do not change if I use the RainLab.translate plugin. Is this the intended behavior? Or how can I translate these messages best?

tobias-kuendig commented 6 years ago

Do you need additional languages or do you want to change the wording?

If you want to add additional languages you can create a PR for the plugin.

I see that this isn't ideal behaviour. I guess since the translation is displayed in the frontend we should take the string from RainLab.Translate rather than the default backend messages.

alxy commented 6 years ago

No, german and english works perfectly well for me, but the thing is if I use the demo theme, there is a german and an english version available. However, the translation will not change according to the language set in the frontend for me. I am not sure if this is a bug, or if I am setting something up completely wrong.

tobias-kuendig commented 6 years ago

Can you try and patch the Product.php component with something like

Flash::success(\Lang::get('snipcart.product.added_to_cart'));

and see if you are now able to translate the string via RainLab.Translate. I guess this would be the better implementation.

I don't have a oc-snipcartshop-plugin installation at hand that's why I cannot debug the problem myself at the moment.

Thanks!

tobias-kuendig commented 6 years ago

Closed due to inactivity.