← Back to list

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📅 Jan 26, 2026
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 Request | Action |
|---|---|
| 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
- Separation of Concerns - Locale state trong ViewModel/Provider
- Type Safety - Code generation (SwiftGen, R.string, AppLocalizations)
- Dynamic Switching - Runtime language change
- Persistence - Save user preference
- Fallback - Luôn có base language (English)
📱 Platform Quick Reference
| Platform | File Format | Key Convention | Code Gen |
|---|---|---|---|
| iOS | .strings | login.title (dot.notation) | SwiftGen → L10n |
| Android | .xml | login_title (snake_case) | Auto R.string |
| Flutter | .arb | loginTitle (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
| File | Nội dung |
|---|---|
| pipeline-new-project.md | Setup từ đầu |
| pipeline-add-text.md | Thêm text mới |
| best-practices.md | Best practices |
| ios-localization.md | iOS với SwiftGen |
| android-localization.md | Android strings.xml |
| flutter-localization.md | Flutter ARB |
Score
Total Score
70/100
Based on repository quality metrics
✓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
Reviews
💬
Reviews coming soon