skills/intlayer-angular/SKILL.md
Integrates Intlayer internationalization with Angular applications. Use when the user asks to "setup Angular i18n", create a new translated component, use the "useIntlayer" composable, or configure providers.
npx skillsauth add aymericzip/intlayer-skills intlayer-angularInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Intlayer promotes Component-Level Content Declaration. Instead of a massive global translation file, content is declared in *.content.ts files adjacent to the Angular components that use them.
To create a translated component, you need two files:
my-component.content.ts) defining the dictionary.my-component.component.ts) using the useIntlayer signal.Create a content file using t() for translations.
File: src/app/my-component/my-component.content.ts
import { t, type Dictionary } from "intlayer";
const content = {
// The 'key' must be unique and matches what you pass to useIntlayer()
key: "my-component",
content: {
text: t({
en: "Welcome",
fr: "Bienvenue",
es: "Hola",
}),
},
} satisfies Dictionary;
export default content;
To use Intlayer in your Angular application, you need to add the provideIntlayer provider to your application configuration.
import { ApplicationConfig } from "@angular/core";
import { provideIntlayer } from "angular-intlayer";
export const appConfig: ApplicationConfig = {
providers: [provideIntlayer()],
};
In Angular, useIntlayer returns a Signal. You must call it as a function to access the value.
import { Component } from "@angular/core";
import { useIntlayer } from "angular-intlayer";
@Component({
selector: "app-my-component",
standalone: true,
template: `
<div>
<h1>
{{ content().text }}
</h1>
<img [src]="content().text.value" [alt]="content().text.value" />
</div>
`,
})
export class MyComponent {
content = useIntlayer("my-component");
}
To change the language, use the setLocale function from the useLocale hook.
import { Component } from "@angular/core";
import { useLocale } from "angular-intlayer";
import { Locales } from "intlayer";
@Component({
selector: "app-locale-switcher",
standalone: true,
template: `
<button (click)="setLocale(Locales.FRENCH)">
Change Language to French
</button>
`,
})
export class LocaleSwitcherComponent {
Locales = Locales;
private localeCtx = useLocale();
setLocale = this.localeCtx.setLocale;
}
Ensure your application's navigation respects the current locale by using a localized link. You can create a component or use a helper.
import { Component, Input } from "@angular/core";
import { RouterModule } from "@angular/router";
import { useLocale } from "angular-intlayer";
import { getLocalizedUrl } from "intlayer";
@Component({
selector: "app-link",
standalone: true,
imports: [RouterModule],
template: `
<a [routerLink]="localizedHref()" [replaceUrl]="false">
<ng-content></ng-content>
</a>
`,
})
export class LinkComponent {
@Input() href: string = "";
private localeCtx = useLocale();
locale = this.localeCtx.locale;
localizedHref() {
return this.href.startsWith("http")
? this.href
: getLocalizedUrl(this.href, this.locale());
}
}
Website
Doc
Angular
Angular Intlayer Exports
Intlayer Exports
tools
Integrates Intlayer internationalization with Vue.js and Nuxt applications. Use when the user asks to "setup Vue i18n", use the "useIntlayer" composable, or manage translations in Vue components.
documentation
Provides general guidelines for using Intlayer in any project. Use when the user asks to "get started with Intlayer", "declare content files", or understand the "project structure" for internationalization.
tools
Integrates Intlayer internationalization with Svelte and SvelteKit applications. Use when the user asks to "setup Svelte i18n", create a new translated component, use the "useIntlayer" store, or configure providers.
tools
Integrates Intlayer internationalization with SolidJS components. Use when the user asks to "setup SolidJS i18n", create a new translated component, use the "useIntlayer" hook in Solid, or configure providers.