Before you start
- A Fluid API token for the company, from Settings > API Tokens, or your own sign-in with
fluid login. The token needs these permissions:- Languages update, to turn a language on.
- Storefront update, to translate storefront resources.
- Menus update, to translate navigation.
- Themes update, to save theme strings and to use machine translation.
- Agreements update, to translate agreements.
- Categories update, to translate product labels.
- Know the language’s code, such as
frfor French orzh-TWfor Traditional Chinese.fluid translations languageslists every language Fluid supports and its code. - Install and sign in to the CLI:
fluid translations command prints JSON. Failures print a JSON error on stderr and exit with a non-zero code.
Steps
1
Turn on the language
--yes. If the language is already on, the output lists it under alreadyActive and nothing changes. You can turn on several at once, such as fluid translations enable fr de --yes.2
Find what isn't translated
total, missingCount, and a missing list. Every item in the list has an id and its source text in your default language. done is true only when every type is fully translated.Narrow the report with --type, for example --type products --type theme. Add --published-only to skip drafts, scheduled items, and archived items, which shoppers don’t see.3
Machine-translate the gaps
Preview first. Without Then save the translations:
--write, nothing is saved:--write changes live content. Theme strings publish to your storefront as soon as they’re saved. Machine translation uses Fluid AI and counts toward your company’s AI usage.--limit caps how many items of each type one run translates. Each type reports remaining, the number of items still left. Run the command again until remaining is 0 for every type. Machine translation fills text fields only. Set a per-language image or file in the next step.Each item is saved on its own. If the API refuses one, it’s listed under failed with the reason and the rest are saved; it counts toward remaining.4
Review and correct translations
Compare an item’s default text with its translation:Then correct a translation or fill a field by hand:Each
set changes live content. A menu item’s id is <menu id>/<item id>, a theme string’s id is its dotted key, and a theme page string’s id is <template id>/<key>, exactly as the report prints them. For long or HTML values, such as an agreement’s text, put the fields in a JSON file and pass --file. An agreement’s title and text are saved together, so the first translation of an agreement needs both.5
Confirm nothing is left
done is true. If anything is still missing, go back to the machine-translation step for those types, or set them by hand.What gets translated
fluid translations types prints the same list.
Machine translation fills the text fields. Images and files (
image_url, video_url, pdf_url) keep showing the default-language file until you set a translated one.
What the status means
A storefront item counts as translated once it has any translation in the language. If you translate only an item’s title, its other fields show the English text. Check those fields with
show.
What isn’t covered
No command translates these, because Fluid has no API that translates them. Translate them in the admin, or leave them in your default language:- Promotions: their title, description, and terms.
- Enrollment form fields and forms.
- Fluid’s own product labels, “New” and “Trending”. Fluid translates them for you.
- Theme settings written as plain text. A section setting typed straight into the page editor isn’t a translatable string yet. Use the page editor’s translate mode, which turns it into a key in your locale files; from then on,
themeandtheme-sectionscover it.
Troubleshooting
- “isn’t on for this company”. You tried to save to a language that’s off. Turn it on with
fluid translations enable <iso> --yes. - A save returns
422. The language isn’t on for your company, or a field value isn’t valid. The error’sdetailsname the field. - A save returns
403. Your token lacks the permission for that type. See Before you start. A theme page string returns403when its template is a shared or droplet template, which can’t be edited. - Machine translation fails or times out. Fluid AI is busy. Run the command again with a smaller
--limit. Items that were already saved stay saved, and the report shows what’s left. - A theme save says the theme changed after it was read. Someone else saved the theme between the CLI’s read and its write, so the CLI saved nothing rather than overwrite their change. Run the command again.
- Some items are listed under
incomplete. The machine translation came back without one of their fields, even after asking again, so nothing was saved for them. Run the command again, or pass--skip <type>:<id>, such as--skip products:60311, to leave an item out and set it by hand. - A product change you didn’t expect. When you translate a product, any other field sent with the translation also changes the product. The CLI sends only translated fields. If you call the API directly, send only translated fields.
Use the API directly
The CLI wraps these operations, all authenticated with a Bearer token:- Configure company language turns a language on, and List company languages lists them.
- The company list for each storefront resource, such as Company Products index, returns a
languagesarray for every item. It names the languages the item is translated into. - The company update for each resource, such as Update a Product, saves a translation when you pass
lang. Read Translate storefront resources for the rules. - Navigation menu items are translated through the menu API with
lang. See Manage navigation menus. - Theme strings are the theme’s locale files. Updates a theme resource saves
locales/<iso>.json. See Localization for how themes use them. - Theme page strings are a template’s
translations. Updates a theme template saves them, replacing the whole object, so read the template first and merge. - Updates an agreement saves a translation when you pass
language_iso. Retrieves an agreement in a language answers in your default language, and says so in itslanguage_iso, when there is no translation yet. - Update Label saves a label’s title in the language you pass as
lang.
auto command for it.