Przejdź do treści
Biblioteka skilli
Programowanie · Integracja z narzędziem

intlayer-react

/intlayer-react

Integruje internacjonalizację Intlayer z aplikacjami React, w tym tłumaczone komponenty, hook useIntlayer i konfigurację providerów.

Repozytorium
intlayer ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
27.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
27
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
4
Przestarzałość

Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Integruje internacjonalizację Intlayer z aplikacjami React, w tym tłumaczone komponenty, hook useIntlayer i konfigurację providerów.

Wyzwalacze z opisu

setup React i18nuseIntlayer
Oryginalny opis (EN)

Integrates Intlayer internationalization with React component. Use when the user asks to "setup React i18n", create a new translated component, use the "useIntlayer" hook, or configure providers.

Jak działa

  1. Core Philosophy
  2. Workflow
  3. Setup
  4. useIntlayer Hook
  5. Bundle Optimization
  6. Compiler
  7. References
Sekcje z nagłówków SKILL.md, w oryginale · 114 linii, 385 słów
Podgląd SKILL.md
---
name: intlayer-react
description: Integrates Intlayer internationalization with React component. Use when the user asks to "setup React i18n", create a new translated component, use the "useIntlayer" hook, or configure providers.
metadata:
  author: Intlayer
  url: https://intlayer.org
  license: Apache-2.0
  mcp-server: "@intlayer/mcp"
  category: productivity
  tags: [i18n, react, vite]
  documentation: https://intlayer.org/doc
  support: contact@intlayer.org
---

# Intlayer React Usage

## Core Philosophy

Intlayer promotes **Component-Level Content Declaration**. Instead of a massive global translation file, content is declared in `*.content.ts` files adjacent to the React components that use them.

## Workflow

To create a translated component, you need two files:

1.  **Declaration:** A content file (e.g., `myComponent.content.ts`) defining the dictionary.
2.  **Implementation:** A React component (e.g., `MyComponent.tsx`) using the `useIntlayer` hook.

### 1. Declare Content

Create a content file using `t()` for translations.
**File:** `src/components/MyComponent/myComponent.content.ts`

```typescript
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",
      // ... All other locales set in intlayer config file
    }),
  },
} satisfies Dictionary;

export default content;
```

## Setup

- [Vite and React](references/environment_vite-and-react.md)
- [Create React App](references/environment_create-react-app.md)
- [React Router v7](references/environment_vite-and-react_react-router-v7.md)
- [Tanstack Start](references/environment_tanstack-start.md)
- [React Native and Expo](references/environment_react-native-and-expo.md)
- [Lynx and React](references/environment_lynx-and-react.md)
- [Storybook](references/storybook.md)

## useIntlayer Hook

```tsx
import { useIntlayer } from "react-intlayer";
const MyComponent = () => {
  const content = useIntlayer("my-dictionary-key");
  return (
    <div>
      <h1>
        {/* Return react node */}
        {content.text}
      </h1>
      {/* Return string (.value) */}
      <img src={content.text.value} alt={content.text.value} />
    </div>
  );
};
```

## Bundle Optimization

Read content fields by name (dot access or destructuring) so the build can purge and minify the dictionary. Never index content at runtime (`content.statuses[status]`, use `select()`), and call `useIntlayer` in each child component instead of passing content as a prop. See the `intlayer-bundle-optimization` skill.

## Compiler

The [Intlayer Compiler](references/compiler.md) can extract all your content keys from your components, using one CLI command (`npx intlayer extract`) or automatically at app build.

## References

