Adding translations to your Locksmith messages
This guide shows you how to use the translation filter built into Liquid to simplify translating your Locksmith messages
Last updated
Was this helpful?
This guide shows you how to use the translation filter built into Liquid to simplify translating your Locksmith messages
Last updated
Was this helpful?
Start by adding something like the following to one of your Locksmith messages. . You can use whatever keys you like, as long as it's prefixed with locksmith:
Make sure to include the quotes. In the app that looks like this:
Saving a lock with any messages that contain the above formatting will trigger a Locksmith update which will automatically edit (all of) the locale files in your theme so that they include a new editable and translatable attribute. This is an example of what that might look like from within the locale files in your theme:
When editing the default theme content, you'll now see a Locksmith tab, with a section that corresponds to what you added to the section above:
If you've added the Translate and Adapt app to your store, you'll see the link to it from within the "Theme content" area. While you can open the app from your apps list, you can also open directly from there:
Once inside the "Translate and Adapt" app, scroll down to find the Theme > "default theme content" area and press on it.
Then, similarly to above, you'll see a Locksmith section that you are free to edit as much as you need.
Do this for all of your store languages.
The messages added with the above method are managed by Locksmith. If you delete the declaration in your messages (the {{ "locksmith.foo.bar" | t }}
part), the corresponding messages will be deleted from (all of) your locale files.
If you want a persistent message, that isn't directly connected to, managed by, or deleted by Locksmith. You'll need to go with a more manual approach. Additionally, there are apps out there that can manage this kind of thing automatically. Again, the difference with this approach to the above, is that Locksmith will not automatically edit your locale files, it will all need to be done on your end.
To start, head into the language "locale" file you'd like to update in your theme, and then add a new entry at the bottom. You might see one "locksmith" entry already - do not add it to that one. Just create a new one. Use whatever label schema works for you (as long as the first label isn't "locksmith"). It can contain the word locksmith in it, just can't be an exact match. For example:
Add this same entry into all desired locales files, and update the "Enter Passcode" to the specific language. Next, in your passcode prompt message, use the translate filter on that variable. Here's an example:
You can immediately open Online Store > Themes > "Edit default theme content" to edit what is shown there for your default language. If you're not sure how to edit the default content in your theme, check out .
You'll need to install the free app from Shopify, or one of the other 3rd party alternatives. .