Made in Builder.io

Ship Your First Personalized Web Experience webinar on June 15 @ 10AM PT. Register Now

Talk to Us
Product
Developers
Talk to Us

Blog

Home

Resources

Blog

Forum

Github

Login

Signup

×

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

growth plans

To use localization with Builder, you must integrate with your codebase so that your app and Builder localization coordinate with one another. This entails:

  1. Passing the locale to the BuilderComponent or RenderContent.
  2. Passing the locale value in the options object when fetching content from the API to get JSON with resolved, localized values.

Though the syntax varies depending on the framework, the concept is the same. Select your framework below for examples.

Tip: Passing the locale to the BuilderComponent or RenderContent emits the locale while previewing or editing so the Visual Editor displays localized values.

For whole-page localization, specify your locale as a targeting attribute when fetching your Builder content from the Content API.

For more fine-grained control, you can localize individual blocks within your content. This approach depends on populating your content's state with your locale:

For example, given a greeting object, with localized values for en-US and fr-Fr, Builder would transform it to Hello or Bonjour depending on the locale:

// orginal object with values for each locale
"greeting": {
  "en-US": "Hello",
  "fr-Fr": "Bonjour"
}

Builder transforms the object to use the value that corresponds to the locale, as follows:

// locale=en-US
"greeting":"Hello"
// locale=fr-Fr
"greeting": "Bonjour"

When your codebase and Builder localization are successfully integrated, you can use any of Builder's localization techniques.


Looking to hire a third party to help with your project?

Submit a project request and our partnerships team will reach out to connect you with an Expert from our partner ecosystem.

Connect with us

Was this article helpful?

Product

Visual CMS

Theme Studio for Shopify

Sign up

Login

Featured Integrations

React

Angular

Next.js

Gatsby

Get In Touch

Chat With Us

Twitter

Linkedin

Careers

© 2020 Builder.io, Inc.

Security

Privacy Policy

Terms of Service

Get the latest from Builder.io

Developer Newsletter

Latest tips, tricks, and news for frontend developers from our blog

Product Newsletter

Latest features and updates on the Builder.io platform

By submitting, you agree to our Privacy Policy

Product

Features

Pricing

What's New

Resources

Documentation

Blog

Community Forum

Templates

Partners

Submit an Idea

Use Cases

Landing Pages

Headless CMS

Headless Storefront

Customer Showcase

Customer Success Stories

Builder.io logo

Visually build and optimize digital experiences on any tech stack. No coding required, and developer approved.

Get Started

Log In

Product

Features

Pricing

Integrations

Use Cases

© 2023 Builder.io, Inc.

Security

Privacy Policy

SaaS Terms