
Angular Best Practices Transloco
- 250 installs
- 37 repo stars
- Updated March 28, 2026
- alfredoperez/angular-best-practices
Add and maintain Transloco-based internationalization in Angular apps, including lazy-loaded translation files, runtime language switching, and typed message keys.
About
Angular best-practices skill focused on Transloco: project structure for locale files, provider configuration, lazy loading per route, switching languages at runtime, and keeping templates type-safe while avoiding common i18n pitfalls.
- Transloco setup in Angular
- Lazy translation loading
- Runtime locale switching
- Typed translation keys
- Pluralization and interpolation
Angular Best Practices Transloco by the numbers
- 250 all-time installs (skills.sh)
- Ranked #801 of 2,245 Frontend Development skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/alfredoperez/angular-best-practices --skill angular-best-practices-translocoAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 250 |
|---|---|
| repo stars | ★ 37 |
| Last updated | March 28, 2026 |
| Repository | alfredoperez/angular-best-practices ↗ |
What it does
Add and maintain Transloco-based internationalization in Angular apps, including lazy-loaded translation files, runtime language switching, and typed message keys.
Files
Angular Transloco Best Practices
Transloco rules for runtime internationalization, lazy-loaded translations, and testing. Use with the core angular-best-practices skill for comprehensive Angular coverage.
Links
When to Apply
- Adding runtime i18n with the
translocopipe or directive - Lazy-loading translation files per route with scopes
- Writing tests that use
TranslocoTestingModule
Rules
| Rule | Impact | Description |
|---|---|---|
| Lazy Load Translation Files per Route | MEDIUM | Load scoped translations only when a route is activated |
| Mock Translations in Tests | MEDIUM | Fast deterministic tests without HTTP translation loading |
| Use Transloco for Runtime i18n | MEDIUM | Dynamic language switching without app rebuilds |
Install
Install from skills.sh/alfredoperez/angular-best-practices:
- Core skill: angular-best-practices
- This add-on: angular-best-practices-transloco
Angular Transloco Best Practices
Use with the core angular-best-practices skill.---
1. Internationalization
Impact: MEDIUM (Internationalization)
1.1 Lazy Load Translation Files per Route
Impact: MEDIUM (Reduces initial bundle with translations)
Use Transloco scopes to load translation files only when a route is activated. Define scopes at the route level using provideTranslocoScope() to avoid loading all translations upfront.
Incorrect:
// Single large translation file loaded at startup
// en.json — 500+ keys for all featuresCorrect:
{ path: 'admin', loadChildren: () => import('./admin/admin.routes'),
providers: [provideTranslocoScope('admin')] }
// Loads admin/en.json only when visiting /admin1.2 Mock Translations in Tests
Impact: MEDIUM (Fast tests without HTTP translation loading)
Provide inline translations in tests with provideTranslocoTesting() to avoid HTTP requests and ensure fast, deterministic runs.
Incorrect:
// Loading real translation files in tests — slow, flaky, needs HTTP mock
TestBed.configureTestingModule({ providers: [provideTransloco({ /* full config */ })] });Correct:
TestBed.configureTestingModule({
providers: [provideTranslocoTesting({
langs: { en: { 'actions.save': 'Save' } }, defaultLang: 'en',
})],
});1.3 Use Transloco for Runtime i18n
Impact: MEDIUM (Dynamic language switching without rebuilds)
Use provideTransloco() for runtime internationalization with the transloco pipe in templates.
Incorrect:
<!-- Hardcoded strings — no translation support -->
<h1>Welcome to the app</h1>
<button>Save Changes</button>Correct:
<h1>{{ 'home.welcome' | transloco }}</h1>
<button>{{ 'actions.save' | transloco }}</button>---