feat: Enhance localization compliance by enforcing usage of localized keys for user-facing strings and updating related documentation
This commit is contained in:
@@ -58,6 +58,7 @@ and load any additional skills as needed for specific review challenges.
|
||||
6. Missing tests for use cases or repositories
|
||||
7. Complex BLoC without bloc_test coverage
|
||||
8. Test coverage below 70% for business logic
|
||||
9. Hardcoded user-facing strings — must use `core_localization` (Slang) via `t.<section>.<key>`. All `Text('...')` with literal English/Spanish strings in presentation layer must be replaced with localized keys
|
||||
|
||||
### MODERATE (Request Fix, can be deferred with justification):
|
||||
1. Missing doc comments on public APIs
|
||||
@@ -103,7 +104,7 @@ Verify:
|
||||
- Business logic resides exclusively in use cases
|
||||
- Entities are in domain, models in data, widgets in presentation
|
||||
|
||||
### Step 3: Design System Compliance
|
||||
### Step 3: Design System & Localization Compliance
|
||||
|
||||
```bash
|
||||
# Hardcoded colors
|
||||
@@ -117,9 +118,22 @@ grep -rn -E "EdgeInsets\.(all|symmetric|only)\(" apps/mobile/apps/*/lib/features
|
||||
|
||||
# Direct icon imports
|
||||
grep -rn "^import.*icons" apps/mobile/apps/*/lib/features/
|
||||
|
||||
# Hardcoded user-facing strings (look for Text('...') with literal strings)
|
||||
grep -rn "Text(['\"]" apps/mobile/packages/features/
|
||||
# Also check for hardcoded strings in SnackBar, AlertDialog, AppBar title, etc.
|
||||
grep -rn "title: ['\"]" apps/mobile/packages/features/
|
||||
grep -rn "label: ['\"]" apps/mobile/packages/features/
|
||||
grep -rn "hintText: ['\"]" apps/mobile/packages/features/
|
||||
```
|
||||
|
||||
All styling must come from the design system. No exceptions.
|
||||
All styling must come from the design system. All user-facing strings must come from `core_localization` via Slang (`t.<section>.<key>`). No exceptions.
|
||||
|
||||
**Localization rules:**
|
||||
- Strings defined in `packages/core_localization/lib/src/l10n/en.i18n.json` and `es.i18n.json`
|
||||
- Accessed via `t.<section>.<key>` (e.g., `t.client_create_order.review.invalid_arguments`)
|
||||
- Both `en` and `es` JSON files must be updated together
|
||||
- Regenerate with `dart run slang` from `packages/core_localization/` directory
|
||||
|
||||
### Step 4: State Management Review
|
||||
For every BLoC in changed files, verify:
|
||||
|
||||
Reference in New Issue
Block a user