Skip to content

Commit 6efaafc

Browse files
authored
docs: Add docs for VSCode integration (#484) [skip ci]
1 parent d2e347e commit 6efaafc

File tree

11 files changed

+78
-10
lines changed

11 files changed

+78
-10
lines changed

docs/next.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ module.exports = withNextra({
6565
},
6666
{
6767
source: '/docs/usage/typescript',
68-
destination: '/docs/typescript',
68+
destination: '/docs/workflows/typescript',
69+
permanent: true
70+
},
71+
{
72+
source: '/docs/typescript',
73+
destination: '/docs/workflows/typescript',
6974
permanent: true
7075
},
7176
{
@@ -93,6 +98,11 @@ module.exports = withNextra({
9398
destination: '/docs/environments/core-library',
9499
permanent: true
95100
},
101+
{
102+
source: '/docs/localization-management',
103+
destination: '/docs/workflows/localization-management',
104+
permanent: true
105+
},
96106
{
97107
source: '/examples/next-13',
98108
destination: '/examples/app-router',

docs/pages/docs/_meta.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"environments": "Environments",
55
"configuration": "Global configuration",
66
"routing": "Routing",
7-
"typescript": "TypeScript",
7+
"workflows": "Workflows & integrations",
88
"production-checklist": "Production checklist",
9-
"faq": "FAQ",
10-
"localization-management": "Localization management with Crowdin"
9+
"faq": "FAQ"
1110
}

docs/pages/docs/configuration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default getRequestConfig(async ({locale}) => ({
119119
</Tab>
120120
</VersionTabs>
121121

122-
Colocating your messages with app code is beneficial because it allows developers to make changes to messages quickly. Additionally, you can [use the shape of your local messages for type checking](/docs/typescript).
122+
Colocating your messages with app code is beneficial because it allows developers to make changes to messages quickly. Additionally, you can [use the shape of your local messages for type checking](/docs/workflows/typescript).
123123

124124
Translators can also collaborate on messages by using CI tools, such as <PartnerContentLink name="localization-management-intro" href="https://store.crowdin.com/github">Crowdin's GitHub integration</PartnerContentLink>, which allows changes to be synchronized directly into your code repository.
125125

docs/pages/docs/faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Generally, it's recommended to [handle internationalization in Server Components
1515
3. This library is built around the concept of namespaces and that components consume a single namespace—however this is not required.
1616
4. This library currently doesn't support AST-based extraction like `react-intl`. Note that building ASTs for messages upfront can help with runtime performance, but in exchange your bundle size might grow.
1717
5. This library is a bit smaller in size ([next-intl](https://bundlephobia.com/result?p=next-intl) vs [react-intl](https://bundlephobia.com/result?p=react-intl) on BundlePhobia).
18-
6. This library offers [type safety for message keys](/docs/typescript).
18+
6. This library offers [type safety for message keys](/docs/workflows/typescript).
1919

2020
## Can `next-intl` be used with Jest and Storybook?
2121

docs/pages/docs/production-checklist.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Callout from 'components/Callout';
44

55
While the [installation instructions](/docs/getting-started) are sufficient to use `next-intl` in your Next.js app, this checklist helps you ensure you're all set for production:
66

7-
1. If you're using TypeScript, you can take advantage of autocompletion and type safety for message keys by [setting up a type for your messages](/docs/typescript).
7+
1. If you're using TypeScript, you can take advantage of autocompletion and type safety for message keys by [setting up a type for your messages](/docs/workflows/typescript).
88
2. If you're formatting dates and times, a [time zone should be configured](/docs/configuration#time-zone). By default, dates are formatted according to the time zone of the environment, which can lead to markup mismatches if the server and the user are located in different time zones. By supplying the `timeZone` explicitly, you can ensure that dates and times are rendered the same way on the server as well as the client.
99
3. If you're formatting relative dates and times, a [global value for `now`](/docs/configuration#global-now-value) can be useful. This ensures that the server and client will render the same markup. Especially if you use caching for the responses of the server, the likelyhood of mismatches increases.
1010
4. To achieve consistent date, time and number formatting, it might be useful to set up [global formats](/docs/configuration#global-formats) which ensure consistent formatting across the app.

docs/pages/docs/workflows/_meta.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"index": "Start",
3+
"typescript": "TypeScript",
4+
"localization-management": "Localization management with Crowdin",
5+
"vscode-integration": "VSCode integration"
6+
}

docs/pages/docs/workflows/index.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {
2+
CheckCircleIcon,
3+
GlobeAltIcon,
4+
CodeBracketIcon
5+
} from '@heroicons/react/24/outline';
6+
import {Card} from 'nextra-theme-docs';
7+
8+
# Workflows & integrations
9+
10+
To get the most out of `next-intl`, you can choose from these integrations to improve your workflow when developing and collaborating with translators.
11+
12+
<div className="mt-8 flex flex-col gap-4 md:w-1/2">
13+
<Card
14+
arrow
15+
icon={<CheckCircleIcon />}
16+
title="TypeScript integration"
17+
href="/docs/workflows/typescript"
18+
/>
19+
<Card
20+
icon={<GlobeAltIcon />}
21+
arrow
22+
title="Localization management with Crowdin"
23+
href="/docs/workflows/localization-management"
24+
/>
25+
<Card
26+
icon={<CodeBracketIcon />}
27+
arrow
28+
title="VSCode integration"
29+
href="/docs/workflows/vscode-integration"
30+
/>
31+
</div>

docs/pages/docs/localization-management.mdx renamed to docs/pages/docs/workflows/localization-management.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ As a developer-focused localization service, Crowdin helps you to decouple the l
7474
</figure>
7575

7676
<Callout>
77-
The [TypeScript integration of `next-intl`](/docs/typescript) can help you to
78-
validate at compile time that your app is in sync with your translation
79-
bundles.
77+
The [TypeScript integration of `next-intl`](/docs/workflows/typescript) can
78+
help you to validate at compile time that your app is in sync with your
79+
translation bundles.
8080
</Callout>
8181

8282
You can further simplify the process for translators by setting up <PartnerContentLink name="localization-management-developers" href="https://developer.crowdin.com/in-context-localization/">Crowdin In-Context</PartnerContentLink>, allowing for the translation of messages directly from your app.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# VSCode integration
2+
3+
To improve the workflow for managing messages right from your code editor, you can use the [i18n Ally VSCode extension](https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally) which includes support for `next-intl`.
4+
5+
<video
6+
className="my-8"
7+
autoPlay
8+
loop
9+
controls
10+
muted
11+
src="/i18n-ally-demo.mp4"
12+
/>
13+
14+
## Installation instructions
15+
16+
1. Install [i18n Ally](https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally)
17+
2. Configure the extension in your workspace via [`settings.json`](https://code.visualstudio.com/docs/getstarted/settings#_workspace-settings)
18+
19+
```json filename=".vscode/settings.json"
20+
"i18n-ally.localesPaths": ["path/to/your/messages"], // E.g. "messages"
21+
"i18n-ally.keystyle": "nested"
22+
```

docs/public/i18n-ally-demo.mp4

526 KB
Binary file not shown.

0 commit comments

Comments
 (0)