Localizing theme block extensions

Hi there, I’m wondering how to localize the theme block extension strings that are in the locales folder so that the merchants can change them as needed per locale.

I did notice that Translate & Adapt has app embeds as a category but it’s empty even though I have multiple apps installed, including my own.

Is there an extra step needed from my end to make it appear there?

2 Likes

Hi! :smiley:

Well it depends on how you plan to use those fields :slight_smile:

If your text is dynamic–meaning the user can modify by itself (ex. a text type into settings)

  "target": "section",
  "settings": [
    { 
       "type": "text", 
       "id": "dynamic_text", 
       "info": "Dynamic text changeable by user", 
       "label": "Dynamic Text", 
       "default": "Hello World" 
    }
  ]

In this case, the “Translate & Adapt” app will detect the text, allowing the merchant to add translations.

However, if the texts are static (stored in the locale file and not user-editable), the “Translate & Adapt” app won’t intercept them. :slight_smile:

If you go with the second approach, you might consider building a custom editor within your embedded admin app.

For example, Swish (formerly Wishlist King) implemented an editor in their app settings, allowing users to modify the code, add snippets, and manage multiple languages.

PS: Just to clarify, I’m not sponsored by Swish, nor have I worked with them in any capacity—just using them as a relevant example!

Let me know if you need more details! :rocket:

Thanks for your reply, Andy!

I tried both, and currently, I have a combination of both for different texts for my app, however, nothing appears in translate & adapt, even for other apps (screenshot below).

That is strange :frowning:

On the app i am working right now i can see all the text fields inserted into the settings of the schema into the app theme extension

There is nothing special of it. Is just an embedded app that uses theme extension that has some blocks with text settings for padding and what not :expressionless:

I found this on an old thread on Shopify comunity

@Evonux Have you actually added the app blocks to the theme and defined values for the app block settings you are trying to translate? I don’t believe anything will show up in Translate & Adapt until the app block is actually enabled and has a default setting value.

1 Like

Thanks everyone. Looks like T&A works ONLY for app blocks with the target set to head and body, and not for section which is far from ideal but will do the job for now.

1 Like