Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add quick writeup on configuring language-specific builds in Bolt #1267

Merged
merged 2 commits into from
Aug 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Internationalization
---

## Optimizing Bolt's Build For Different Languages

> NOTE: add note about compiling Bolt for just one specific language at a time vs compiling for multiple languages


### Step 1. Add a `lang` prop to your `.boltrc` config

This should be an array of the two-character language codes you want to compile optimized builds for.

> Note: currently this only includes `en` and `ja` althouh more language-specific builds could be added in the future.

#### Only Compile Japanese-optimized Build
```
lang: ['ja'], // ex. only compile the ja-optimized build
```

#### Compile Japanese and English optimized Builds (Japanese set as the default)
```
lang: ['ja', 'en'], // ja + en in the same build; ja used by default on docs site
```

#### Compile Japanese and English optimized Builds (English set as the default)
```
lang: ['en', 'ja'], // en + ja in the same build; en used by default on docs site
```

#### Only Compile Japanese Optimized Build (Deprecated String Lang Method)
```
lang: 'ja', // only ja (old to-be-removed single-lang build)
```

> Note: not defining a lang prop will automatically configure the build to internally use the `en` default


### Step 2. Disable the `@bolt/build-tools` cache

This will get updated in the future but for now, you'll likely need to manually disable the build tools cache for a clean initial build

```
// switch `enableCache` in the `.boltrc` to false
enableCache: false,
```

### Step 3. Enably i18n (If Doing Local Development)

If you are running Bolt locally in dev mode, make sure the `i18n` CLI flag is set to true.

This can be done by either by running `npm run start:lang` in the docs site folder for local Bolt development OR `./node_modules/.bin/bolt start --i18n` for everyone else.