Search

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 Repository stars0 Repository forks

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

View source ↗Guides

Skill 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 };

Examples

Read the usage examples in the source repository.

View source ↗

Source history

Indexed on
2026-03-11
Index updated
2026-03-11
Branch
main

Index and sync dates describe this directory. View the source repository for code history.

GitHub ↗

chat Comments (0)

chat_bubble_outline

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