← Back to list

i18n
by InKCre
Design system and any other design stuff of InKCre
⭐ 0🍴 0📅 Jan 16, 2026
SKILL.md
name: i18n description: Integrate @inkcre/web-design with vue-i18n for internationalization.
Internationalization (i18n)
Use this skill when setting up internationalization for @inkcre/web-design components.
Overview
The design system supports i18n through a provider pattern compatible with vue-i18n.
Interface
import type { Ref, InjectionKey } from "vue";
export interface InkI18n {
t: (key: string) => string;
locale: Ref<string>;
}
export const INK_I18N_KEY: InjectionKey<InkI18n> = Symbol("INK_I18N");
Setup
- Install vue-i18n:
pnpm add vue-i18n
- Extend provided locales:
// locales/en.ts
import { en } from "@inkcre/web-design/locales";
export default {
...en,
// Your custom translations
}
- Configure vue-i18n:
// locales/index.ts
import { createI18n } from "vue-i18n";
import en from "./en";
import zhCN from "./zhCN";
const i18n = createI18n({
legacy: false,
locale: "en",
fallbackLocale: "en",
messages: { en, zhCN },
});
export default i18n;
- Provide to design system:
// App.vue
<script setup lang="ts">
import { INK_I18N_KEY } from "@inkcre/web-design";
import i18n from "./locales";
provide(INK_I18N_KEY, {
t: i18n.global.t,
locale: i18n.global.locale,
});
</script>
Usage
Components will automatically use translations if i18n is provided. They fall back to English if not configured.
import { useOptionalI18n } from "@inkcre/web-design";
const i18n = useOptionalI18n();
if (i18n) {
console.log(i18n.t('common.save'));
}
Score
Total Score
55/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon


