From 6d768b9ae999c8f54a24778f31810a5ad80c6b12 Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Sat, 7 Nov 2020 10:58:17 -0300 Subject: [PATCH] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20add=20mention=20to?= =?UTF-8?q?=20i18n-ally?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + docs/Getting Started.md | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e9e7972..f180548 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,4 @@ - [Documentation](/docs/Getting%20Started.md) - [Sapper Template](https://github.com/kaisermann/sapper-template-i18n) +- [i18n VSCode extension (3rd party)](https://github.com/antfu/i18n-ally) diff --git a/docs/Getting Started.md b/docs/Getting Started.md index b0ff125..9d55521 100644 --- a/docs/Getting Started.md +++ b/docs/Getting Started.md @@ -5,12 +5,13 @@ - [1. Installing](#1-installing) + - [1.1 VSCode extension](#11-vscode-extension) - [2. Locale dictionaries](#2-locale-dictionaries) - [3. Adding locale dictionaries](#3-adding-locale-dictionaries) - [3.1 Synchronous](#31-synchronous) - [3.2 Asynchronous](#32-asynchronous) - [4. Initializing](#4-initializing) -- [4. Localizing your app](#4-localizing-your-app) +- [5. Localizing your app](#5-localizing-your-app) @@ -25,6 +26,10 @@ yarn add svelte-i18n yarn add -D @rollup/plugin-json ``` +##### 1.1 VSCode extension + +If you're using `VSCode` and want to have your messages previewed alongside your components, checkout the [i18n-ally](https://github.com/antfu/i18n-ally) and their [FAQ](https://github.com/antfu/i18n-ally/wiki/FAQ) to see how to set it up. + #### 2. Locale dictionaries A locale dictionary is a regular JSON object which contains message definitions for a certain language. @@ -125,7 +130,7 @@ In **Sapper**, you can use the `preload` static method together with `waitLocale Please note that the `fallbackLocale` is always loaded, independent of the current locale, since only some messages can be missing. -#### 4. Localizing your app +#### 5. Localizing your app After having the initial locale set, you're ready to start localizing your app. Import the [`$format`](/docs/Formatting.md) method, or any of its aliases, to any component that needs to be translated. Then, just call [`$format`](/docs/Formatting.md) passing the message `id` on your layout and voila! 🎉