Skip to content

Commit 9b775cb

Browse files
authored
chapter: Internationalization (#32)
* configure lint * i18n
1 parent bf53b3e commit 9b775cb

File tree

12 files changed

+135
-53
lines changed

12 files changed

+135
-53
lines changed

packages/.vitepress/config.ts

-36
This file was deleted.

packages/.vitepress/config/en.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { i18nTheme } from '.'
2+
3+
const nav: i18nTheme['nav'] = [
4+
{ text: 'Home', link: '/' },
5+
{ text: 'Guide', link: '/guide/' },
6+
]
7+
8+
const sidebar: i18nTheme['sidebar'] = [
9+
{ text: 'Getting Started', link: '/guide/' },
10+
{ text: 'What is VueUse?', link: '/guide/what-is-vueuse' },
11+
{ text: 'Setup', link: '/guide/setup' },
12+
]
13+
14+
export const en: i18nTheme = { nav, sidebar }

packages/.vitepress/config/index.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { DefaultTheme, UserConfig } from 'vitepress'
2+
import { defineConfig } from 'vitepress'
3+
import { sharedConfig } from './shared'
4+
import { ja } from './ja'
5+
import { en } from './en'
6+
7+
export type i18nTheme = Partial<NonNullable<UserConfig<DefaultTheme.Config>['themeConfig']>>
8+
9+
export default defineConfig({
10+
...sharedConfig,
11+
themeConfig: sharedConfig.themeConfig,
12+
locales: {
13+
root: { label: 'English', lang: 'en', themeConfig: { ...en } },
14+
ja: { label: '日本語', lang: 'ja', themeConfig: { ...ja } },
15+
// other languages...
16+
},
17+
})

packages/.vitepress/config/ja.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { i18nTheme } from '.'
2+
3+
const nav: i18nTheme['nav'] = [
4+
{ text: 'Home', link: '/ja/' },
5+
{ text: 'Guide', link: '/ja/guide/' },
6+
]
7+
8+
const sidebar: i18nTheme['sidebar'] = [
9+
{ text: 'はじめに', link: '/ja/guide/' },
10+
{ text: 'VueUseとは', link: '/ja/guide/what-is-vueuse' },
11+
{ text: '環境構築', link: '/ja/guide/setup' },
12+
]
13+
14+
export const ja: i18nTheme = { nav, sidebar }

packages/.vitepress/config/shared.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { DefaultTheme, UserConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export const sharedConfig: UserConfig<DefaultTheme.Config> = {
5+
title: 'VueYous',
6+
description: 'Craft Your Own VueUse Composables From Scratch',
7+
8+
head: [['link', { rel: 'icon', href: '/logo.png' }]],
9+
10+
themeConfig: {
11+
search: { provider: 'local' },
12+
logo: '/logo.png',
13+
socialLinks: [{ icon: 'github', link: 'https://github.com/pei-pay/VueYous' }],
14+
},
15+
} as const

packages/guide/index.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# はじめに
1+
# Introduction
22

3-
## 本書の目的
3+
## Purpose of this book
44

5-
以下が本書の主な目的になります。
5+
The main objectives of this book are as follows:
66

7-
- VueUse のような「再利用性」、「保守性」、「拡張性」を意識したコンポーザブルを作成できるようになる
8-
- 様々な機能のコンポーザブルを実際に作ることで、Vue.js TypeScript の理解を深める
9-
- オープンソースのコードを読んで、実用的なコーディングテクニックやベストプラクティスを学ぶ
7+
- To be able to create composable functions with a focus on "reusability," "maintainability," and "extensibility" like VueUse
8+
- To deepen the understanding of Vue.js and TypeScript by actually creating composable functions with various functionalities
9+
- To learn practical coding techniques and best practices by reading open-source code
1010

11-
## 本書の方針
11+
## Approach of this book
1212

13-
- **最低限で再現**: VueUse のコンポーザブルを完全再現することは目指しません。必要最低限で実装することによる読みやすさを重視します。
13+
- **Minimal Reproduction**: We do not aim to fully replicate the composable functions of VueUse. We prioritize readability by implementing only the necessary minimum.
1414

15-
- **分かりやすさ**: 複雑な概念も分かりやすく解説し、読者がストレスなく学習できるよう配慮します。わかりやすい説明や具体的な例を使用し、読者がスムーズに理解できるよう努めます。
15+
- **Clarity**: We explain complex concepts in an easy-to-understand manner and take care to ensure that readers can learn without stress. We use clear explanations and concrete examples to help readers understand smoothly.
1616

17-
- **実用性**: 学んだ知識が現実の開発に役立つことを重視します。理論だけでなく、実践的な問題解決のアプローチやベストプラクティスに焦点を当てます。
17+
- **Practicality**: We emphasize that the knowledge learned is useful in real-world development. We focus not only on theory but also on practical approaches to problem-solving and best practices.
1818

19-
## 対象読者
19+
## Target Audience
2020

21-
- Vue.js を使ったことがある
22-
- Typescript を使ったことがある
21+
- Those who have used Vue.js
22+
- Those who have used TypeScript
2323

24-
## 本書の構成
24+
## Structure of this book
2525

26-
<!-- TODO: write about book structure -->
26+
<!-- TODO: write about book structure -->

packages/guide/setup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# 環境構築
1+
# Setup
22

33
<!-- TODO: write how to setup -->

packages/guide/what-is-vueuse.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# VueUseとは
1+
# What is VueUse
22

33
<!-- TODO: write what is vueuse -->

packages/ja/guide/index.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# はじめに
2+
3+
## 本書の目的
4+
5+
以下が本書の主な目的になります。
6+
7+
- VueUse のような「再利用性」、「保守性」、「拡張性」を意識したコンポーザブルを作成できるようになる
8+
- 様々な機能のコンポーザブルを実際に作ることで、Vue.js と TypeScript の理解を深める
9+
- オープンソースのコードを読んで、実用的なコーディングテクニックやベストプラクティスを学ぶ
10+
11+
## 本書の方針
12+
13+
- **最低限で再現**: VueUse のコンポーザブルを完全再現することは目指しません。必要最低限で実装することによる読みやすさを重視します。
14+
15+
- **分かりやすさ**: 複雑な概念も分かりやすく解説し、読者がストレスなく学習できるよう配慮します。わかりやすい説明や具体的な例を使用し、読者がスムーズに理解できるよう努めます。
16+
17+
- **実用性**: 学んだ知識が現実の開発に役立つことを重視します。理論だけでなく、実践的な問題解決のアプローチやベストプラクティスに焦点を当てます。
18+
19+
## 対象読者
20+
21+
- Vue.js を使ったことがある
22+
- Typescript を使ったことがある
23+
24+
## 本書の構成
25+
26+
<!-- TODO: write about book structure -->

packages/ja/guide/setup.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 環境構築
2+
3+
<!-- TODO: write how to setup -->

packages/ja/guide/what-is-vueuse.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# VueUseとは
2+
3+
<!-- TODO: write what is vueuse -->

packages/ja/index.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
# https://vitepress.dev/reference/default-theme-home-page
3+
layout: home
4+
5+
hero:
6+
name: 'VueYous'
7+
text: 'Craft Your Own VueUse Composables From Scratch'
8+
tagline: powered by VitePress
9+
image: /logo.png
10+
actions:
11+
- theme: brand
12+
text: 始める
13+
link: /ja/guide/
14+
- theme: alt
15+
text: VueUse 公式
16+
link: https://vueuse.org/
17+
18+
# TODO: Write features
19+
features:
20+
- title: Feature A
21+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
22+
- title: Feature B
23+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
24+
- title: Feature C
25+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
26+
---

0 commit comments

Comments
 (0)