8/21 demo: Building component libraries from Figma with AI

Announcing Visual Copilot - Figma to production in half the time

Builder.io
Builder.io
Contact sales

8/21 demo: Building component libraries from Figma with AI

Announcing Visual Copilot - Figma to production in half the time

Builder logo
builder.io

Pro plans

publish

To localize content with Builder, integrate localization into the codebase to keep the app and Builder content in sync. You can choose one of two approaches:

  • Inline localization
  • Content entry localization

Integrating localization with Builder Data models is the same as with Page or Section models except that you don't render anything in your code for a Data model. This means that for integrating a Data model, you don't need BuilderComponent for Gen 1 or Content for Gen 2 SDKs.

For more detail on setting up localization in the Builder Data model UI, visit Localizing Data Models.

For example, given a greeting object with localized values for en-US and fr-Fr, Builder transforms 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"

Ideally, you want your app to dynamically adjust to the user's locale.

You can automatically determine the user’s locale based on their system settings by using the Intl.DateTimeFormat() locale and passing it into the locale option:

const res = await fetchOneEntry({
  model: 'page',
  apiKey: /* YOUR PUBLIC API KEY */,
  locale: new Intl.DateTimeFormat().resolvedOptions().locale
  userAttributes: {
    urlPath: window.location.pathname,
  },
});

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

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

By submitting, you agree to our Privacy Policy

  • Fusion

  • Publish

  • Product Updates

  • Figma to Code Guide

  • Headless CMS Guide

  • Headless Commerce Guide

  • Composable DXP Guide

Security

Privacy Policy

SaaS Terms

Compliance

Cookie Preferences

Gartner Cool Vendor 2024