Re: Section translations

Section translations

Not applicable

Hello, I'm very glad to see where Shopify is going with the new theme 2.0, however, something still bothers me.

Do we really have to manually add input fields in sections for each language we want to translate and hard code {% if request.locale.iso_code == "fr" %} again?

Everything else is translatable except sections inputs from users in the theme customizer. Am I missing something here?

If you have only two languages, it's maintainable, but if you want a true multilingual store, you would have to hard code a ton of elsif and it quickly becomes a mess.

Replies 11 (11)

jam_chan
Shopify Partner
920 23 188

I guess you can use the section locale and t filter: https://shopify.dev/themes/architecture/sections/section-schema#locales

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
Not applicable

Yep it seems that Shopify sneaked an update to section translations, I’ve been able to translate content since about two three weeks ago.

Meltin-Bit
Shopify Partner
27 0 10

Hi, but in this way the only thing that is translatable are labels, not content. Am I right?

I was looking for a way to translate all the dynamic content filled in the Customize sections. 

Did you manage a way to do it?

Thanks.

Fabio.

Meltin Bit
Not applicable
With the new OS 2.0 there was a sneaky updates and now sections and user input content are available for translation in any apps.
Meltin-Bit
Shopify Partner
27 0 10

Thanks for the quick reply, is there a documentation for that? I can't find anything.

Meltin Bit
Not applicable

Really depends what you are trying to do here, if you are developping an app for translations, I guess you could find something in the admin api documentation.

 

In your theme, you just have to insert a normal section settings and inputs and it will show up in translations app in the sections section with the block or section id as title I believe, that's how it work at least with Translation lab - AI translate on the free plan.

Meltin-Bit
Shopify Partner
27 0 10

Hi, I am trying to translate everything inside the Customize without leaving it. I am not building an App. 

I thought there were the possibility to manage the translations somehow without a third party app but It seems it is still not possible.

Meltin Bit
Not applicable

It would be possible to hardcode values in your theme that way.

Create a settings with an id of value_fr and another with value_en and in your code, check with

if request.locale.iso_code == "fr"

value_fr

else

value_en

endif

 

This is not a good solution however since the inputs are now translatable. I recommend to do this only for your own personnal store if you really don't want to use an app, even then, you could probably do something with metafields instead.

Meltin-Bit
Shopify Partner
27 0 10

Yes you're right It doable in that way but kind of static, i mean if in the future a language must be added all schema sections must be modified, not optimal 🙂 Do you know if the section schema is accessible from Api for some manipulation? It could be a way to add everything dynamically.

Meltin Bit
Geimsdin
Shopify Partner
1 0 5

Shopify and translations, seems to be back in the early 2000 coding world, incredible that they don't manage translations in a smart and adaptable way... it is all about buy apps... sad

John777R
Visitor
3 0 0

Please check for updates, maybe now it will be possible to encode translations in a new way. Currently, I have a double task, I need to first translate malay to english and then code. This Malaysian shop that I am doing takes a lot of nerves and time. But I use some support resources and translation services that make this task much easier