Rechercher

PythonReactSEOPDF
GitHub Skill

add-i18n

Generate or update internationalization (i18n) locale files for an Ybyra domain. Use when the user asks to add translations, create locale files, or update labels for a domain's fields, groups, and actions.

devitools☆ 2 Étoiles du dépôt0 Forks du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

Voir la source ↗Guides

Instructions

Add i18n Translations

When to Use

  • User asks to create translations for a new domain
  • User asks to add or update labels for fields, groups, or actions
  • User asks to create a locale file

Steps

  1. Identify the domain and fields from the schema definition
  2. Create the locale file at settings/locales/pt-BR.ts (or the target locale)
  3. Add entries for every field, group, and custom action in the schema
  4. Register the locale in the i18n setup file

Locale Structure

Every domain locale must include:

export const ptBR = {
  {domain}: {
    title: "{Domain Title}",
    fields: {
      // One entry per field in the schema
      {fieldName}: "{Label}",
      "{fieldName}.placeholder": "{Placeholder text}",  // optional
    },
    groups: {
      // One entry per group in the schema
      {groupName}: "{Group Label}",
    },
    actions: {
      // Only custom actions (not standard CRUD)
      {actionName}: "{Action Label}",
    },
  },
};

Rules

  • Every field in the schema MUST have a label entry
  • Placeholders are optional but recommended for text inputs
  • Standard actions (add, view, edit, create, update, cancel, destroy) use common.* keys from @ybyra/core
  • Only custom actions need domain-specific labels

Example (pt-BR)

// settings/locales/pt-BR.ts
export const ptBR = {
  person: {
    title: "Pessoa",
    fields: {
      id: "ID",
      name: "Nome",
      "name.placeholder": "Digite seu nome aqui",
      email: "E-mail",
      birthDate: "Data de Nascimento",
      active: "Ativo",
    },
    groups: {
      basic: "Informações Básicas",
      address: "Endereço",
    },
    actions: {
      custom: "Enviar",
    },
  },
};

Merge with core translations:

import { ptBR } from "@ybyra/core";
import { ptBR as local } from "./locales/pt-BR";

const merged = { ...ptBR, ...local };

Exemples

Consultez les exemples du dépôt source.

Voir la source ↗

Historique source

Date d’indexation
2026-03-11
Mise à jour de l’index
2026-03-11
Branch
main

Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!