スキル一覧に戻る
tienbm92

localization

by tienbm92

Personal AI context base used for bootstrapping new projects and feature development. Acts as the backbone for architecture, domain rules, and reusable design patterns.

0🍴 0📅 2026年1月26日
GitHubで見るManusで実行

SKILL.md


name: localization description: 'Multi-platform localization (iOS, Android, Flutter). Sử dụng skill này khi setup localization mới, thêm text, hoặc cần best practices về đa ngôn ngữ.'

Localization Skill

Multi-platform localization guide cho iOS, Android và Flutter


🎯 Khi Nào Sử Dụng Skill Này

User RequestAction
Setup localization mớiĐọc references/pipeline-new-project.md
Thêm text mớiĐọc references/pipeline-add-text.md
Best practicesĐọc references/best-practices.md
iOS localizationĐọc references/ios-localization.md
Android localizationĐọc references/android-localization.md
Flutter localizationĐọc references/flutter-localization.md

📐 Architecture Overview

┌─────────────────────────────────────────────────┐
│  Presentation Layer                             │
│  ├── View (hiển thị L10n.key)                   │
│  └── ViewModel (@Published currentLocale)        │
├─────────────────────────────────────────────────┤
│  Data Layer                                     │
│  └── LocaleStorage (UserDefaults/SharedPrefs)   │
└─────────────────────────────────────────────────┘

Core Principles

  1. Separation of Concerns - Locale state trong ViewModel/Provider
  2. Type Safety - Code generation (SwiftGen, R.string, AppLocalizations)
  3. Dynamic Switching - Runtime language change
  4. Persistence - Save user preference
  5. Fallback - Luôn có base language (English)

📱 Platform Quick Reference

PlatformFile FormatKey ConventionCode Gen
iOS.stringslogin.title (dot.notation)SwiftGen → L10n
Android.xmllogin_title (snake_case)Auto R.string
Flutter.arbloginTitle (camelCase)flutter gen-l10n

📋 Key Naming Convention

iOS (dot.notation)

login.title
login.email.placeholder
login.button.sign_in
login.error.invalid_credentials

Android (snake_case)

<string name="login_title">Đăng nhập</string>
<string name="login_email_placeholder">Email</string>
<string name="login_button_sign_in">Đăng nhập</string>

Flutter (camelCase)

{
  "loginTitle": "Đăng nhập",
  "loginEmailPlaceholder": "Email",
  "loginButtonSignIn": "Đăng nhập"
}

🚀 Quick Workflows

1. Setup Localization (Dự án mới)

iOS:

# 1. Install SwiftGen
brew install swiftgen

# 2. Create Localizable.strings
mkdir -p Resources/en.lproj
touch Resources/en.lproj/Localizable.strings

# 3. Configure swiftgen.yml
# 4. Run: swiftgen

Android:

# 1. Create strings.xml
mkdir -p app/src/main/res/values
touch app/src/main/res/values/strings.xml

# 2. Add base strings
# 3. Android Studio auto-generates R.string

Flutter:

# 1. Add to pubspec.yaml
flutter:
  generate: true

# 2. Create l10n.yaml
# 3. Create lib/l10n/app_en.arb
# 4. Run: flutter gen-l10n

2. Thêm Text Mới

1. Xác định key name theo convention
2. Thêm vào base language file
3. Run code generation
4. Sử dụng trong code
5. Thêm translations cho các ngôn ngữ khác

✅ Best Practices Checklist

  • Key names descriptive và hierarchical
  • Base language (EN) luôn complete
  • Plurals sử dụng proper rules (ICU format)
  • Date/number formatting theo locale
  • RTL support nếu cần (Arabic, Hebrew)
  • String interpolation với named parameters
  • No hardcoded strings trong code

📁 Reference Files

FileNội dung
pipeline-new-project.mdSetup từ đầu
pipeline-add-text.mdThêm text mới
best-practices.mdBest practices
ios-localization.mdiOS với SwiftGen
android-localization.mdAndroid strings.xml
flutter-localization.mdFlutter ARB

スコア

総合スコア

70/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です