- [Website](https://intlayer.org)
- [Doc](https://intlayer.org/doc)

### Environments

- [Vite and React](references/environment_vite-and-react.md)
- [Create React App](references/environment_create-react-app.md)
- [Vite and React (React Router v7)](references/environment_vite-and-react_react-router-v7.md)
- [Tanstack Start](references/environment_tanstack-start.md)
- [React Native and Expo](references/environment_react-native-and-expo.md)
- [Lynx and React](references/environment_lynx-and-react.md)
- [Astro and React](references/environment_astro_react.md)
- [Storybook](references/storybook.md)

### Concepts

- [Variants](references/concept_variants.md)
- [Collections](references/concept_collections.md)
- [Compiler](references/compiler.md)
- [Formatters (number, currency, date, …)](references/formatters.md)

### Packages

- [Intlayer Exports](references/packages_intlayer_exports.md)
- [React Intlayer Provider](references/packages_react-intlayer_IntlayerProvider.md)
- [React Intlayer MarkdownRenderer](references/packages_react-intlayer_MarkdownRenderer.md)
- [React Intlayer Exports](references/packages_react-intlayer_exports.md)
- [React Intlayer T](references/packages_react-intlayer_t.md)
- [React Intlayer useDictionary](references/packages_react-intlayer_useDictionary.md)
- [React Intlayer useI18n](references/packages_react-intlayer_useI18n.md)
- [React Intlayer useIntlayer](references/packages_react-intlayer_useIntlayer.md)
- [React Intlayer useLocale](references/packages_react-intlayer_useLocale.md)
- [lynx-intlayer Exports](references/packages_lynx-intlayer_exports.md)
- [react-intlayer usePathname](references/packages_react-intlayer_usePathname.md)
- [react-intlayer useRewriteURL](references/packages_react-intlayer_useRewriteURL.md)
- [react-native-intlayer Exports](references/packages_react-native-intlayer_exports.md)
Pliki w paczce (27)
  • LICENCE.md 11 KB
  • SKILL.md 5 KB
  • references/compiler.md 15 KB
  • references/concept_collections.md 6 KB
  • references/concept_variants.md 21 KB
  • references/environment_astro_react.md 38 KB
  • references/environment_create-react-app.md 39 KB
  • references/environment_lynx-and-react.md 15 KB
  • references/environment_react-native-and-expo.md 30 KB
  • references/environment_tanstack-start.md 57 KB
  • references/environment_vite-and-react.md 52 KB
  • references/environment_vite-and-react_react-router-v7.md 47 KB
  • references/formatters.md 17 KB
  • references/packages_intlayer_exports.md 12 KB
  • references/packages_lynx-intlayer_exports.md 1 KB
  • references/packages_react-intlayer_IntlayerProvider.md 2 KB
  • references/packages_react-intlayer_MarkdownRenderer.md 1 KB
  • references/packages_react-intlayer_exports.md 14 KB
  • references/packages_react-intlayer_t.md 6 KB
  • references/packages_react-intlayer_useDictionary.md 2 KB
  • references/packages_react-intlayer_useI18n.md 5 KB
  • references/packages_react-intlayer_useIntlayer.md 2 KB
  • references/packages_react-intlayer_useLocale.md 3 KB
  • references/packages_react-intlayer_usePathname.md 3 KB
  • references/packages_react-intlayer_useRewriteURL.md 2 KB
  • references/packages_react-native-intlayer_exports.md 5 KB
  • references/storybook.md 16 KB

Wersje

W bazie nie ma innych skilli o nazwie intlayer-react.

Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 28.10.2026 · wersja paczki 49476d1d7740 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100intlayer-preact
    Integruje internacjonalizację Intlayer z aplikacjami Preact, w tym tłumaczone komponenty, hook useIntlayer i konfigurację providerów.
  • 100intlayer-svelte
    Integruje internacjonalizację Intlayer z aplikacjami Svelte i SvelteKit, w tym tłumaczone komponenty, store useIntlayer i konfigurację providerów.
  • 100react
    Pomaga tworzyć i zmieniać komponenty, hooki i elementy interfejsu w pakietach react-ui oraz ui-components.
  • 96react-component-generator
    Generuje komponenty React zgodne z konwencjami projektu i tworzy dla nich pliki.
  • 100react-hook-creator
    Prawdopodobnie tworzy własne hooki React w ramach umiejętności frontendowych.
  • 100react-component-guidelines
    Dostarcza wytyczne pisania komponentów React przy tworzeniu nowego komponentu.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.