From 67596d0a75844169057c765cc06945ec6efa5b77 Mon Sep 17 00:00:00 2001 From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com> Date: Thu, 19 Nov 2026 02:33:57 +0200 Subject: [PATCH 1/8] fix(locales): write Forma's Spanish in Latin American Spanish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Spanish pack and the Showcase's files address the reader as tú and use Latin American words: agregar, presionar, ingresar, video and monto in place of añadir, pulsar, introducir, vídeo and importe. --- .claude/skills/forma-localizing/SKILL.md | 1 + CHANGELOG.md | 10 +++++ .../Forma.Blazor.Showcase/.locales/es.json | 2 +- .../Components/Pages/Bars/.locales/es.json | 12 +++--- .../Components/Pages/Buttons/.locales/es.json | 2 +- .../Pages/Collections/.locales/es.json | 6 +-- .../Pages/Debugging/.locales/es.json | 2 +- .../Pages/Features/.locales/es.json | 34 ++++++++-------- .../Pages/Feedback/.locales/es.json | 12 +++--- .../Components/Pages/Inputs/.locales/es.json | 40 +++++++++---------- .../Components/Pages/Layout/.locales/es.json | 12 +++--- .../Pages/Libraries/.locales/es.json | 2 +- .../Components/Pages/Media/.locales/es.json | 2 +- .../Components/Pages/Menus/.locales/es.json | 6 +-- .../Pages/Navigation/.locales/es.json | 4 +- .../Components/Pages/Symbols/.locales/es.json | 8 ++-- .../Pages/Virtualization/.locales/es.json | 2 +- .../Components/Pages/Windows/.locales/es.json | 10 ++--- .../Forma.Blazor.Composer/es.json | 20 +++++----- .../Forma.Blazor.Explorer/es.json | 2 +- .../Forma.Blazor/Components/Debugging/es.json | 2 +- .../Forma.Blazor/Components/Inputs/es.json | 4 +- .../Forma.Blazor.Locales.Spanish/README.md | 2 +- 23 files changed, 104 insertions(+), 93 deletions(-) diff --git a/.claude/skills/forma-localizing/SKILL.md b/.claude/skills/forma-localizing/SKILL.md index b0e5b1610..25146171c 100644 --- a/.claude/skills/forma-localizing/SKILL.md +++ b/.claude/skills/forma-localizing/SKILL.md @@ -18,6 +18,7 @@ description: The localization standard — reading library strings through the b - Do leave caller-supplied text such as `Title`, `Label`, and `ConfirmText` for the host to localize. - Do format, parse and compare dates, numbers and text with the context's `Context.CultureState.Culture`, choose direction with `Context.CultureState.IsRightToLeft`, and run an API that reads the ambient culture, such as `DisplayAttribute.GetName()`, in `Context.CultureState.Run`; the ambient culture's members are banned in a component project. - Do use American English spelling for `en` localization. +- Do write Spanish in Latin American Spanish, the dialect of `es-419`, in files whose culture stays `es`, so every Spanish-speaking reader gets them, and address the reader as *tú*: *agregar*, *presionar* or *hacer clic*, *ingresar*, *video* and *monto*, where Spain says *añadir*, *pulsar*, *introducir*, *vídeo* and *importe*. - Do run the localization linter, which checks the locale files against the `L[...]` call sites that key them, before offering the work for review. - Don't hardcode user-facing component strings. - Don't localize text supplied by the caller a second time inside the library. diff --git a/CHANGELOG.md b/CHANGELOG.md index 5548f3298..5fb5b85ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ release is cut, and reads *Unreleased* until then. It lists every change a consu breaks what the release before it allowed says how to migrate, as [Versioning's rules](https://github.com/FormaUI/Versioning/blob/v1.0.0-preview.5/docs/releases.md#the-release-record) set out. What Forma gained before its first release, month by month, is in [the feature history](FEATURE-HISTORY.md). +## `1.0.0-preview.12` + +*Unreleased* + +- The Spanish locale pack is written throughout in Latin American Spanish, addressing the reader as *tú*: the table + menu's *Agregar Fila Arriba* and the three like it, the inputs' *Agrega un número.* and *Agrega un símbolo.*, the + composer's six prompts starting *Ingresa…*, the explorer's *Video*, and the input router's *Presiona una tecla, haz + clic o desplázate…*. They read *Añadir…*, *Añade…*, *Introduce…*, *Vídeo* and *Pulse una tecla, haga clic o + desplácese…*, Spain's words, and the last one addressed the reader as *usted*. + ## `1.0.0-preview.11` *November 18, 2026* diff --git a/src/Blazor/Forma.Blazor.Showcase/.locales/Forma.Blazor.Showcase/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/.locales/Forma.Blazor.Showcase/.locales/es.json index 77512187a..546d6fb2c 100644 --- a/src/Blazor/Forma.Blazor.Showcase/.locales/Forma.Blazor.Showcase/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/.locales/Forma.Blazor.Showcase/.locales/es.json @@ -2,6 +2,6 @@ "$localization": "SchemaVersion: 1.0.0; Culture: es;", "Components.Pages.Libraries.LocalizationPage": { "Written in the root's file": "Desde la carpeta del anfitrión: el archivo de la raíz", - "Added by the host's folder alone": "Añadido solo desde la carpeta del anfitrión" + "Added by the host's folder alone": "Agregado solo desde la carpeta del anfitrión" } } diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Bars/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Bars/.locales/es.json index 586314a6b..4225cef44 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Bars/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Bars/.locales/es.json @@ -24,7 +24,7 @@ "Selection Actions": "Acciones de Selección", "Caption Agreeing with the Count": "Título que Concuerda con el Recuento", "Step the count up. The caption is a plural construct, so a language with a dual reads differently at one, two, and more.": "Aumenta el recuento. El título es una construcción plural, así que un idioma con dual se lee distinto en uno, dos y más.", - "Add one": "Añadir uno", + "Add one": "Agregar uno", "Without a Clear Button": "Sin Botón de Borrado", "Several Actions": "Varias Acciones", "Caller-Supplied Caption": "Título Proporcionado por el Llamador", @@ -37,8 +37,8 @@ "A quiet strip of status readouts and occasional commands, meant to sit beneath a canvas or at the foot of a panel. Built on FormaToolbar, so a readout announces itself to a screen reader through the same role and a command runs through the same OnCommand.": "Una franja discreta de indicadores de estado y comandos ocasionales, pensada para situarse debajo de un lienzo o al pie de un panel. Construida sobre FormaToolbar, de modo que un indicador se anuncia a un lector de pantalla mediante el mismo rol y un comando se ejecuta mediante el mismo OnCommand.", "Readouts": "Indicadores", "An Announced Readout": "Un Indicador Anunciado", - "Press the button to change the count. A screen reader announces the new value because IsAnnounced is set.": "Pulse el botón para cambiar el recuento. Un lector de pantalla anuncia el nuevo valor porque IsAnnounced está activado.", - "Type some words": "Escriba algunas palabras", + "Press the button to change the count. A screen reader announces the new value because IsAnnounced is set.": "Presiona el botón para cambiar el recuento. Un lector de pantalla anuncia el nuevo valor porque IsAnnounced está activado.", + "Type some words": "Escribe algunas palabras", "A Command": "Un Comando", "Empty, Hidden": "Vacío, Oculto", "The default EmptyMode renders nothing at all while there are no items, rather than an empty bar.": "El EmptyMode predeterminado no muestra nada mientras no hay elementos, en lugar de mostrar una barra vacía.", @@ -88,7 +88,7 @@ "Word count": "Recuento de palabras", "[$ plural; one: # word; other: # words; $]": "[$ plural; one: # palabra; other: # palabras; $]", "Save state": "Estado de guardado", - "Add Words": "Añadir Palabras", + "Add Words": "Agregar Palabras", "Recount": "Recontar", "Custom Item": "Elemento Personalizado", "A ToolbarCustomItem renders a component of the caller's choosing, with its own parameters, in place of a standard control.": "Un ToolbarCustomItem representa un componente elegido por el llamador, con sus propios parámetros, en lugar de un control estándar.", @@ -97,9 +97,9 @@ "Keyboard Shortcuts": "Atajos de Teclado", "An action's ShortcutDisplay appears in its tooltip alongside the label.": "El ShortcutDisplay de una acción aparece en su información sobre herramientas junto a la etiqueta.", "Shortcuts That Fire": "Atajos Que Se Activan", - "Setting Target makes each action's ShortcutAriaKeys live while that element or a descendant holds focus, so the toolbar never listens document-wide. Click into the panel and press Ctrl+B or Ctrl+I.": "Definir Target activa el ShortcutAriaKeys de cada acción mientras ese elemento o un descendiente tiene el foco, de modo que la barra nunca escucha en todo el documento. Haz clic en el panel y pulsa Ctrl+B o Ctrl+I.", + "Setting Target makes each action's ShortcutAriaKeys live while that element or a descendant holds focus, so the toolbar never listens document-wide. Click into the panel and press Ctrl+B or Ctrl+I.": "Definir Target activa el ShortcutAriaKeys de cada acción mientras ese elemento o un descendiente tiene el foco, de modo que la barra nunca escucha en todo el documento. Haz clic en el panel y presiona Ctrl+B o Ctrl+I.", "Shortcut Surface": "Superficie de Atajos", - "Focus here, then press Ctrl+B or Ctrl+I.": "Enfoca aquí y pulsa Ctrl+B o Ctrl+I.", + "Focus here, then press Ctrl+B or Ctrl+I.": "Enfoca aquí y presiona Ctrl+B o Ctrl+I.", "One Item Disabled": "Un Solo Elemento Deshabilitado", "An item's own IsDisabled stands it down while the rest of the toolbar stays live. Its shortcut is refused as well, not only its button.": "El IsDisabled propio de un elemento lo desactiva mientras el resto de la barra sigue activa. Su atajo también se rechaza, no solo su botón.", "Disable Delete": "Deshabilitar Eliminar", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Buttons/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Buttons/.locales/es.json index a562f5054..9c45a5996 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Buttons/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Buttons/.locales/es.json @@ -6,7 +6,7 @@ "On a Colored Surface": "Sobre una Superficie de Color" }, "FormaButtonPage": { - "The button every Forma surface presses. Its variant says how much it should stand out, its size how dense the row around it is, and while work is in flight it shows itself busy so the same click cannot be sent twice.": "El botón que pulsa toda superficie de Forma. Su variante dice cuánto debe destacar, su tamaño cuán densa es la fila que lo rodea, y mientras hay trabajo en curso se muestra ocupado para que el mismo clic no pueda enviarse dos veces.", + "The button every Forma surface presses. Its variant says how much it should stand out, its size how dense the row around it is, and while work is in flight it shows itself busy so the same click cannot be sent twice.": "El botón que presiona toda superficie de Forma. Su variante dice cuánto debe destacar, su tamaño cuán densa es la fila que lo rodea, y mientras hay trabajo en curso se muestra ocupado para que el mismo clic no pueda enviarse dos veces.", "Variants": "Variantes", "Row Actions": "Acciones de Fila", "Busy": "Ocupado", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Collections/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Collections/.locales/es.json index a5481acd4..51abe160f 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Collections/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Collections/.locales/es.json @@ -11,9 +11,9 @@ "Long List in a Scrolling Panel": "Lista larga en un panel con desplazamiento", "Holding a drag near the top or bottom edge scrolls the panel, and releasing in the empty space below the last row sends the item to the end.": "Mantener un arrastre cerca del borde superior o inferior desplaza el panel, y soltar en el espacio vacío bajo la última fila envía el elemento al final.", "Dragging from the Whole Row": "Arrastrar desde Toda la Fila", - "The whole row starts a drag, not just the handle. Interactive elements inside a row keep their own press, and on touch the row is held briefly before it lifts so a swipe still scrolls.": "Toda la fila inicia un arrastre, no sólo el asa. Los elementos interactivos dentro de una fila conservan su propia pulsación, y en pantallas táctiles la fila se mantiene pulsada un momento antes de levantarse, así que un deslizamiento sigue desplazando.", - "Drag a row anywhere to reorder, or press Edit — it still clicks.": "Arrastra una fila desde cualquier punto para reordenar, o pulsa Editar: sigue siendo clicable.", - "Edit was clicked on {Name}, so the row did not take the press.": "Se pulsó Editar en {Name}, así que la fila no tomó la pulsación.", + "The whole row starts a drag, not just the handle. Interactive elements inside a row keep their own press, and on touch the row is held briefly before it lifts so a swipe still scrolls.": "Toda la fila inicia un arrastre, no solo el asa. Los elementos interactivos dentro de una fila conservan su propio clic o toque, y en pantallas táctiles la fila se mantiene presionada un momento antes de levantarse, así que un deslizamiento sigue desplazando.", + "Drag a row anywhere to reorder, or press Edit — it still clicks.": "Arrastra una fila desde cualquier punto para reordenar, o presiona Editar: sigue siendo clicable.", + "Edit was clicked on {Name}, so the row did not take the press.": "Se presionó Editar en {Name}, así que la fila no tomó el clic.", "In a Popover": "En un Popover", "A list inside a popover that keeps focus. A drag begun inside it belongs to the list, Escape while dragging cancels the drag and leaves the popover open, and its keys move the item without leaving the popover.": "Una lista dentro de un popover que mantiene el foco. Un arrastre iniciado dentro pertenece a la lista, Escape durante el arrastre cancela el arrastre y deja el popover abierto, y sus teclas mueven el elemento sin salir del popover.", "Open": "Abrir" diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Debugging/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Debugging/.locales/es.json index a5e915516..e4d3d0c1f 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Debugging/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Debugging/.locales/es.json @@ -1,7 +1,7 @@ { "$localization": "SchemaVersion: 1.0.0; Culture: es;", "FormaInputInspectorPage": { - "Every key, press, wheel turn and drop on the page is resolved by one router to one owner. The panel on the side shows each decision as it is made: who owns the input, by which rule, and what stands active above what.": "Cada tecla, pulsación, giro de rueda y soltado en la página lo resuelve un único enrutador hacia un único propietario. El panel lateral muestra cada decisión al tomarse: quién posee la entrada, por qué regla, y qué está activo sobre qué.", + "Every key, press, wheel turn and drop on the page is resolved by one router to one owner. The panel on the side shows each decision as it is made: who owns the input, by which rule, and what stands active above what.": "Cada tecla, clic o toque, giro de rueda y soltado en la página lo resuelve un único enrutador hacia un único propietario. El panel lateral muestra cada decisión al tomarse: quién posee la entrada, por qué regla, y qué está activo sobre qué.", "Nested scopes": "Ámbitos anidados", "A grid routes the arrows, Home and End. Inside it, native controls keep the keys they consume, and a popup that is open keeps every key inside itself: its list routes the arrows, and nothing reaches the grid.": "Una cuadrícula enruta las flechas, Inicio y Fin. Dentro, los controles nativos conservan las teclas que consumen, y un popup abierto retiene cada tecla dentro de sí: su lista enruta las flechas y nada llega a la cuadrícula.", "Grid": "Cuadrícula", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Features/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Features/.locales/es.json index a35d25358..8d5c279d1 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Features/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Features/.locales/es.json @@ -24,13 +24,13 @@ "Every command is a plugin contribution. The composer's own sit in the built-in row; an editor either joins that row or declares one of its own; a plugin the host registered lands on the plugins bar ruled off beneath. Plain Text shows all three, while Source shows only its own, because both external plugins are registered under the Plain Text editor.": "Cada comando es una aportación de un complemento. Los propios del editor ocupan la fila integrada; un editor puede sumarse a esa fila o declarar una propia; un complemento registrado por el anfitrión aterriza en la barra de complementos separada debajo. Texto sin Formato muestra las tres, mientras que Origen solo muestra las suyas, porque ambos complementos externos están registrados bajo el editor de texto sin formato.", "Read-Only": "Solo Lectura", "Source Editor": "Editor de Código", - "An editor plugin bringing a canvas of its own: lines numbered in a gutter, and a Rename Symbol command that replaces whole-word occurrences throughout the document. Press F2 or use the Refactor row.": "Un complemento de editor que aporta su propio lienzo: líneas numeradas en un margen y un comando Renombrar Símbolo que sustituye las apariciones de palabra completa en todo el documento. Pulse F2 o use la fila Refactorizar.", + "An editor plugin bringing a canvas of its own: lines numbered in a gutter, and a Rename Symbol command that replaces whole-word occurrences throughout the document. Press F2 or use the Refactor row.": "Un complemento de editor que aporta su propio lienzo: líneas numeradas en un margen y un comando Renombrar Símbolo que sustituye las apariciones de palabra completa en todo el documento. Presiona F2 o usa la fila Refactorizar.", "Standard rich text preset with formatting, typography, headings, lists, and alignment.": "Preajuste estándar de texto enriquecido con formato, tipografía, encabezados, listas y alineación.", "Status Strip": "Barra de Estado", - "Word Count pushes a readout the plugin holds and mutates, shown beneath the canvas until the plugin disposes it. Press it again to take it back.": "Contar Palabras publica una lectura que el complemento conserva y modifica, mostrada bajo el lienzo hasta que el complemento la descarta. Pulse de nuevo para retirarla.", + "Word Count pushes a readout the plugin holds and mutates, shown beneath the canvas until the plugin disposes it. Press it again to take it back.": "Contar Palabras publica una lectura que el complemento conserva y modifica, mostrada bajo el lienzo hasta que el complemento la descarta. Presiónalo de nuevo para retirarla.", "Without Toolbar": "Sin Barra de Herramientas", "View Commands": "Comandos de Vista", - "Preview and Source are views the rich text editor offers over its document, reached from the tabs at the far end of the strip. Preview lays the document out at a chosen paper or screen size, prints it, and exports it; Source shows its markup one block per line. Maximize fills the viewport with whichever surface shows, and Selection Bar shows or hides the formatting bar that follows a selection; drag its handle to move it. Keyboard Shortcuts lists every shortcut the surface answers, and Ctrl+/ opens it too.": "Vista Previa y Código Fuente son vistas que el editor de texto enriquecido ofrece sobre su documento, accesibles desde las pestañas al final de la barra. Vista Previa presenta el documento en el tamaño de papel o pantalla elegido, lo imprime y lo exporta; Código Fuente muestra su marcado con un bloque por línea. Maximizar ocupa toda el área visible con la superficie que se muestra, y Barra de Selección muestra u oculta la barra de formato que sigue a una selección; arrastre su asa para moverla. Atajos de Teclado enumera todos los atajos a los que responde la superficie, y Ctrl+/ también lo abre.", + "Preview and Source are views the rich text editor offers over its document, reached from the tabs at the far end of the strip. Preview lays the document out at a chosen paper or screen size, prints it, and exports it; Source shows its markup one block per line. Maximize fills the viewport with whichever surface shows, and Selection Bar shows or hides the formatting bar that follows a selection; drag its handle to move it. Keyboard Shortcuts lists every shortcut the surface answers, and Ctrl+/ opens it too.": "Vista Previa y Código Fuente son vistas que el editor de texto enriquecido ofrece sobre su documento, accesibles desde las pestañas al final de la barra. Vista Previa presenta el documento en el tamaño de papel o pantalla elegido, lo imprime y lo exporta; Código Fuente muestra su marcado con un bloque por línea. Maximizar ocupa toda el área visible con la superficie que se muestra, y Barra de Selección muestra u oculta la barra de formato que sigue a una selección; arrastra su asa para moverla. Atajos de Teclado enumera todos los atajos a los que responde la superficie, y Ctrl+/ también lo abre.", "Every Plugin": "Todos los Complementos", "Images and Stored Pictures": "Imágenes e Imágenes Almacenadas", "Insert Image takes an address and nothing else. Browse Files opens the stored library beside it, limited here to pictures, and renders whichever one is chosen where the caret sits.": "Insertar Imagen admite una dirección y nada más. Examinar Archivos abre junto a ella la biblioteca almacenada, limitada aquí a imágenes, y muestra la que se elija donde esté el cursor.", @@ -38,7 +38,7 @@ "Browse Files lists every stored file here rather than pictures alone, inserting what the browser can render together with a link to it, and everything else as a link. Attach Files uploads from this device instead, and what arrives is carried beside the document the way an email carries its attachments.": "Examinar Archivos enumera aquí todos los archivos almacenados y no solo las imágenes, e inserta lo que el navegador puede mostrar junto con un enlace, y todo lo demás como un enlace. Adjuntar Archivos sube desde este dispositivo en cambio, y lo que llega se guarda junto al documento igual que un correo lleva sus adjuntos.", "The standard preset carries the plugins most documents need. This demo registers the defaults instead, the rich text editor's and the composer's, so what appears here is what a host gets without naming a single plugin.": "El ajuste preestablecido estándar incluye los complementos que la mayoría de los documentos necesitan. Esta demostración registra en su lugar los predeterminados, los del editor de texto enriquecido y los del propio editor, de modo que lo que aparece aquí es lo que un anfitrión obtiene sin nombrar un solo complemento.", "Gutter Markers": "Marcadores del Margen", - "Flag Long Paragraphs pushes a marker into the gutter beside every block over forty words, level with the block however the text wraps or scrolls; press a marker to land on its block, and press the command again to take the markers back.": "Marcar Párrafos Largos coloca un marcador en el margen junto a cada bloque de más de cuarenta palabras, a la altura del bloque aunque el texto se ajuste o se desplace; pulse un marcador para ir a su bloque, y pulse el comando de nuevo para retirar los marcadores.", + "Flag Long Paragraphs pushes a marker into the gutter beside every block over forty words, level with the block however the text wraps or scrolls; press a marker to land on its block, and press the command again to take the markers back.": "Marcar Párrafos Largos coloca un marcador en el margen junto a cada bloque de más de cuarenta palabras, a la altura del bloque aunque el texto se ajuste o se desplace; presiona un marcador para ir a su bloque, y presiona el comando de nuevo para retirar los marcadores.", "Subscript and Superscript": "Subíndice y Superíndice", "The basic formatting plugin offers subscript and superscript where its options include them, as a chemical formula or a footnote mark needs; the default formatting leaves them out. Ctrl+, and Ctrl+. apply them too.": "El complemento de formato básico ofrece subíndice y superíndice donde sus opciones los incluyen, como lo necesitan una fórmula química o una marca de nota al pie; el formato predeterminado los omite. Ctrl+, y Ctrl+. también los aplican." }, @@ -76,30 +76,30 @@ "The cards at their compact density, the thumbnail and the name alone, which is what a consumer shows as thumbnails.": "Las tarjetas en su densidad compacta, solo la miniatura y el nombre, que es lo que un consumidor muestra como miniaturas.", "This tab shows the tree as a view of the data view over a folder hierarchy: the folders as nodes under their parents, opened and closed from their disclosures and the keyboard, open on load where the host names them, and standing beside the grid as a sidebar, the data view's own or one the host places, whose chosen folder the grid shows the contents of.": "Esta pestaña muestra el árbol como vista de la vista de datos sobre una jerarquía de carpetas: las carpetas como nodos bajo sus padres, abiertos y cerrados desde sus flechas y el teclado, abiertos al cargar donde el anfitrión los nombra, y de pie junto a la tabla como barra lateral, la propia de la vista de datos o una que el anfitrión coloca, cuya carpeta elegida la tabla muestra por dentro.", "A Folder Tree Beside a Grid": "Un Árbol de Carpetas Junto a una Tabla", - "Choose a folder in the tree, or activate one in the grid, and the grid shows what it holds; the tree marks the current folder and the status names it. Arrow keys move among the nodes, the inline arrows open and close them, and typing a letter jumps to the next folder starting with it.": "Elija una carpeta en el árbol, o active una en la tabla, y la tabla muestra lo que contiene; el árbol marca la carpeta actual y el estado la nombra. Las flechas mueven entre los nodos, las flechas horizontales los abren y cierran, y escribir una letra salta a la siguiente carpeta que empieza con ella.", + "Choose a folder in the tree, or activate one in the grid, and the grid shows what it holds; the tree marks the current folder and the status names it. Arrow keys move among the nodes, the inline arrows open and close them, and typing a letter jumps to the next folder starting with it.": "Elige una carpeta en el árbol, o activa una en la tabla, y la tabla muestra lo que contiene; el árbol marca la carpeta actual y el estado la nombra. Las flechas mueven entre los nodos, las flechas horizontales los abren y cierran, y escribir una letra salta a la siguiente carpeta que empieza con ella.", "Back to the Roots": "Volver a la Raíz", "Folders": "Carpetas", "Kind": "Tipo", "Showing: {Folder}": "Mostrando: {Folder}", "the roots": "la raíz", "All Files": "Todos los Archivos", - "This tab shows the states the data view draws around its items: nothing to show, a source still answering, pages appended as the reader goes, a page that gives way when its items go, a selection its bounds refuse, and a tree node asking for its children.": "Esta pestaña muestra los estados que la vista de datos dibuja alrededor de sus elementos: nada que mostrar, una fuente que aún responde, páginas añadidas sobre la marcha, una página que cede cuando sus elementos se van, una selección que sus límites rechazan y un nodo del árbol que pide sus hijos.", + "This tab shows the states the data view draws around its items: nothing to show, a source still answering, pages appended as the reader goes, a page that gives way when its items go, a selection its bounds refuse, and a tree node asking for its children.": "Esta pestaña muestra los estados que la vista de datos dibuja alrededor de sus elementos: nada que mostrar, una fuente que aún responde, páginas agregadas sobre la marcha, una página que cede cuando sus elementos se van, una selección que sus límites rechazan y un nodo del árbol que pide sus hijos.", "Nothing to Show": "Nada que Mostrar", "A data view with no items shows the library's sentence, or what the caller gives it in its place; a tree over no nodes does the same.": "Una vista de datos sin elementos muestra la frase de la biblioteca, o lo que quien la usa le da en su lugar; un árbol sin nodos hace lo mismo.", "No products match the search.": "Ningún producto coincide con la búsqueda.", "A Slow Source": "Una Fuente Lenta", "A provider that takes a moment to answer. Before its first answer the data view shows it is loading; once it has items, moving to another page or refreshing keeps them in place under the busy state until the next answer arrives.": "Un proveedor que tarda un momento en responder. Antes de su primera respuesta la vista de datos muestra que está cargando; una vez que tiene elementos, ir a otra página o actualizar los mantiene en su sitio bajo el estado ocupado hasta que llega la siguiente respuesta.", "Refresh": "Actualizar", - "Pages Appended as You Go": "Páginas Añadidas Sobre la Marcha", - "A slow provider's pages appended after the items: from Load More, and as the box scrolls to the end of them. A page that fails leaves the items shown and offers itself again.": "Las páginas de un proveedor lento añadidas tras los elementos: desde Cargar Más, y al desplazarse la caja hasta el final de ellos. Una página que falla deja los elementos a la vista y se ofrece de nuevo.", + "Pages Appended as You Go": "Páginas Agregadas Sobre la Marcha", + "A slow provider's pages appended after the items: from Load More, and as the box scrolls to the end of them. A page that fails leaves the items shown and offers itself again.": "Las páginas de un proveedor lento agregadas tras los elementos: desde Cargar Más, y al desplazarse la caja hasta el final de ellos. Una página que falla deja los elementos a la vista y se ofrece de nuevo.", "Fail the Next Page": "Hacer Fallar la Página Siguiente", "A Hundred Thousand Items": "Cien Mil Elementos", "The list virtualizing over a hundred thousand products in a bounded box: each item a row of its own, only the rows near the viewport drawn, and a box to check on each.": "La lista virtualizando cien mil productos en una caja acotada: cada elemento en una fila propia, solo se dibujan las filas cercanas al área visible, y cada uno con una casilla para marcar.", "A Hundred Thousand Items, Selected by Row": "Cien Mil Elementos, Seleccionados por Fila", "The same list with the rows themselves selecting: a press selects, Ctrl or Cmd toggles and Shift extends a range, the arrows, Home and End walk the rows, and a row scrolled away keeps the focus.": "La misma lista con las propias filas seleccionando: un clic selecciona, Ctrl o Cmd alterna y Shift extiende un rango, las flechas, Inicio y Fin recorren las filas, y una fila desplazada fuera de vista conserva el foco.", "{Selected} selected.": "{Selected} seleccionados.", - "Thumbnails a Press Opens": "Miniaturas que Abre una Pulsación", - "The thumbnails take the focus with no selection on: Tab enters them once, the arrows move the focus alone, and Enter or a press opens a thumbnail. Select draws a box on each, a press or Space checks it, Enter still opens, and the focus stays on its thumbnail as the mode changes.": "Las miniaturas toman el foco sin ninguna selección: Tab entra en ellas una vez, las flechas mueven solo el foco, y Intro o una pulsación abren una miniatura. Seleccionar dibuja una casilla en cada una, una pulsación o Espacio la marca, Intro sigue abriendo, y el foco se queda en su miniatura al cambiar el modo.", + "Thumbnails a Press Opens": "Miniaturas que Abre un Clic o Toque", + "The thumbnails take the focus with no selection on: Tab enters them once, the arrows move the focus alone, and Enter or a press opens a thumbnail. Select draws a box on each, a press or Space checks it, Enter still opens, and the focus stays on its thumbnail as the mode changes.": "Las miniaturas toman el foco sin ninguna selección: Tab entra en ellas una vez, las flechas mueven solo el foco, y Enter o un clic abren una miniatura. Seleccionar dibuja una casilla en cada una, un clic o Espacio la marca, Enter sigue abriendo, y el foco se queda en su miniatura al cambiar el modo.", "Opened: {Name}": "Abierto: {Name}", "Select": "Seleccionar", "Done": "Listo", @@ -116,9 +116,9 @@ "A Hundred Thousand Nodes": "Cien Mil Nodos", "Ten folders of ten thousand files each: open them and the tree virtualizes over the nodes it shows, drawing only the rows near the viewport, each saying its level and its place among its siblings. End and Home reach the last and the first node however far they lie.": "Diez carpetas de diez mil archivos cada una: ábralas y el árbol virtualiza los nodos que muestra, dibujando solo las filas cercanas al área visible, cada una indicando su nivel y su lugar entre sus hermanos. Fin e Inicio alcanzan el último y el primer nodo, por lejos que estén.", "Boxes Over a Hundred Thousand Nodes": "Casillas sobre Cien Mil Nodos", - "The same archive with a box on each node, where pressing a node or moving to it with the arrows selects it. A box keeps its node on the page while it holds the focus, so the tree can scroll it out of view and back without the focus falling to the page, and the arrows carry on from it.": "El mismo archivo con una casilla en cada nodo, donde pulsar un nodo o llegar a él con las flechas lo selecciona. Una casilla mantiene su nodo en la página mientras tiene el foco, de modo que el árbol puede desplazarlo fuera de la vista y de vuelta sin que el foco caiga a la página, y las flechas continúan desde ella.", + "The same archive with a box on each node, where pressing a node or moving to it with the arrows selects it. A box keeps its node on the page while it holds the focus, so the tree can scroll it out of view and back without the focus falling to the page, and the arrows carry on from it.": "El mismo archivo con una casilla en cada nodo, donde hacer clic en un nodo o llegar a él con las flechas lo selecciona. Una casilla mantiene su nodo en la página mientras tiene el foco, de modo que el árbol puede desplazarlo fuera de la vista y de vuelta sin que el foco caiga a la página, y las flechas continúan desde ella.", "When Nodes Go Away": "Cuando los Nodos Desaparecen", - "The source changes while the tree is in use: each button acts three seconds after it is pressed, which leaves time to put the focus back on a node. When the node holding the focus goes away, the focus moves to the nearest node that remains, at the same level where it can, and the selection stays as it was.": "El origen cambia mientras se usa el árbol: cada botón actúa tres segundos después de pulsarlo, lo que deja tiempo para devolver el foco a un nodo. Cuando el nodo que tiene el foco desaparece, el foco pasa al nodo más cercano que queda, en el mismo nivel siempre que se pueda, y la selección se mantiene como estaba.", + "The source changes while the tree is in use: each button acts three seconds after it is pressed, which leaves time to put the focus back on a node. When the node holding the focus goes away, the focus moves to the nearest node that remains, at the same level where it can, and the selection stays as it was.": "El origen cambia mientras se usa el árbol: cada botón actúa tres segundos después de presionarlo, lo que deja tiempo para devolver el foco a un nodo. Cuando el nodo que tiene el foco desaparece, el foco pasa al nodo más cercano que queda, en el mismo nivel siempre que se pueda, y la selección se mantiene como estaba.", "Select Nodes": "Seleccionar Nodos", "Remove Reports": "Quitar Reports", "Remove Notes.txt": "Quitar Notes.txt", @@ -127,7 +127,7 @@ "Remove Everything": "Quitar Todo", "Archives": "Archivos", "The Page Giving Way": "La Página que Cede", - "Go to the last page, then take its only item away: a page that no longer exists gives way to the last page that does.": "Vaya a la última página y luego quite su único elemento: una página que ya no existe cede su lugar a la última que sí existe.", + "Go to the last page, then take its only item away: a page that no longer exists gives way to the last page that does.": "Ve a la última página y luego quita su único elemento: una página que ya no existe cede su lugar a la última que sí existe.", "Take the Last Item Away": "Quitar el Último Elemento", "Put Everything Back": "Devolver Todo", "A Bounded Selection": "Una Selección Acotada", @@ -143,7 +143,7 @@ "Mass-Select Checkboxes": "Casillas de Selección Múltiple", "{Selected} row(s) selected.": "{Selected} fila(s) seleccionada(s).", "Select-All Modes": "Modos de Seleccionar Todo", - "What the master checkbox reaches. From a menu, it selects the page and a menu beside it offers the page, the whole set or clearing; from the pager, the footer offers the whole set once the page is selected; direct selects the whole set at one press; none draws no master checkbox at all. The selection is kept across pages either way.": "Hasta dónde llega la casilla maestra. Desde un menú, selecciona la página y un menú a su lado ofrece la página, el conjunto completo o borrar; desde el paginador, el pie ofrece el conjunto completo una vez seleccionada la página; directo selecciona el conjunto completo con una sola pulsación; ninguno no dibuja casilla maestra alguna. La selección se conserva entre páginas en todos los casos.", + "What the master checkbox reaches. From a menu, it selects the page and a menu beside it offers the page, the whole set or clearing; from the pager, the footer offers the whole set once the page is selected; direct selects the whole set at one press; none draws no master checkbox at all. The selection is kept across pages either way.": "Hasta dónde llega la casilla maestra. Desde un menú, selecciona la página y un menú a su lado ofrece la página, el conjunto completo o borrar; desde el paginador, el pie ofrece el conjunto completo una vez seleccionada la página; directo selecciona el conjunto completo con un solo clic; ninguno no dibuja casilla maestra alguna. La selección se conserva entre páginas en todos los casos.", "None": "Ninguno", "Direct": "Directo", "From menu": "Desde menú", @@ -233,7 +233,7 @@ "Single Selection for a Cover Image": "Selección Única para Imagen de Portada", "With MaxSelection set to 1, picking any item immediately selects it alone. This one holds its collection through Resources, which is the simpler half of the contract and the right choice for a handful of items.": "Con MaxSelection establecido en 1, al elegir cualquier elemento se selecciona solo ese inmediatamente. Este explorador retiene su colección mediante Resources, la mitad más sencilla del contrato y la opción correcta para un puñado de elementos.", "A Picker That Keeps Its Choices": "Un Selector que Conserva sus Elecciones", - "With SelectOnOpen, the explorer is a picker: it keeps its choices as the reader moves between folders, and its count opens them for review, each with the folder it stands in and a way to remove it. Its accepted kinds name folders as well as images, so it offers Choose This Folder inside a folder, where a press on a folder still chooses it and Enter enters it.": "Con SelectOnOpen, el explorador es un selector: conserva sus elecciones mientras el lector pasa de una carpeta a otra, y su recuento las abre para revisarlas, cada una con la carpeta en la que está y una forma de quitarla. Sus tipos aceptados incluyen carpetas además de imágenes, así que ofrece Elegir Esta Carpeta dentro de una carpeta, donde pulsar una carpeta la sigue eligiendo y Enter entra en ella.", + "With SelectOnOpen, the explorer is a picker: it keeps its choices as the reader moves between folders, and its count opens them for review, each with the folder it stands in and a way to remove it. Its accepted kinds name folders as well as images, so it offers Choose This Folder inside a folder, where a press on a folder still chooses it and Enter enters it.": "Con SelectOnOpen, el explorador es un selector: conserva sus elecciones mientras el lector pasa de una carpeta a otra, y su recuento las abre para revisarlas, cada una con la carpeta en la que está y una forma de quitarla. Sus tipos aceptados incluyen carpetas además de imágenes, así que ofrece Elegir Esta Carpeta dentro de una carpeta, donde hacer clic en una carpeta la sigue eligiendo y Enter entra en ella.", "Details Columns": "Columnas de la Vista de Detalles", "A Library Too Large to Hold": "Una Biblioteca Demasiado Grande para Retener", "Twenty thousand items behind a provider. The explorer keeps only the items it is showing, and the folder never appears in the query because the page already knows it.": "Veinte mil elementos detrás de un proveedor. El explorador conserva solo los elementos que muestra, y la carpeta nunca aparece en la consulta porque la página ya la conoce.", @@ -241,8 +241,8 @@ "Infinite Scrolling Explorer": "Explorador con Desplazamiento Infinito", "Automatic Infinite Scrolling": "Desplazamiento Infinito Automático", "ExplorerInfiniteScrollMode.Automatic drops the button entirely: pages arrive as the reader scrolls, marked by a spinner while each one loads, with the running count left as the reader's sense of position.": "ExplorerInfiniteScrollMode.Automatic elimina el botón por completo: las páginas llegan mientras la persona se desplaza, señaladas por un indicador de carga, y el recuento en curso queda como su referencia de posición.", - "ExplorerInfiniteScrollMode.Manual appends the next page as the reader nears the end, and offers a button for anyone not using a pointer. The media scrolls inside the panel, so the toolbar and folder tree stay put.": "ExplorerInfiniteScrollMode.Manual añade la página siguiente cuando la persona se acerca al final, y ofrece un botón para quien no usa un puntero. Los medios se desplazan dentro del panel, así que la barra de herramientas y el árbol de carpetas quedan fijos.", - "DetailsColumns picks which optional columns the details view opens with beside the name; the columns menu in the toolbar lets the reader add or remove them and hide the header afterwards. Nothing wraps, so a narrow explorer scrolls sideways rather than squeezing a column out.": "DetailsColumns elige con qué columnas opcionales se abre la vista de detalles junto al nombre; el menú de columnas de la barra de herramientas permite al lector añadirlas o quitarlas y ocultar el encabezado después. Nada se ajusta a varias líneas, así que un explorador estrecho se desplaza en horizontal en lugar de expulsar una columna.", + "ExplorerInfiniteScrollMode.Manual appends the next page as the reader nears the end, and offers a button for anyone not using a pointer. The media scrolls inside the panel, so the toolbar and folder tree stay put.": "ExplorerInfiniteScrollMode.Manual agrega la página siguiente cuando la persona se acerca al final, y ofrece un botón para quien no usa un puntero. Los medios se desplazan dentro del panel, así que la barra de herramientas y el árbol de carpetas quedan fijos.", + "DetailsColumns picks which optional columns the details view opens with beside the name; the columns menu in the toolbar lets the reader add or remove them and hide the header afterwards. Nothing wraps, so a narrow explorer scrolls sideways rather than squeezing a column out.": "DetailsColumns elige con qué columnas opcionales se abre la vista de detalles junto al nombre; el menú de columnas de la barra de herramientas permite al lector agregarlas o quitarlas y ocultar el encabezado después. Nada se ajusta a varias líneas, así que un explorador estrecho se desplaza en horizontal en lugar de expulsar una columna.", "Columns": "Columnas", "All media": "Todos los medios", "Type": "Tipo", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Feedback/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Feedback/.locales/es.json index 0fdc7a008..4ef9ecc1e 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Feedback/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Feedback/.locales/es.json @@ -8,7 +8,7 @@ "Basic": "Básico", "The count against the limit, under the label the readout gives itself.": "La cantidad frente al límite, bajo la etiqueta que la lectura se da a sí misma.", "A Bar and a Note": "Una Barra y una Nota", - "The host names what is counted, asks for a bar and adds a line saying where the limit comes from.": "El anfitrión nombra lo que se cuenta, pide una barra y añade una línea que dice de dónde viene el límite.", + "The host names what is counted, asks for a bar and adds a line saying where the limit comes from.": "El anfitrión nombra lo que se cuenta, pide una barra y agrega una línea que dice de dónde viene el límite.", "Products": "Productos", "According to your hosting package.": "Según tu paquete de alojamiento.", "Nearing the Limit": "Acercándose al Límite", @@ -29,9 +29,9 @@ "Pages": "Páginas", "A Later Warning": "Una Advertencia Más Tardía", "On a large limit, 80% can leave plenty of room, so the host can raise the share; at 95%, 9,000 of 10,000 does not warn yet.": "En un límite grande, el 80% puede dejar mucho espacio, así que el anfitrión puede subir la proporción; al 95%, 9,000 de 10,000 todavía no advierte.", - "Adding Up to the Limit": "Añadir Hasta el Límite", - "Add and remove items to watch the readout change its state. The page stops adding at the limit, as an application would.": "Añade y quita elementos para ver cómo la lectura cambia de estado. La página deja de añadir en el límite, como lo haría una aplicación.", - "Add": "Añadir", + "Adding Up to the Limit": "Agregar Hasta el Límite", + "Add and remove items to watch the readout change its state. The page stops adding at the limit, as an application would.": "Agrega y quita elementos para ver cómo la lectura cambia de estado. La página deja de agregar en el límite, como lo haría una aplicación.", + "Add": "Agregar", "Remove": "Quitar" }, "FormaConfirmDialogPage": { @@ -85,7 +85,7 @@ "Scrim Click Disabled": "Clic en el velo deshabilitado", "Open (no scrim close)": "Abrir (sin cierre por velo)", "Must Use X or Button": "Debe usar X o el botón", - "Clicking the scrim does not close this dialog. Use the X button or the button below.": "Hacer clic en el velo no cierra este diálogo. Use el botón X o el botón de abajo.", + "Clicking the scrim does not close this dialog. Use the X button or the button below.": "Hacer clic en el velo no cierra este diálogo. Usa el botón X o el botón de abajo.", "A Menu Inside": "Un Menú Dentro", "A menu opened inside the dialog closes on the first Escape and leaves the dialog open; the next Escape closes the dialog.": "Un menú abierto dentro del diálogo se cierra con el primer Escape y deja el diálogo abierto; el siguiente Escape cierra el diálogo.", "Open Dialog With a Menu": "Abrir Diálogo con un Menú", @@ -98,7 +98,7 @@ "Basic": "Básico", "The popover follows its anchor when the page scrolls, and flips above it when there is no room below.": "El popover sigue a su ancla cuando la página se desplaza, y se coloca encima cuando no hay espacio debajo.", "Open": "Abrir", - "Anything can go here. Press Escape, or click outside, to close.": "Aquí puede ir cualquier cosa. Pulse Escape, o haga clic fuera, para cerrar.", + "Anything can go here. Press Escape, or click outside, to close.": "Aquí puede ir cualquier cosa. Presiona Escape, o haz clic fuera, para cerrar.", "Keeping Focus": "Mantener el foco", "With KeepsFocus, Tab and Shift+Tab move between the popover's own controls and wrap at either end, so the page behind it is never tabbed into by accident.": "Con KeepsFocus, Tab y Shift+Tab se mueven entre los controles del propio popover y dan la vuelta en ambos extremos, así que nunca se entra por accidente en la página de detrás.", "One": "Uno", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Inputs/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Inputs/.locales/es.json index 4f62b278e..9ec91ee96 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Inputs/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Inputs/.locales/es.json @@ -42,7 +42,7 @@ "Secondary": "Secundario" }, "FormaCurrencyInputPage": { - "A field for an amount in a currency the application names. The amount is typed as the reader's culture writes a number, the currency's symbol stands where that culture writes it, and the currency decides how many decimal places an amount carries.": "Un campo para un importe en una moneda que nombra la aplicación. El importe se escribe como la cultura del lector escribe un número, el símbolo de la moneda va donde esa cultura lo escribe, y la moneda decide cuántos decimales lleva un importe.", + "A field for an amount in a currency the application names. The amount is typed as the reader's culture writes a number, the currency's symbol stands where that culture writes it, and the currency decides how many decimal places an amount carries.": "Un campo para un monto en una moneda que nombra la aplicación. El monto se escribe como la cultura del lector escribe un número, el símbolo de la moneda va donde esa cultura lo escribe, y la moneda decide cuántos decimales lleva un monto.", "A price in US dollars, shown with two decimal places. A third place is reported rather than rounded.": "Un precio en dólares estadounidenses, mostrado con dos decimales. Un tercer decimal se informa en lugar de redondearse.", "Price": "Precio", "Other Currencies": "Otras Monedas", @@ -51,18 +51,18 @@ "Cost": "Costo", "Deposit": "Depósito", "Below Zero": "Bajo Cero", - "An amount can be negative, as a refund is, unless the host sets a least amount.": "Un importe puede ser negativo, como lo es un reembolso, salvo que el anfitrión fije un mínimo.", + "An amount can be negative, as a refund is, unless the host sets a least amount.": "Un monto puede ser negativo, como lo es un reembolso, salvo que el anfitrión fije un mínimo.", "Refund": "Reembolso", "More Places or Fewer": "Más Decimales o Menos", "A rate that needs four decimal places, and a price taken in whole dollars, shown without decimal places.": "Una tarifa que necesita cuatro decimales, y un precio en dólares enteros, mostrado sin decimales.", "Rate per Unit": "Tarifa por Unidad", "Budget": "Presupuesto", "Required in a Form": "Obligatorio en un Formulario", - "A currency input is a form input: submitting without an amount shows the validation message under it, and entering one clears it.": "Un campo de moneda es un campo de formulario: enviar sin un importe muestra el mensaje de validación debajo, e introducir uno lo quita.", + "A currency input is a form input: submitting without an amount shows the validation message under it, and entering one clears it.": "Un campo de moneda es un campo de formulario: enviar sin un monto muestra el mensaje de validación debajo, e ingresar uno lo quita.", "Minimum Order": "Pedido Mínimo", "A minimum order is required.": "Se requiere un pedido mínimo.", - "An Amount That Cannot Be Empty": "Un Importe que No Puede Quedar Vacío", - "Bound to an amount rather than a nullable one, the field always holds an amount: clearing it reports the field and keeps the amount it held until another is entered.": "Vinculado a un importe en lugar de uno que admite vacío, el campo siempre tiene un importe: borrarlo informa el campo y conserva el importe que tenía hasta que se introduce otro.", + "An Amount That Cannot Be Empty": "Un Monto que No Puede Quedar Vacío", + "Bound to an amount rather than a nullable one, the field always holds an amount: clearing it reports the field and keeps the amount it held until another is entered.": "Vinculado a un monto en lugar de uno que admite vacío, el campo siempre tiene un monto: borrarlo informa el campo y conserva el monto que tenía hasta que se ingresa otro.", "Free Shipping From": "Envío Gratis Desde", "Disabled and Read-Only": "Deshabilitado y de Solo Lectura", "Read-Only": "Solo Lectura" @@ -105,7 +105,7 @@ "FormaDateTimePickerPage": { "Disabled and Read-Only": "Deshabilitado y de Solo Lectura", "Read-Only": "Solo Lectura", - "A field for one value holding a date and its time: the date picked from a calendar, the time typed or chosen from a list of suggested times, under one label. Either half entered alone is held until the other comes, and reported once the focus leaves the field.": "Un campo para un valor que contiene una fecha y su hora: la fecha elegida en un calendario y la hora escrita o elegida de una lista de horas sugeridas, bajo una sola etiqueta. Una mitad introducida sola se guarda hasta que llega la otra, y se informa cuando el foco sale del campo.", + "A field for one value holding a date and its time: the date picked from a calendar, the time typed or chosen from a list of suggested times, under one label. Either half entered alone is held until the other comes, and reported once the focus leaves the field.": "Un campo para un valor que contiene una fecha y su hora: la fecha elegida en un calendario y la hora escrita o elegida de una lista de horas sugeridas, bajo una sola etiqueta. Una mitad ingresada sola se guarda hasta que llega la otra, y se informa cuando el foco sale del campo.", "A date with a time that can be empty. Pick a date and leave the field without a time, and the field says the time is missing.": "Una fecha con hora que puede quedar vacía. Elige una fecha y sal del campo sin una hora, y el campo indica que falta la hora.", "Starts": "Empieza", "Within Bounds": "Dentro de los Límites", @@ -123,7 +123,7 @@ "Delivery": "Entrega", "A delivery date and time are required.": "Se requieren la fecha y la hora de entrega.", "A Value That Cannot Be Empty": "Un Valor que No Puede Quedar Vacío", - "Bound to a date with a time rather than a nullable one, the field always holds a value: clearing a half reports it and keeps the value until the half is entered again.": "Vinculado a una fecha con hora en lugar de una que admite vacío, el campo siempre tiene un valor: borrar una mitad la informa y conserva el valor hasta que se vuelve a introducir.", + "Bound to a date with a time rather than a nullable one, the field always holds a value: clearing a half reports it and keeps the value until the half is entered again.": "Vinculado a una fecha con hora en lugar de una que admite vacío, el campo siempre tiene un valor: borrar una mitad la informa y conserva el valor hasta que se vuelve a ingresar.", "Reminder": "Recordatorio" }, "FormaMultiSelectPage": { @@ -152,7 +152,7 @@ "kilograms": "kilogramos", "Required in a Form": "Obligatorio en un Formulario", "A field for a number, typed the way the formatting culture writes it and stepped with the up and down arrows. A number it cannot read, or one past its limits, is reported under the field and never written, so the model keeps the last number that was.": "Un campo para un número, escrito como lo escribe la cultura de formato y ajustado con las flechas arriba y abajo. Un número que no puede leer, o uno fuera de sus límites, se informa debajo del campo y nunca se escribe, así que el modelo conserva el último número válido.", - "A whole number that can be empty. Type one, or press the up and down arrows; a word in place of a number is reported under the field.": "Un número entero que puede quedar vacío. Escribe uno, o pulsa las flechas arriba y abajo; una palabra en lugar de un número se informa debajo del campo.", + "A whole number that can be empty. Type one, or press the up and down arrows; a word in place of a number is reported under the field.": "Un número entero que puede quedar vacío. Escribe uno, o presiona las flechas arriba y abajo; una palabra en lugar de un número se informa debajo del campo.", "Quantity": "Cantidad", "A Fraction in Steps": "Una Fracción en Pasos", "A decimal filled in already, stepped by half a unit and never below zero. It is written with the separators of the formatting culture, and a thousands separator is read only where it groups the digits as the culture does, so 1,234 is taken while 1,5 is reported rather than guessed at.": "Un decimal ya rellenado, ajustado de media unidad en media unidad y nunca por debajo de cero. Se escribe con los separadores de la cultura de formato, y un separador de miles se lee solo donde agrupa los dígitos como lo hace la cultura, así que 1,234 se acepta mientras que 1,5 se informa en lugar de adivinarse.", @@ -172,8 +172,8 @@ "Disabled and Read-Only": "Deshabilitado y de Solo Lectura", "Read-Only": "Solo Lectura", "Without a Label": "Sin Etiqueta", - "Without a Label the input stands bare and level with a button, as a quantity beside an Add button does, and needs no form around it.": "Sin Label el campo queda desnudo y a la altura de un botón, como una cantidad junto a un botón de añadir, y no necesita un formulario alrededor.", - "Add": "Añadir" + "Without a Label the input stands bare and level with a button, as a quantity beside an Add button does, and needs no form around it.": "Sin Label el campo queda desnudo y a la altura de un botón, como una cantidad junto a un botón de agregar, y no necesita un formulario alrededor.", + "Add": "Agregar" }, "FormaPasswordBoxPage": { "A password field with a toggle that reveals the typed value, sharing FormaTextBox's floating label and validation chrome.": "Un campo de contraseña con un interruptor que revela el valor escrito, compartiendo la etiqueta flotante y el estilo de validación de FormaTextBox.", @@ -202,11 +202,11 @@ "Advice can accompany the meter, naming each criterion the value has yet to earn. Every line disappears as it is met, so the list empties rather than scolding.": "Las indicaciones pueden acompañar al medidor y nombrar cada criterio que el valor aún no cumple. Cada línea desaparece al cumplirse, de modo que la lista se vacía en lugar de regañar." }, "FormaSearchBoxPage": { - "A search field with a leading glyph and a clear button that appears once it holds a value. It needs no surrounding form: a caller binds Value and reacts through OnSearch, either on every keystroke or after a debounce.": "Un campo de búsqueda con un glifo inicial y un botón de limpiar que aparece en cuanto contiene un valor. No necesita un formulario que lo envuelva: quien lo usa vincula Value y reacciona mediante OnSearch, ya sea en cada pulsación o tras un retardo.", - "Every keystroke reports instantly, filtering the list as you type. Clearing the field — by the button or by hand — reports an empty search right away.": "Cada pulsación se notifica al instante, filtrando la lista mientras escribes. Vaciar el campo, con el botón o a mano, notifica una búsqueda vacía de inmediato.", + "A search field with a leading glyph and a clear button that appears once it holds a value. It needs no surrounding form: a caller binds Value and reacts through OnSearch, either on every keystroke or after a debounce.": "Un campo de búsqueda con un glifo inicial y un botón de limpiar que aparece en cuanto contiene un valor. No necesita un formulario que lo envuelva: quien lo usa vincula Value y reacciona mediante OnSearch, ya sea en cada pulsación de tecla o tras un retardo.", + "Every keystroke reports instantly, filtering the list as you type. Clearing the field — by the button or by hand — reports an empty search right away.": "Cada pulsación de tecla se notifica al instante, filtrando la lista mientras escribes. Vaciar el campo, con el botón o a mano, notifica una búsqueda vacía de inmediato.", "Search fruit...": "Buscar fruta...", "Debounced Search": "Búsqueda con Retardo", - "DebounceDelay holds OnSearch back until typing pauses, so a handful of keystrokes reports once rather than once each. Pressing Enter searches immediately without waiting.": "DebounceDelay retiene OnSearch hasta que la escritura se detiene, de modo que varias pulsaciones se notifican una sola vez en lugar de una por cada una. Pulsar Enter busca de inmediato sin esperar.", + "DebounceDelay holds OnSearch back until typing pauses, so a handful of keystrokes reports once rather than once each. Pressing Enter searches immediately without waiting.": "DebounceDelay retiene OnSearch hasta que la escritura se detiene, de modo que varias pulsaciones de tecla se notifican una sola vez en lugar de una por cada una. Presionar Enter busca de inmediato sin esperar.", "Last search": "Última búsqueda", "(none)": "(ninguna)", "Searches performed": "Búsquedas realizadas", @@ -232,7 +232,7 @@ "Closed": "Cerrado", "Apply Filters": "Aplicar Filtros", "Filters applied.": "Filtros aplicados.", - "Choose the date to search from.": "Elija la fecha desde la que buscar." + "Choose the date to search from.": "Elige la fecha desde la que buscar." }, "FormaSelectPage": { "A themed single-select: a trigger button opening an anchored, keyboard-navigable option list. The popover stays anchored to its trigger wherever the page scrolls.": "Un select de valor único con estilo propio: un botón activador que abre una lista de opciones anclada y navegable con teclado. La lista permanece anclada a su activador aunque la página se desplace.", @@ -279,15 +279,15 @@ "Comment": "Comentario", "Validate": "Validar", "Updating on Change": "Actualización al Cambiar", - "A long text reaches the component as its edit commits: as the field loses the focus, or before a shortcut or a button press runs. The count still follows every keystroke, kept in the browser, so the whole text never travels with each one.": "Un texto largo llega al componente cuando se confirma su edición: cuando el campo pierde el foco, o antes de que se ejecute un atajo o una pulsación de botón. El recuento sigue cada pulsación de tecla, llevado en el navegador, de modo que el texto completo nunca viaja con cada una.", + "A long text reaches the component as its edit commits: as the field loses the focus, or before a shortcut or a button press runs. The count still follows every keystroke, kept in the browser, so the whole text never travels with each one.": "Un texto largo llega al componente cuando se confirma su edición: cuando el campo pierde el foco, o antes de que se ejecute un atajo o un clic en un botón. El recuento sigue cada pulsación de tecla, llevado en el navegador, de modo que el texto completo nunca viaja con cada una.", "Terms of Service": "Términos del Servicio", "Save": "Guardar", "Saved": "Guardado" }, "FormaTextBoxPage": { - "A plain single-line text field: the box every Forma input draws, without the floating label and validation chrome FormaField adds. It needs no surrounding form, which is what makes it the one to reach for in a toolbar, a filter row or a grid cell.": "Un campo de texto sencillo de una sola línea: el recuadro que dibuja todo campo de Forma, sin la etiqueta flotante ni el marco de validación que añade FormaField. No necesita un formulario que lo envuelva, y eso es justo lo que lo hace idóneo para una barra de herramientas, una fila de filtros o una celda de tabla.", + "A plain single-line text field: the box every Forma input draws, without the floating label and validation chrome FormaField adds. It needs no surrounding form, which is what makes it the one to reach for in a toolbar, a filter row or a grid cell.": "Un campo de texto sencillo de una sola línea: el recuadro que dibuja todo campo de Forma, sin la etiqueta flotante ni el marco de validación que agrega FormaField. No necesita un formulario que lo envuelva, y eso es justo lo que lo hace idóneo para una barra de herramientas, una fila de filtros o una celda de tabla.", "No EditForm anywhere on this section — the field binds and updates on its own.": "No hay ningún EditForm en esta sección: el campo se vincula y se actualiza por sí solo.", - "Enter a name...": "Introduce un nombre...", + "Enter a name...": "Ingresa un nombre...", "Acme Corp": "Acme S.A.", "Locked by an administrator": "Bloqueado por un administrador", "Generated on save": "Se genera al guardar", @@ -318,14 +318,14 @@ "Once labeled it is the same FormaField that wraps FormaPasswordBox and FormaTextArea, so the label, the box and the validation message are drawn by one component rather than three that could drift.": "Una vez etiquetado es el mismo FormaField que envuelve a FormaPasswordBox y a FormaTextArea, así que la etiqueta, el recuadro y el mensaje de validación los dibuja un solo componente y no tres que podrían divergir.", "Slug": "Identificador de URL", "With no label to stack above it and no margin of its own, the field sits on one line beside a button. This one caps its length at twenty characters.": "Sin una etiqueta que se apile encima ni márgenes propios, el campo se sitúa en una línea junto a un botón. Este limita su longitud a veinte caracteres.", - "Add a tag...": "Añadir una etiqueta...", - "Add": "Añadir", + "Add a tag...": "Agregar una etiqueta...", + "Add": "Agregar", "Asking for the Right Keyboard": "Pedir el Teclado Adecuado", "InputMode tells a touch device which keyboard to raise, and AutoComplete tells the browser what the field holds so it can fill it. Neither changes what the box accepts — they only make it quicker to fill on a phone. Open these on a touch device to see the keyboard change.": "InputMode le dice a un dispositivo táctil qué teclado abrir, y AutoComplete le dice al navegador qué contiene el campo para que pueda rellenarlo. Ninguno cambia lo que el recuadro acepta: solo hacen más rápido rellenarlo en un teléfono. Abre estos en un dispositivo táctil para ver cómo cambia el teclado.", "Telephone": "Teléfono", "Email": "Correo electrónico", "Quantity": "Cantidad", - "Amount": "Importe", + "Amount": "Monto", "The Kind of Text Held": "El Tipo de Texto Contenido", "Type covers only the kinds a text box draws itself. A date, a number or a color belongs to the component built for it, where the browser supplies the editing surface, so those types cannot be set here at all.": "Type abarca solo los tipos que un cuadro de texto dibuja por sí mismo. Una fecha, un número o un color pertenecen al componente creado para ello, donde el navegador aporta la superficie de edición, así que esos tipos no pueden fijarse aquí en absoluto.", "Plain Text": "Texto Simple", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Layout/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Layout/.locales/es.json index 3ad7b20ec..372614efd 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Layout/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Layout/.locales/es.json @@ -67,9 +67,9 @@ "The preview would stand here.": "La vista previa estaría aquí.", "A frame with chrome: a title bar carrying the icon, the title and the host's commands as the frame's drag region, then an optional header band, the body, and an optional footer band. It is laid out like any frame, and placed, it is moved, resized and maximized like one.": "Un marco con cromo: una barra de título que lleva el icono, el título y los comandos del anfitrión como región de arrastre del marco, luego una banda de encabezado opcional, el cuerpo y una banda de pie opcional. Se dispone como cualquier marco y, colocado, se mueve, redimensiona y maximiza como uno.", "Two titled frames stand in a horizontal stack with a splitter in the seam between them. The second wears a header band and a footer band.": "Dos marcos con título están en una pila horizontal con un divisor en la unión entre ellos. El segundo lleva una banda de encabezado y una banda de pie.", - "Hidden, the chrome leaves the layout and keeps its content, so what was typed is still there when it returns. Disabled, it keeps its place and takes no input: its commands and the button in its body cannot be pressed.": "Oculto, el cromo sale de la disposición y conserva su contenido, así que lo escrito sigue ahí cuando vuelve. Deshabilitado, conserva su lugar y no acepta entrada: sus comandos y el botón de su cuerpo no pueden pulsarse.", + "Hidden, the chrome leaves the layout and keeps its content, so what was typed is still there when it returns. Disabled, it keeps its place and takes no input: its commands and the button in its body cannot be pressed.": "Oculto, el cromo sale de la disposición y conserva su contenido, así que lo escrito sigue ahí cuando vuelve. Deshabilitado, conserva su lugar y no acepta entrada: sus comandos y el botón de su cuerpo no pueden presionarse.", "A body can hold a stack of titled frames, each with its own title bar.": "Un cuerpo puede contener una pila de marcos con título, cada uno con su propia barra de título.", - "Given a placement, the chrome stands in the viewport and its title bar is the drag region: drag it, focus it and use the arrow keys, pull its edges. Its host's maximize command fills the viewport and returns.": "Con una colocación, el cromo está en la ventana de visualización y su barra de título es la región de arrastre: arrástrela, enfóquela y use las flechas, tire de sus bordes. El comando de maximizar de su anfitrión llena la ventana de visualización y vuelve.", + "Given a placement, the chrome stands in the viewport and its title bar is the drag region: drag it, focus it and use the arrow keys, pull its edges. Its host's maximize command fills the viewport and returns.": "Con una colocación, el cromo está en la ventana de visualización y su barra de título es la región de arrastre: arrástrala, enfócala y usa las flechas, tira de sus bordes. El comando de maximizar de su anfitrión llena la ventana de visualización y vuelve.", "Open Notes": "Abrir Notas", "Notes": "Notas", "Notes kept beside the page.": "Notas guardadas junto a la página.", @@ -108,8 +108,8 @@ "Archive": "Archivar", "Delete": "Eliminar", "Commands That Change": "Comandos Que Cambian", - "A bar notices its commands being added or removed, not only the browser window being resized, so the arrows appear the moment the bar stops fitting.": "Una barra advierte que se añaden o se quitan comandos, no solo que cambia el tamaño de la ventana del navegador, así que las flechas aparecen en el momento en que la barra deja de caber.", - "Add Commands": "Añadir Comandos", + "A bar notices its commands being added or removed, not only the browser window being resized, so the arrows appear the moment the bar stops fitting.": "Una barra advierte que se agregan o se quitan comandos, no solo que cambia el tamaño de la ventana del navegador, así que las flechas aparecen en el momento en que la barra deja de caber.", + "Add Commands": "Agregar Comandos", "Remove Commands": "Quitar Comandos", "A Bar That Fits": "Una Barra Que Cabe", "With room to spare there is nothing to scroll, so no arrows are drawn at all rather than sitting there permanently dimmed.": "Con espacio de sobra no hay nada que desplazar, así que no se dibuja flecha alguna en lugar de dejarlas ahí atenuadas para siempre.", @@ -129,7 +129,7 @@ "Two frames stand in a horizontal stack, each holding whatever its host gives it; without a placement, a frame is laid out like any backdrop.": "Dos marcos están en una pila horizontal, cada uno con lo que su anfitrión le da; sin colocación, un marco se dispone como cualquier fondo.", "A frame holds whatever its host gives it.": "Un marco contiene lo que su anfitrión le da.", "Another frame, laid out beside it.": "Otro marco, dispuesto a su lado.", - "Given a placement, the frame stands in the viewport. Drag it by the strip at its top, pull any edge or corner, or focus the strip and use the arrow keys, holding Shift to resize. Maximized it fills the viewport; locked it stays where it is; without a name, the strip announces it as the frame.": "Con una colocación, el marco está en la ventana de visualización. Arrástrelo por la franja de arriba, tire de cualquier borde o esquina, o enfoque la franja y use las flechas, manteniendo Shift para redimensionar. Maximizado llena la ventana de visualización; bloqueado se queda donde está; sin nombre, la franja lo anuncia como el marco.", + "Given a placement, the frame stands in the viewport. Drag it by the strip at its top, pull any edge or corner, or focus the strip and use the arrow keys, holding Shift to resize. Maximized it fills the viewport; locked it stays where it is; without a name, the strip announces it as the frame.": "Con una colocación, el marco está en la ventana de visualización. Arrástralo por la franja de arriba, tira de cualquier borde o esquina, o enfoca la franja y usa las flechas, manteniendo Shift para redimensionar. Maximizado llena la ventana de visualización; bloqueado se queda donde está; sin nombre, la franja lo anuncia como el marco.", "Open a Placed Frame": "Abrir un Marco Colocado", "Movable": "Movible", "Resizable": "Redimensionable", @@ -149,7 +149,7 @@ "Content That Fits": "Contenido Que Cabe", "With room to spare there is nothing to scroll, so neither form draws any control.": "Con espacio de sobra no hay nada que desplazar, así que ninguna forma dibuja control alguno.", "A Frozen Column": "Una Columna Fijada", - "The first column of this table is frozen, so it stays put while the other columns scroll, and the back arrow stands where it ends rather than beneath it, and each arrow press brings the next column into place.": "La primera columna de esta tabla está fijada, así que se queda en su lugar mientras las demás se desplazan, y la flecha de retroceso se sitúa donde termina en vez de debajo de ella, y cada pulsación de una flecha trae la siguiente columna a su lugar.", + "The first column of this table is frozen, so it stays put while the other columns scroll, and the back arrow stands where it ends rather than beneath it, and each arrow press brings the next column into place.": "La primera columna de esta tabla está fijada, así que se queda en su lugar mientras las demás se desplazan, y la flecha de retroceso se sitúa donde termina en vez de debajo de ella, y cada clic en una flecha trae la siguiente columna a su lugar.", "Rider": "Ciclista", "Up and Down": "Arriba y Abajo", "The same box along the block axis, by the scrollbar and by arrows. The header row is frozen, so it stays at the top while the rows scroll under it.": "La misma caja a lo largo del eje de bloque, con barra de desplazamiento y con flechas. La fila de encabezado está fijada, así que permanece arriba mientras las filas se desplazan debajo.", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Libraries/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Libraries/.locales/es.json index 675f86acf..163b6e0eb 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Libraries/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Libraries/.locales/es.json @@ -50,7 +50,7 @@ "Format": "Formato", "Arguments": "Argumentos", "Locale Files from the Host": "Archivos de Localización desde el Anfitrión", - "A host lays its own files in a .locales folder beside the application, to reword a string an assembly ships or to add a language it never had. Each key below is localized beside this page and again in the Showcase's .locales folder, and the folder wins; the last key exists in the folder alone.": "Un anfitrión coloca sus propios archivos en una carpeta .locales junto a la aplicación, para reformular una cadena que un ensamblado incluye o añadir un idioma que nunca tuvo. Cada clave de abajo se localiza junto a esta página y otra vez en la carpeta .locales del Showcase, y la carpeta gana; la última clave existe solo en la carpeta.", + "A host lays its own files in a .locales folder beside the application, to reword a string an assembly ships or to add a language it never had. Each key below is localized beside this page and again in the Showcase's .locales folder, and the folder wins; the last key exists in the folder alone.": "Un anfitrión coloca sus propios archivos en una carpeta .locales junto a la aplicación, para reformular una cadena que un ensamblado incluye o agregar un idioma que nunca tuvo. Cada clave de abajo se localiza junto a esta página y otra vez en la carpeta .locales del Showcase, y la carpeta gana; la última clave existe solo en la carpeta.", "Beside the Page": "Junto a la Página", "From the Host's Folder": "Desde la Carpeta del Anfitrión", "File": "Archivo", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Media/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Media/.locales/es.json index 9307b9f65..9ff104a80 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Media/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Media/.locales/es.json @@ -13,7 +13,7 @@ "The still comes from the host's own server, never from the video's service — a poster fetched from the service would give away the visit the play control is there to withhold. It also stands in for a self-hosted file before it loads.": "La imagen viene del servidor del propio sitio, nunca del servicio del video: una imagen traída del servicio delataría la visita que el control de reproducción existe para retener. También aparece en un archivo propio antes de que se cargue.", "Every service demo below sets DeferLoading to false so its player can be reviewed at a glance. Left alone, each would wait behind a play control, as the section on holding a player back shows.": "Cada demostración de servicio de abajo pone DeferLoading en false para que su reproductor se pueda revisar de un vistazo. Sin eso, cada una esperaría detrás de un control de reproducción, como muestra la sección sobre retener el reproductor.", "Holding a Player Back Until It Is Asked For": "Retener el Reproductor hasta que Se lo Pida", - "By default nothing is fetched from a hosting service until a reader presses play, so an article page carrying an embed leaks neither an address nor a visit. Autoplay overrides it, and a self-hosted file never needs it.": "De forma predeterminada no se descarga nada del servicio hasta que alguien pulsa reproducir, así que una página de artículo con una inserción no filtra ni una dirección ni una visita. La reproducción automática lo anula, y un archivo propio nunca lo necesita.", + "By default nothing is fetched from a hosting service until a reader presses play, so an article page carrying an embed leaks neither an address nor a visit. Autoplay overrides it, and a self-hosted file never needs it.": "De forma predeterminada no se descarga nada del servicio hasta que alguien presiona reproducir, así que una página de artículo con una inserción no filtra ni una dirección ni una visita. La reproducción automática lo anula, y un archivo propio nunca lo necesita.", "Sample TikTok video": "Video de TikTok de ejemplo", "Sample Instagram post": "Publicación de Instagram de ejemplo", "Sample Facebook video": "Video de Facebook de ejemplo", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Menus/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Menus/.locales/es.json index 3ad73bd2a..d7234d738 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Menus/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Menus/.locales/es.json @@ -64,7 +64,7 @@ "Unavailable actions": "Acciones no disponibles" }, "FormaShareMenuPage": { - "A share menu over one subject. The social networks and a download make up the baseline, a consumer adds its own actions beside them, and everything past the primary row waits behind More. Where the platform offers a native share surface, one entry hands the subject to it.": "Un menú de compartir sobre un único elemento. Las redes sociales y una descarga forman la base, un consumidor añade sus propias acciones junto a ellas, y todo lo que queda fuera de la fila principal espera tras Más. Donde la plataforma ofrece una superficie de compartir nativa, una entrada le entrega el elemento.", + "A share menu over one subject. The social networks and a download make up the baseline, a consumer adds its own actions beside them, and everything past the primary row waits behind More. Where the platform offers a native share surface, one entry hands the subject to it.": "Un menú de compartir sobre un único elemento. Las redes sociales y una descarga forman la base, un consumidor agrega sus propias acciones junto a ellas, y todo lo que queda fuera de la fila principal espera tras Más. Donde la plataforma ofrece una superficie de compartir nativa, una entrada le entrega el elemento.", "An Address": "Una Dirección", "A subject with an address gets the full baseline: the networks, email, and copying the link.": "Un elemento con dirección recibe la base completa: las redes, el correo y copiar el enlace.", "A File": "Un Archivo", @@ -72,11 +72,11 @@ "Sent to Vault": "Enviado a Vault", "nothing yet": "nada todavía", "A Picture": "Una Imagen", - "A picture keeps the networks and adds the board that pins media, pointed at the image itself.": "Una imagen conserva las redes y añade el tablero que fija medios, apuntando a la propia imagen.", + "A picture keeps the networks and adds the board that pins media, pointed at the image itself.": "Una imagen conserva las redes y agrega el tablero que fija medios, apuntando a la propia imagen.", "A Contact": "Un Contacto", "A contact is reached by email and saved as a card, not posted to a network.": "A un contacto se le llega por correo y se guarda como tarjeta, no se publica en una red.", "Consumer Actions": "Acciones del Consumidor", - "A consumer adds commands of its own behind More, each raising its command through one callback; the networks bar and the built-in commands stay as they are.": "Un consumidor añade comandos propios tras Más, cada uno lanzando su comando a través de un único callback; la barra de redes y los comandos integrados quedan como están.", + "A consumer adds commands of its own behind More, each raising its command through one callback; the networks bar and the built-in commands stay as they are.": "Un consumidor agrega comandos propios tras Más, cada uno lanzando su comando a través de un único callback; la barra de redes y los comandos integrados quedan como están.", "Last command": "Último comando", "none yet": "ninguno todavía", "Icon-Only Trigger": "Disparador de Solo Icono", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Navigation/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Navigation/.locales/es.json index 747126477..c5fd01517 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Navigation/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Navigation/.locales/es.json @@ -1,7 +1,7 @@ { "$localization": "SchemaVersion: 1.0.0; Culture: es;", "FormaBreadcrumbPage": { - "A trail of segments that link, click, or sit static depending on what the caller wires up, with an optional dropdown of alternatives and drop-target events per segment.": "Una sucesión de segmentos que enlazan, se pulsan o quedan como texto estático según lo que conecte quien lo usa, con un menú desplegable opcional de alternativas y eventos de destino de colocación por segmento.", + "A trail of segments that link, click, or sit static depending on what the caller wires up, with an optional dropdown of alternatives and drop-target events per segment.": "Una sucesión de segmentos que enlazan, se presionan o quedan como texto estático según lo que conecte quien lo usa, con un menú desplegable opcional de alternativas y eventos de destino de colocación por segmento.", "Site Navigation": "Navegación del Sitio", "Every segment but the last carries a Url, so it renders as a real link; the last carries none and stands as static text — no OnItemClick is wired at all.": "Todos los segmentos salvo el último llevan una Url, así que se muestran como un enlace real; el último no lleva ninguna y queda como texto estático: no se conecta OnItemClick en absoluto.", "Home": "Inicio", @@ -35,7 +35,7 @@ "Navigation Input": "Entrada de Navegación", "Navigation input": "Entrada de navegación", "The navigation input takes the place of the steps when the option asks for it, past the page count the option allows steps for — fifty unless told otherwise — or wherever seven steps do not fit. It shows the page the reader is on, the navigation buttons move it one page at a time, and a typed page goes there on Enter or the Go button.": "La entrada de navegación ocupa el lugar de los pasos cuando la opción lo pide, pasado el número de páginas que la opción permite con pasos — cincuenta salvo que se indique otro — o donde no caben siete pasos. Muestra la página en la que está el lector, los botones de navegación la mueven de una en una, y una página escrita va allí con Enter o el botón Ir.", - "With more pages than fit, the steps show the current page and the four after it, then the last. The navigation buttons move a whole run of steps, so holding one walks the list quickly; a step goes straight to its page.": "Cuando hay más páginas de las que caben, los pasos muestran la página actual y las cuatro siguientes, y luego la última. Los botones de navegación mueven un tramo entero de pasos, así que mantener uno pulsado recorre la lista deprisa; un paso va directo a su página.", + "With more pages than fit, the steps show the current page and the four after it, then the last. The navigation buttons move a whole run of steps, so holding one walks the list quickly; a step goes straight to its page.": "Cuando hay más páginas de las que caben, los pasos muestran la página actual y las cuatro siguientes, y luego la última. Los botones de navegación mueven un tramo entero de pasos, así que mantener uno presionado recorre la lista rápido; un paso va directo a su página.", "Without the Go Button": "Sin el Botón Ir", "Without the Go button": "Sin el botón Ir", "Wheel Scroll on Hover": "Rueda al Pasar el Puntero", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Symbols/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Symbols/.locales/es.json index 8371b83e1..060dd1fdb 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Symbols/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Symbols/.locales/es.json @@ -27,17 +27,17 @@ "An emoji carrying meaning of its own takes a label, which announces it as an image rather than leaving it silent.": "Un emoji que aporta significado propio lleva una etiqueta, que lo anuncia como imagen en lugar de dejarlo mudo.", "Stage completed": "Etapa completada", "Weather warning": "Aviso meteorológico", - "Medical car": "Coche médico", - "This tab draws them from the Twemoji artwork package, which a host adds and registers itself: one drawing per emoji, identical on every device, fetched as a sprite sheet the first time one of its emoji is drawn.": "Esta pestaña los dibuja desde el paquete de arte Twemoji, que la aplicación añade y registra por su cuenta: un dibujo por emoji, idéntico en cada dispositivo, descargado como hoja de sprites la primera vez que se dibuja uno de sus emojis." + "Medical car": "Auto médico", + "This tab draws them from the Twemoji artwork package, which a host adds and registers itself: one drawing per emoji, identical on every device, fetched as a sprite sheet the first time one of its emoji is drawn.": "Esta pestaña los dibuja desde el paquete de arte Twemoji, que la aplicación agrega y registra por su cuenta: un dibujo por emoji, idéntico en cada dispositivo, descargado como hoja de sprites la primera vez que se dibuja uno de sus emojis." }, "FormaEmojiPickerPage": { "A categorized emoji palette over the full Unicode set, with a tab per category, keyword search, and recently used entries. Artwork is resolved through IEmojiProvider, drawn from Forma's own sprites by default and falling back to the reader's platform font for anything the shipped set does not cover.": "Una paleta de emojis categorizada sobre el conjunto completo de Unicode, con una pestaña por categoría, búsqueda por palabras clave y entradas usadas recientemente. El arte se resuelve mediante IEmojiProvider, dibujado por defecto con los sprites propios de Forma y recurriendo a la fuente de emojis de la plataforma del lector para lo que el conjunto incluido no cubra.", "Default": "Predeterminado", - "Every category is a tab, and every emoji carries its name as an accessible label. Type in the search box to match against names and keywords; search \"zzzz\" to see the no-match state.": "Cada categoría es una pestaña, y cada emoji lleva su nombre como etiqueta accesible. Escriba en el cuadro de búsqueda para buscar por nombres y palabras clave; busque «zzzz» para ver el estado sin coincidencias.", + "Every category is a tab, and every emoji carries its name as an accessible label. Type in the search box to match against names and keywords; search \"zzzz\" to see the no-match state.": "Cada categoría es una pestaña, y cada emoji lleva su nombre como etiqueta accesible. Escribe en el cuadro de búsqueda para buscar por nombres y palabras clave; busca «zzzz» para ver el estado sin coincidencias.", "Nothing chosen yet.": "Aún no se ha elegido nada.", "Chose {Emoji}.": "Se eligió {Emoji}.", "Recently Used": "Usados Recientemente", - "A host that persists the recent list gets an extra leading tab. Choose an emoji here and it moves to the front.": "Un anfitrión que conserve la lista de recientes obtiene una pestaña inicial adicional. Elija un emoji aquí y pasará al principio.", + "A host that persists the recent list gets an extra leading tab. Choose an emoji here and it moves to the front.": "Un anfitrión que conserve la lista de recientes obtiene una pestaña inicial adicional. Elige un emoji aquí y pasará al principio.", "Recent: {Emoji}": "Recientes: {Emoji}", "Recent Limit": "Límite de Recientes", "MaxRecent caps how many are kept. This one keeps three.": "MaxRecent limita cuántos se conservan. Este conserva tres.", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Virtualization/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Virtualization/.locales/es.json index 3591f0062..aa08bdbc0 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Virtualization/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Virtualization/.locales/es.json @@ -3,7 +3,7 @@ "FormaVirtualizePage": { "Renders the items of a long collection near the viewport, with spacers standing for the rest, and keeps rendered the items its owner pins wherever they lie.": "Muestra los elementos de una colección larga cercanos a la zona visible, con espaciadores en lugar del resto, y mantiene mostrados los elementos que su propietario fija, estén donde estén.", "A Long List": "Una lista larga", - "Ten thousand items, each with a checkbox, pinning the last item to take the focus. Focus one, scroll it out of view and back with the wheel, and it still holds the focus: Space toggles it and Tab carries on from it.": "Diez mil elementos, cada uno con una casilla, fijando el último elemento que recibió el foco. Enfoque uno, desplácelo fuera de la vista y de vuelta con la rueda, y seguirá teniendo el foco: Espacio lo alterna y Tab continúa desde él.", + "Ten thousand items, each with a checkbox, pinning the last item to take the focus. Focus one, scroll it out of view and back with the wheel, and it still holds the focus: Space toggles it and Tab carries on from it.": "Diez mil elementos, cada uno con una casilla, fijando el último elemento que recibió el foco. Enfoca uno, desplázalo fuera de la vista y de vuelta con la rueda, y seguirá teniendo el foco: Espacio lo alterna y Tab continúa desde él.", "{Name} is pinned and stays rendered wherever the list scrolls.": "{Name} está fijado y sigue mostrado adondequiera que se desplace la lista.", "Nothing is pinned until an item takes the focus.": "Nada está fijado hasta que un elemento recibe el foco.", "Task {Number}": "Tarea {Number}", diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Windows/.locales/es.json b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Windows/.locales/es.json index 3332ce540..7ccafb6e2 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Windows/.locales/es.json +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Windows/.locales/es.json @@ -3,7 +3,7 @@ "FormaWindowPage": { "A chrome floated over the page: it is moved by its title bar, resized at its edges, maximized, minimized to the rest area and closed. Every window belongs to a workspace that knows which one is current and which windows another opened.": "Un cromo que flota sobre la página: se mueve por su barra de título, se redimensiona en sus bordes, se maximiza, se minimiza al área de reposo y se cierra. Cada ventana pertenece a un espacio de trabajo que sabe cuál es la actual y qué ventanas abrió otra.", "Floating": "Flotante", - "A window stands over the page. Drag it by its title bar, pull any edge or corner to resize it, or focus the title bar and use the arrow keys, holding Shift to resize. Escape closes the focused window. This one resizes no smaller than 320 by 200 and no larger than 900 by 700.": "Una ventana está sobre la página. Arrástrela por su barra de título, tire de cualquier borde o esquina para redimensionarla, o enfoque la barra de título y use las teclas de flecha, manteniendo Shift para redimensionar. Escape cierra la ventana enfocada. Esta no se reduce a menos de 320 por 200 ni crece a más de 900 por 700.", + "A window stands over the page. Drag it by its title bar, pull any edge or corner to resize it, or focus the title bar and use the arrow keys, holding Shift to resize. Escape closes the focused window. This one resizes no smaller than 320 by 200 and no larger than 900 by 700.": "Una ventana está sobre la página. Arrástrala por su barra de título, tira de cualquier borde o esquina para redimensionarla, o enfoca la barra de título y usa las teclas de flecha, manteniendo Shift para redimensionar. Escape cierra la ventana enfocada. Esta no se reduce a menos de 320 por 200 ni crece a más de 900 por 700.", "Open a Floating Window": "Abrir una Ventana Flotante", "Placement": "Ubicación", "centered": "centrada", @@ -23,7 +23,7 @@ "none": "ninguna", "A modal child blocks the window that opened it and nothing else: Account cannot be used until Confirm is answered, while the rest of the page can. A modal root blocks the whole workspace and stands on a scrim.": "Un hijo modal bloquea la ventana que lo abrió y nada más: Cuenta no puede usarse hasta que Confirmar sea respondida, mientras el resto de la página sí. Un modal raíz bloquea todo el espacio de trabajo y se apoya sobre un velo atenuado.", "A plain floating window.": "Una ventana flotante común.", - "A window can answer a press outside it by going to the back. Open both: the Palette is in front; press anywhere else on the page and it goes behind the Canvas; press the Palette and it returns.": "Una ventana puede responder a una pulsación fuera de ella yendo al fondo. Abra ambas: la Paleta está delante; pulse en cualquier otro lugar de la página y pasará detrás del Lienzo; pulse la Paleta y vuelve.", + "A window can answer a press outside it by going to the back. Open both: the Palette is in front; press anywhere else on the page and it goes behind the Canvas; press the Palette and it returns.": "Una ventana puede responder a un clic fuera de ella yendo al fondo. Abre ambas: la Paleta está delante; haz clic en cualquier otro lugar de la página y pasará detrás del Lienzo; haz clic en la Paleta y vuelve.", "Open Account": "Abrir Cuenta", "Account": "Cuenta", "Bounded": "Limitada", @@ -34,7 +34,7 @@ "Delete Account": "Eliminar Cuenta", "Delete the account? This cannot be undone.": "¿Eliminar la cuenta? Esto no se puede deshacer.", "Every other window waits until this one is closed.": "Todas las demás ventanas esperan hasta que esta se cierre.", - "Goes to the back on a press away.": "Va al fondo al pulsar fuera.", + "Goes to the back on a press away.": "Va al fondo al hacer clic fuera.", "Got It": "Entendido", "Held within the arena beneath.": "Contenida dentro de la arena de abajo.", "Keep": "Conservar", @@ -44,10 +44,10 @@ "Open a Bounded Window": "Abrir una Ventana Limitada", "Open a Workspace-Wide Modal": "Abrir un Modal de Todo el Espacio", "Palette": "Paleta", - "Press Away": "Pulsar Fuera", + "Press Away": "Hacer Clic Fuera", "Rest Area": "Área de Reposo", "Origins and Instances": "Orígenes e Instancias", - "Two running instances of one application, Explorer, share an origin and keep separate instance identities and separate handles, titles alike. Each opens a Preview, and the first Preview opens a Zoom: three generations. Type in the first Explorer's notes, minimize it and restore it, and the text is still there; focus the notes, activate the second Explorer, then come back through the rest area, and focus returns to the notes.": "Dos instancias en ejecución de una aplicación, Explorador, comparten un origen y conservan identidades de instancia y asideros separados, con títulos iguales. Cada una abre una Vista Previa, y la primera Vista Previa abre un Zoom: tres generaciones. Escriba en las notas del primer Explorador, minimícelo y restáurelo, y el texto sigue ahí; enfoque las notas, active el segundo Explorador, vuelva por el área de reposo, y el foco regresa a las notas.", + "Two running instances of one application, Explorer, share an origin and keep separate instance identities and separate handles, titles alike. Each opens a Preview, and the first Preview opens a Zoom: three generations. Type in the first Explorer's notes, minimize it and restore it, and the text is still there; focus the notes, activate the second Explorer, then come back through the rest area, and focus returns to the notes.": "Dos instancias en ejecución de una aplicación, Explorador, comparten un origen y conservan identidades de instancia y asideros separados, con títulos iguales. Cada una abre una Vista Previa, y la primera Vista Previa abre un Zoom: tres generaciones. Escribe en las notas del primer Explorador, minimízalo y restáuralo, y el texto sigue ahí; enfoca las notas, activa el segundo Explorador, vuelve por el área de reposo, y el foco regresa a las notas.", "Explorer": "Explorador", "Notes": "Notas", "Kept across minimization": "Se conserva al minimizar", diff --git a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Composer/es.json b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Composer/es.json index 154ed2666..b77f703cc 100644 --- a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Composer/es.json +++ b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Composer/es.json @@ -96,11 +96,11 @@ "Emoji": "Emoji", "Table": "Tabla", "Insert Table...": "Insertar Tabla...", - "Add Row Above": "Añadir Fila Arriba", - "Add Row Below": "Añadir Fila Abajo", + "Add Row Above": "Agregar Fila Arriba", + "Add Row Below": "Agregar Fila Abajo", "Delete Row": "Eliminar Fila", - "Add Column Left": "Añadir Columna a la Izquierda", - "Add Column Right": "Añadir Columna a la Derecha", + "Add Column Left": "Agregar Columna a la Izquierda", + "Add Column Right": "Agregar Columna a la Derecha", "Delete Column": "Eliminar Columna", "Toggle Header Row": "Alternar Fila de Encabezado", "Delete Table": "Eliminar Tabla", @@ -112,7 +112,7 @@ "Media": "Medios", "Edit Image": "Editar Imagen", "Insert Image": "Insertar Imagen", - "Enter the address of the image before inserting.": "Introduce la dirección de la imagen antes de insertarla.", + "Enter the address of the image before inserting.": "Ingresa la dirección de la imagen antes de insertarla.", "This could not be inserted into the document.": "No se pudo insertar esto en el documento.", "Attach Files": "Adjuntar Archivos", "Attachments": "Adjuntos", @@ -129,7 +129,7 @@ "Video URL": "URL del Video", "Title": "Título", "Autoplay": "Reproducción Automática", - "Enter the address of the video before inserting.": "Introduce la dirección del video antes de insertarlo.", + "Enter the address of the video before inserting.": "Ingresa la dirección del video antes de insertarlo.", "A video address has to start with http:// or https://.": "La dirección de un video debe empezar por http:// o https://.", "View": "Vista", "Preview": "Vista Previa", @@ -165,11 +165,11 @@ "Settings": "Configuración", "Article Layout": "Diseño de Artículo", "Sidebar Callout": "Cuadro Destacado Lateral", - "Enter a name for the anchor before inserting.": "Introduce un nombre para el ancla antes de insertarla.", - "Enter the address of the link before inserting.": "Introduce la dirección del enlace antes de insertarlo.", + "Enter a name for the anchor before inserting.": "Ingresa un nombre para el ancla antes de insertarla.", + "Enter the address of the link before inserting.": "Ingresa la dirección del enlace antes de insertarlo.", "An address has to be a web address, a mail or telephone link, a path within this site, or an inline picture.": "Una dirección debe ser una dirección web, un enlace de correo o teléfono, una ruta dentro de este sitio o una imagen incrustada.", - "Enter the embed type before inserting.": "Introduce el tipo de inserción antes de insertarlo.", - "Enter the identifier before inserting.": "Introduce el identificador antes de insertarlo.", + "Enter the embed type before inserting.": "Ingresa el tipo de inserción antes de insertarlo.", + "Enter the identifier before inserting.": "Ingresa el identificador antes de insertarlo.", "{Format} on": "{Format} activado", "{Format} off": "{Format} desactivado", "Keyboard Shortcuts": "Atajos de Teclado", diff --git a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Explorer/es.json b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Explorer/es.json index 91c30e42c..41e8fe5db 100644 --- a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Explorer/es.json +++ b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor.Explorer/es.json @@ -25,7 +25,7 @@ "[$ plural; one: This explorer holds at most # item.; other: This explorer holds at most # items.; $]": "[$ plural; one: Este explorador admite como máximo # elemento.; other: Este explorador admite como máximo # elementos.; $]", "Folder": "Carpeta", "Image": "Imagen", - "Video": "Vídeo", + "Video": "Video", "Audio": "Audio", "Archive": "Archivo Comprimido", "Document": "Documento", diff --git a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor/Components/Debugging/es.json b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor/Components/Debugging/es.json index 5050eb970..9efd732e9 100644 --- a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor/Components/Debugging/es.json +++ b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor/Components/Debugging/es.json @@ -5,7 +5,7 @@ "Input router": "Enrutador de entrada", "Inspector": "Inspector", "Paused": "En pausa", - "Press a key, click, or scroll to see how the router resolves it.": "Pulse una tecla, haga clic o desplácese para ver cómo lo resuelve el enrutador.", + "Press a key, click, or scroll to see how the router resolves it.": "Presiona una tecla, haz clic o desplázate para ver cómo lo resuelve el enrutador.", "Owner": "Propietario", "nothing": "nada", "Action": "Acción", diff --git a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor/Components/Inputs/es.json b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor/Components/Inputs/es.json index 98f8c0523..f511d2df9 100644 --- a/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor/Components/Inputs/es.json +++ b/src/Locales/Forma.Blazor.Locales.Spanish/Forma.Blazor/Components/Inputs/es.json @@ -68,8 +68,8 @@ "Avoid repeating the same characters.": "Evita repetir los mismos caracteres.", "[$ plural; one: Use at least # character.; other: Use at least # characters.; $]": "[$ plural; one: Usa al menos # carácter.; other: Usa al menos # caracteres.; $]", "Mix uppercase and lowercase letters.": "Combina mayúsculas y minúsculas.", - "Add a number.": "Añade un número.", - "Add a symbol.": "Añade un símbolo." + "Add a number.": "Agrega un número.", + "Add a symbol.": "Agrega un símbolo." }, "FormaSearchBox": { "Search...": "Buscar...", diff --git a/src/Locales/Forma.Blazor.Locales.Spanish/README.md b/src/Locales/Forma.Blazor.Locales.Spanish/README.md index 5821b35df..75b9d616f 100644 --- a/src/Locales/Forma.Blazor.Locales.Spanish/README.md +++ b/src/Locales/Forma.Blazor.Locales.Spanish/README.md @@ -3,7 +3,7 @@ The Spanish localization of Forma, as a locale pack: a package of locale files alone, carrying the Spanish strings of `Forma.Blazor`, `Forma.Blazor.Composer`, `Forma.Blazor.DataView` and `Forma.Blazor.Explorer`. Installing it is all an application does to show Forma's components in -Spanish. +Spanish. The strings are written in Latin American Spanish and address the reader as *tú*. ## Install From 6ad600c33603a2160db563089ea02c96ce352a8c Mon Sep 17 00:00:00 2001 From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com> Date: Fri, 20 Nov 2026 02:41:12 +0200 Subject: [PATCH 2/8] feat(localization)!: choose a string's words by gender MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A gender expression, [$ [Rider] gender; female: …; male: …; other: …; $], selects the field its enum value or string names, whatever its case, and other for anything else. A key's values pair with the arguments its expressions name as well as its holes, in the order each first appears, so a key can carry a gender no hole writes. PluralExpressionEvaluator is LocaleExpressionEvaluator, which evaluates both. --- CHANGELOG.md | 12 + docs/localization-design.md | 13 +- .../Pages/Libraries/LocalizationPage.razor | 2 +- .../JsonLocaleContext.cs | 4 +- .../JsonStringLocale.cs | 2 +- .../JsonStringLocaleFactory.cs | 2 +- .../README.md | 7 +- .../README.md | 2 +- .../IStringLocale.cs | 2 +- ...luator.cs => LocaleExpressionEvaluator.cs} | 106 +++++++-- .../LocalizationLog.cs | 3 + .../LocalizedFormat.cs | 54 ++++- .../LocalizedPattern.cs | 2 +- .../NullStringLocale.cs | 6 +- .../Parser/Syntax/LocaleDiagnosticKind.cs | 2 +- .../Forma.Framework.Localization/README.md | 49 +++- .../Fixtures/Gendered/.locales/es.json | 5 + .../Fixtures/ResourceSources.cs | 3 + .../JsonStringLocaleTests.cs | 38 ++++ ...LocaleExpressionEvaluatorLanguageTests.cs} | 4 +- ...s.cs => LocaleExpressionEvaluatorTests.cs} | 210 ++++++++++++++++-- .../LocalizedFormatTests.cs | 33 +++ 22 files changed, 473 insertions(+), 88 deletions(-) rename src/Framework/Forma.Framework.Localization/Language/{PluralExpressionEvaluator.cs => LocaleExpressionEvaluator.cs} (62%) create mode 100644 tests/unit/Framework/Forma.Framework.Localization.Json.Tests/Fixtures/Gendered/.locales/es.json rename tests/unit/Framework/Forma.Framework.Localization.Tests/Language/{PluralExpressionEvaluatorLanguageTests.cs => LocaleExpressionEvaluatorLanguageTests.cs} (96%) rename tests/unit/Framework/Forma.Framework.Localization.Tests/Language/{PluralExpressionEvaluatorTests.cs => LocaleExpressionEvaluatorTests.cs} (57%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fb5b85ce..bd467561f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,18 @@ set out. What Forma gained before its first release, month by month, is in [the *Unreleased* +- A gender expression chooses a string's words by whom it is about, as a plural expression chooses them by a count: + `[$ [Rider] gender; female: Escaladora; other: Escalador; $]`. Its fields are `female`, `male` and `other`, and an + enum value or a string selects the field its name spells, whatever its case, so `Gender.Female` and `"female"` + select `female`; a null, or a name without a field of its own, selects `other`. +- A key's values pair with the arguments its expressions name as well as its holes, in the order each name first + appears, so a key can carry a value no hole writes, such as a gender: + `L["[$ [Rider] gender; other: {Name} is the best climber; $]", rider.Gender, rider.Name]`. A key whose expression + names an argument ahead of that argument's first hole, with another hole between them, pairs the argument earlier + than it did; to migrate, pass the values in the order the names first appear. +- `PluralExpressionEvaluator` is `LocaleExpressionEvaluator`, which evaluates gender expressions too, and its + `Keyword` is `PluralKeyword`, beside `GenderKeyword` and the set of both, `Keywords`. To migrate, rename the type + and the property. - The Spanish locale pack is written throughout in Latin American Spanish, addressing the reader as *tú*: the table menu's *Agregar Fila Arriba* and the three like it, the inputs' *Agrega un número.* and *Agrega un símbolo.*, the composer's six prompts starting *Ingresa…*, the explorer's *Video*, and the input router's *Presiona una tecla, haz diff --git a/docs/localization-design.md b/docs/localization-design.md index 207afef8d..6b72839df 100644 --- a/docs/localization-design.md +++ b/docs/localization-design.md @@ -7,7 +7,7 @@ every file is read into, the default reading of a file's place and name, the pat state instead, the `.locale.json` config that shapes reading, the locale packs an assembly's strings may ship in, the order entries apply in, how the runtime reports a lookup that doesn't find an entry, and how code written against Microsoft's `IStringLocalizer` reads them. The contract a component reads strings -through, holes, plural forms and the file format are the `Forma.Framework.Localization` README's; +through, holes, plural and gender forms and the file format are the `Forma.Framework.Localization` README's; the checks run over the files are the [Locali](https://github.com/FormaUI/Locali) linter's, `dotnet locali`. @@ -439,10 +439,11 @@ The broader report stands for every narrower one beneath it, so an assembly that report rather than one for each of its keys, and an `es-419` without files of its own misses nothing `es` answers. Each is logged once per factory, which reads each file once, so what it has reported follows what it has read. The three are warnings, each its own event carrying the assembly, the type, the key and the culture -as fields, since grouping explains a miss without making it matter less; a plural argument that isn't a count -is a warning under the checks too, and `Debug` without them. A file that a culture checked beside the lookup's -can't read is a warning of its own, once for each type and culture, and leaves the text the reader sees as it -is: the checks report what they find without changing what a lookup shows. +as fields, since grouping explains a miss without making it matter less; a plural argument that isn't a count, +or a gender argument that is neither an enum nor a string, is a warning under the checks too, and `Debug` without +them. A file that a culture checked beside the lookup's can't read is a warning of its own, once for each type +and culture, and leaves the text the reader sees as it is: the checks report what they find without changing +what a lookup shows. The checks see the lookups that run. The [Locali](https://github.com/FormaUI/Locali) linter checks what it can establish before the application runs, and where the two read the same files and settings they agree; @@ -467,7 +468,7 @@ The key a caller passes decides how its string is filled, never the text a cultu filled one way in every culture: - **A Forma key** names a hole, `{Name}`, or holds an expression, `[$ … $]`, and Forma alone fills it, its - arguments paired with the holes by position. + arguments paired by position with the names the key uses, its holes and its expressions' arguments. - **A composite key** holds a composite placeholder, `{0}`, or neither, and `string.Format` alone fills its text in the formatting culture, as Microsoft's localizer does, so code written for it keeps its keys. Read without arguments, its text is returned as written. diff --git a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Libraries/LocalizationPage.razor b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Libraries/LocalizationPage.razor index 6af0f055f..32158b4be 100644 --- a/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Libraries/LocalizationPage.razor +++ b/src/Blazor/Forma.Blazor.Showcase/Components/Pages/Libraries/LocalizationPage.razor @@ -272,7 +272,7 @@ private static readonly decimal[] Samples = [0m, 0.5m, 1m, 1.0m, 2m, 3m, 5m, 11m, 100m, 1000000m]; - private static readonly PluralExpressionEvaluator PluralFormat = new(CommonPluralRuleSet.Default); + private static readonly LocaleExpressionEvaluator PluralFormat = new(CommonPluralRuleSet.Default); private const string AssemblyFileKey = "Written in the root's file"; private const string NamespaceFileKey = "Written in a parent folder's file"; diff --git a/src/Framework/Forma.Framework.Localization.Json/JsonLocaleContext.cs b/src/Framework/Forma.Framework.Localization.Json/JsonLocaleContext.cs index e1e5b081a..296f433e1 100644 --- a/src/Framework/Forma.Framework.Localization.Json/JsonLocaleContext.cs +++ b/src/Framework/Forma.Framework.Localization.Json/JsonLocaleContext.cs @@ -8,13 +8,13 @@ namespace Forma.Framework.Localization.Json; /// The state shared by every locale a factory creates. /// The cache the locales read their entries through. /// The culture the keys are written in. -/// The evaluator resolving a plural expression. +/// The evaluator resolving a plural or gender expression. /// The settings the factory was created with. /// The checks the locales run on every lookup, or null where the options leave lookups unchecked. internal sealed record JsonLocaleContext( JsonResourceCache Cache, CultureInfo SourceCulture, - PluralExpressionEvaluator PluralEvaluator, + LocaleExpressionEvaluator ExpressionEvaluator, LocalizationOptions Options, JsonLocaleDiagnostics? Diagnostics) { diff --git a/src/Framework/Forma.Framework.Localization.Json/JsonStringLocale.cs b/src/Framework/Forma.Framework.Localization.Json/JsonStringLocale.cs index 0485203b8..ad8ec0dab 100644 --- a/src/Framework/Forma.Framework.Localization.Json/JsonStringLocale.cs +++ b/src/Framework/Forma.Framework.Localization.Json/JsonStringLocale.cs @@ -171,7 +171,7 @@ private static bool IsLocalized(bool isFound, JsonResourceEntry entry) // Plural rules follow the language the text is written in. private string Evaluate(string format, bool isLocalized, IReadOnlyList arguments) - => context.PluralEvaluator.Evaluate( + => context.ExpressionEvaluator.Evaluate( format, isLocalized ? UICulture : context.SourceCulture, UICulture, diff --git a/src/Framework/Forma.Framework.Localization.Json/JsonStringLocaleFactory.cs b/src/Framework/Forma.Framework.Localization.Json/JsonStringLocaleFactory.cs index e7829983f..2ba58f256 100644 --- a/src/Framework/Forma.Framework.Localization.Json/JsonStringLocaleFactory.cs +++ b/src/Framework/Forma.Framework.Localization.Json/JsonStringLocaleFactory.cs @@ -47,7 +47,7 @@ public JsonStringLocaleFactory(LocalizationOptions options, ILoggerFactory logge _context = new JsonLocaleContext( cache, sourceCulture, - new PluralExpressionEvaluator(CommonPluralRuleSet.Default, loggerFactory.CreateLogger(), options.Diagnostics), + new LocaleExpressionEvaluator(CommonPluralRuleSet.Default, loggerFactory.CreateLogger(), options.Diagnostics), options, diagnosedCultures is null ? null : new JsonLocaleDiagnostics(cache, diagnosedCultures, logger)); } diff --git a/src/Framework/Forma.Framework.Localization.Json/README.md b/src/Framework/Forma.Framework.Localization.Json/README.md index 1c8889347..139b57323 100644 --- a/src/Framework/Forma.Framework.Localization.Json/README.md +++ b/src/Framework/Forma.Framework.Localization.Json/README.md @@ -68,7 +68,7 @@ public sealed class UploadStatus(IStringLocale locale) Under `es`, `Progress(3, 9)` renders `Se guardaron 3 de 9.` and `FileCount(1)` renders `1 archivo`; under `en` they render `Stored 3 of 9.` and `1 file` from the keys themselves. -`Forma.Framework.Localization` documents the hole and plural syntax, where else a file may sit, +`Forma.Framework.Localization` documents the hole, plural and gender syntax, where else a file may sit, and how a host overrides one. A file named for its type, `Uploads/.locales/UploadStatus.es.json`, holds that type's entries at @@ -146,8 +146,9 @@ Each carries `Assembly`, `Type`, `Key` and `Culture` as fields, the type and key miss, so a test run can fail on these three events. A file that a culture `Cultures` names can't read is logged once for each type as `LocaleFileNotRead`, event 8, with `Assembly`, `Type`, `Culture` and the `Reason`, and leaves the lookup's text as it is. All four are logged under `Forma.Framework.Localization.Json.JsonStringLocaleFactory`. A -plural argument that isn't a count is a warning as well, event 1 under -`Forma.Framework.Localization.Language.PluralExpressionEvaluator`, logged at `Debug` without `Diagnostics`. +plural argument that isn't a count is a warning as well, event 1, and so is a gender argument that is neither an +enum nor a string, event 9, both under `Forma.Framework.Localization.Language.LocaleExpressionEvaluator` and +logged at `Debug` without `Diagnostics`. The checks see the lookups that run, so a clean run covers the strings those lookups reached. They check the locales `JsonStringLocaleFactory` makes. diff --git a/src/Framework/Forma.Framework.Localization.StringLocalizerAdapter/README.md b/src/Framework/Forma.Framework.Localization.StringLocalizerAdapter/README.md index 386d27939..68a8b9f0c 100644 --- a/src/Framework/Forma.Framework.Localization.StringLocalizerAdapter/README.md +++ b/src/Framework/Forma.Framework.Localization.StringLocalizerAdapter/README.md @@ -40,7 +40,7 @@ The key decides how a string is filled, never the text a culture gives it: | Key | Filled by | | --- | --- | -| Names a Forma hole, `{Name}`, or holds an expression, `[$ … $]` | Forma, which pairs the arguments with the holes by position | +| Names a Forma hole, `{Name}`, or holds an expression, `[$ … $]` | Forma, which pairs the arguments by position with the key's holes and the arguments its expressions name | | Holds a composite placeholder, `{0}`, or neither | `string.Format` in the formatting culture, as Microsoft's localizer fills it | One formatter runs over a string, so a doubled brace, `{{`, is an escape resolved once. A key read without diff --git a/src/Framework/Forma.Framework.Localization/IStringLocale.cs b/src/Framework/Forma.Framework.Localization/IStringLocale.cs index c137cfce2..f403799db 100644 --- a/src/Framework/Forma.Framework.Localization/IStringLocale.cs +++ b/src/Framework/Forma.Framework.Localization/IStringLocale.cs @@ -18,7 +18,7 @@ public interface IStringLocale /// LocalizedText this[string name, params ReadOnlySpan values] { get; } - /// The localized format for a key, with plural forms resolved and every hole left open. + /// The localized format for a key, with its plural and gender forms resolved and every hole left open. /// The key to look up, which is the source text. LocalizedPattern Resolve(string name); diff --git a/src/Framework/Forma.Framework.Localization/Language/PluralExpressionEvaluator.cs b/src/Framework/Forma.Framework.Localization/Language/LocaleExpressionEvaluator.cs similarity index 62% rename from src/Framework/Forma.Framework.Localization/Language/PluralExpressionEvaluator.cs rename to src/Framework/Forma.Framework.Localization/Language/LocaleExpressionEvaluator.cs index e840e4f79..998fa8e8a 100644 --- a/src/Framework/Forma.Framework.Localization/Language/PluralExpressionEvaluator.cs +++ b/src/Framework/Forma.Framework.Localization/Language/LocaleExpressionEvaluator.cs @@ -10,29 +10,37 @@ namespace Forma.Framework.Localization.Language; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -/// Evaluates the [$ [count] plural; one: text; other: text; $] expression inside localized text. +/// Evaluates the [$ [count] plural; one: text; other: text; $] and [$ [person] gender; female: text; other: text; $] expressions inside localized text. /// The rules deciding which category a count falls into. -/// The logger an argument that is not a count is reported to; null discards. -/// The checks the application runs on its lookups, under which an argument that is not a count is a warning, or null where it leaves them unchecked. -public sealed class PluralExpressionEvaluator(IPluralRuleSet rules, ILogger? logger = null, LocalizationDiagnostics? diagnostics = null) +/// The logger an argument that is not a count, or not a gender, is reported to; null discards. +/// The checks the application runs on its lookups, under which an argument that is not a count or a gender is a warning, or null where it leaves them unchecked. +public sealed class LocaleExpressionEvaluator(IPluralRuleSet rules, ILogger? logger = null, LocalizationDiagnostics? diagnostics = null) { // How many characters an evaluation writes on the stack before it moves to a pooled buffer. private const int StackLength = 256; + // The field every expression falls back to. + private const string OtherField = "other"; + // What reading a format found, kept for as long as the format lives. private static readonly ConditionalWeakTable ParseResults = []; private readonly IPluralRuleSet _rules = rules ?? throw new ArgumentNullException(nameof(rules)); private readonly ILogger _logger = logger ?? NullLogger.Instance; - private readonly LogLevel _notNumericLevel = diagnostics is null ? LogLevel.Debug : LogLevel.Warning; - private readonly ConcurrentDictionary _reportedFormats = new(StringComparer.Ordinal); + private readonly LogLevel _unusableArgumentLevel = diagnostics is null ? LogLevel.Debug : LogLevel.Warning; + private readonly ConcurrentDictionary _reportedPluralFormats = new(StringComparer.Ordinal); + private readonly ConcurrentDictionary _reportedGenderFormats = new(StringComparer.Ordinal); /// The keyword a plural expression names, whose fields carry the CLDR categories. - public static LocaleKeyword Keyword { get; } = new("plural", "zero", "one", "two", "few", "many", "other"); + public static LocaleKeyword PluralKeyword { get; } = new("plural", "zero", "one", "two", "few", "many", OtherField); + + /// The keyword a gender expression names, whose fields carry the genders a person is referred to by. + public static LocaleKeyword GenderKeyword { get; } = new("gender", "female", "male", OtherField); - private static LocaleKeywords KnownKeywords { get; } = new(Keyword); + /// The keywords an expression may name. + public static LocaleKeywords Keywords { get; } = new(PluralKeyword, GenderKeyword); - /// The format with every plural expression replaced by the field its count selects. + /// The format with every expression replaced by the field its argument selects. public string Evaluate(string format, CultureInfo culture, IReadOnlyList arguments) { ArgumentNullException.ThrowIfNull(format); @@ -41,7 +49,7 @@ public string Evaluate(string format, CultureInfo culture, IReadOnlyListThe format with every plural expression replaced, the field chosen by the culture the text is written in and the count formatted for the culture it is shown in. + /// The format with every expression replaced, a plural's field chosen by the culture the text is written in and its count formatted for the culture it is shown in. public string Evaluate(string format, CultureInfo localeCulture, CultureInfo displayCulture, IReadOnlyList arguments) { ArgumentNullException.ThrowIfNull(format); @@ -55,7 +63,7 @@ public string Evaluate(string format, CultureInfo localeCulture, CultureInfo dis } // An expression the parser rejected stays in the text as written. - var parseResult = ParseResults.GetValue(format, static text => LocaleExpressionParser.Parse(text, KnownKeywords)); + var parseResult = ParseResults.GetValue(format, static text => LocaleExpressionParser.Parse(text, Keywords)); if (parseResult.Expressions.Count == 0) { return format; @@ -71,9 +79,14 @@ public string Evaluate(string format, CultureInfo localeCulture, CultureInfo dis var expression = expressions[index]; builder.AppendFormatted(format.AsSpan(position, expression.Span.Start - position)); - if (expression.KeywordSpan.Slice(format).SequenceEqual(Keyword.Name)) + var keyword = expression.KeywordSpan.Slice(format); + if (keyword.SequenceEqual(PluralKeyword.Name)) { - AppendField(ref builder, format, expression, localeCulture, displayCulture, arguments); + AppendPluralField(ref builder, format, expression, localeCulture, displayCulture, arguments); + } + else if (keyword.SequenceEqual(GenderKeyword.Name)) + { + AppendGenderField(ref builder, format, expression, arguments); } else { @@ -88,7 +101,7 @@ public string Evaluate(string format, CultureInfo localeCulture, CultureInfo dis return builder.ToStringAndClear(); } - private void AppendField(ref DefaultInterpolatedStringHandler builder, string text, LocaleExpression expression, CultureInfo localeCulture, CultureInfo displayCulture, IReadOnlyList arguments) + private void AppendPluralField(ref DefaultInterpolatedStringHandler builder, string text, LocaleExpression expression, CultureInfo localeCulture, CultureInfo displayCulture, IReadOnlyList arguments) { var name = expression.NameSpan.Slice(text); if (name.IsEmpty) @@ -100,7 +113,7 @@ private void AppendField(ref DefaultInterpolatedStringHandler builder, string te var operands = PluralOperands.From(count); var wantedCategory = _rules.Select(localeCulture.Name, operands) ?? PluralCategory.Other; - var selectedField = Select(text, expression.Fields, wantedCategory) ?? Select(text, expression.Fields, PluralCategory.Other); + var selectedField = Select(text, expression.Fields, GetCategoryName(wantedCategory)) ?? Select(text, expression.Fields, OtherField); if (selectedField is not { } field) { return; @@ -136,10 +149,24 @@ private void AppendField(ref DefaultInterpolatedStringHandler builder, string te } } - private static LocaleTextSpan? Select(string text, IReadOnlyList fields, PluralCategory category) + private void AppendGenderField(ref DefaultInterpolatedStringHandler builder, string text, LocaleExpression expression, IReadOnlyList arguments) { - var name = GetCategoryName(category); + var name = expression.NameSpan.Slice(text); + if (name.IsEmpty) + { + RequireSoleArgument(arguments); + } + var wantedField = GetGenderField(ToGender(name, text, Find(name, arguments))); + + if ((Select(text, expression.Fields, wantedField) ?? Select(text, expression.Fields, OtherField)) is { } field) + { + builder.AppendFormatted(field.Slice(text)); + } + } + + private static LocaleTextSpan? Select(string text, IReadOnlyList fields, ReadOnlySpan name) + { for (var index = 0; index < fields.Count; index++) { if (fields[index].NameSpan.Slice(text).SequenceEqual(name)) @@ -201,15 +228,52 @@ private decimal ToDecimal(ReadOnlySpan name, string format, object? value) { } - if (_reportedFormats.TryAdd(format, 0)) + if (_reportedPluralFormats.TryAdd(format, 0)) { - LocalizationLog.PluralArgumentNotNumeric(_logger, _notNumericLevel, name.ToString(), value?.GetType().Name ?? "null", format); + LocalizationLog.PluralArgumentNotNumeric(_logger, _unusableArgumentLevel, name.ToString(), value?.GetType().Name ?? "null", format); } return 0m; } - private static ReadOnlySpan GetCategoryName(PluralCategory category) + // An enum names a gender by its member's name and a string by its text; null names none. + private string? ToGender(ReadOnlySpan name, string format, object? value) + { + switch (value) + { + case null: + return null; + + case string text: + return text; + + case Enum member: + return member.ToString(); + } + + if (_reportedGenderFormats.TryAdd(format, 0)) + { + LocalizationLog.GenderArgumentNotEnumOrString(_logger, _unusableArgumentLevel, name.ToString(), value.GetType().Name, format); + } + + return null; + } + + // A gender matches the field it spells, whatever its case, and every other gender reads as other. + private static string GetGenderField(string? gender) + { + foreach (var fieldName in GenderKeyword.FieldNames) + { + if (string.Equals(fieldName, gender, StringComparison.OrdinalIgnoreCase)) + { + return fieldName; + } + } + + return OtherField; + } + + private static string GetCategoryName(PluralCategory category) => category switch { PluralCategory.Zero => "zero", @@ -217,6 +281,6 @@ private static ReadOnlySpan GetCategoryName(PluralCategory category) PluralCategory.Two => "two", PluralCategory.Few => "few", PluralCategory.Many => "many", - _ => "other", + _ => OtherField, }; } diff --git a/src/Framework/Forma.Framework.Localization/LocalizationLog.cs b/src/Framework/Forma.Framework.Localization/LocalizationLog.cs index caa11445d..1f865306e 100644 --- a/src/Framework/Forma.Framework.Localization/LocalizationLog.cs +++ b/src/Framework/Forma.Framework.Localization/LocalizationLog.cs @@ -13,4 +13,7 @@ internal static partial class LocalizationLog [LoggerMessage(EventId = 3, Level = LogLevel.Warning, Message = "Host locale assembly {Assembly} could not be loaded, so the host's strings it carries are left out: {Reason}")] public static partial void HostLocaleAssemblyNotLoaded(ILogger logger, string assembly, string reason); + + [LoggerMessage(EventId = 9, Message = "Gender argument {Argument} of type {ArgumentType} in {Format} is neither an enum nor a string; using other.")] + public static partial void GenderArgumentNotEnumOrString(ILogger logger, LogLevel level, string argument, string argumentType, string format); } diff --git a/src/Framework/Forma.Framework.Localization/LocalizedFormat.cs b/src/Framework/Forma.Framework.Localization/LocalizedFormat.cs index f9c0144d7..f0a2e2745 100644 --- a/src/Framework/Forma.Framework.Localization/LocalizedFormat.cs +++ b/src/Framework/Forma.Framework.Localization/LocalizedFormat.cs @@ -4,6 +4,9 @@ namespace Forma.Framework.Localization; using System.Runtime.CompilerServices; using Forma.Framework.Culture; +using Forma.Framework.Localization.Language; +using Forma.Framework.Localization.Parser; +using Forma.Framework.Localization.Parser.Syntax; /// Renders a composite format whose holes name their arguments. public static class LocalizedFormat @@ -14,13 +17,13 @@ public static class LocalizedFormat // How many characters a value written through its hole's format takes on the stack before it is written to a string instead. private const int FormattedLength = 128; - // The names a format's holes use, read once for as long as the format lives. - private static readonly ConditionalWeakTable HoleNames = []; + // The names a format uses, read once for as long as the format lives. + private static readonly ConditionalWeakTable FormatNames = []; - /// Pairs values with the names a format's holes use, in the order those holes first appear. + /// Pairs values with the names a format uses, its holes and the arguments its expressions name, in the order each name first appears. /// The format the names are read from. - /// The values to pair, one per distinct hole. - /// A format naming no hole takes a single value, which an expression without a name reads. + /// The values to pair, one per distinct name. + /// A format naming nothing takes a single value, which an expression without a name reads. public static LocalizedArgument[] Bind(string format, params ReadOnlySpan values) { ArgumentNullException.ThrowIfNull(format); @@ -33,7 +36,7 @@ public static LocalizedArgument[] Bind(string format, params ReadOnlySpan [], 1 => [LocalizedArgument.Unnamed(values[0])], _ => throw new ArgumentException( - $"'{format}' names no hole, so it takes at most one value, but {values.Length} were supplied.", + $"'{format}' names no hole or argument, so it takes at most one value, but {values.Length} were supplied.", nameof(values)), }; } @@ -41,7 +44,7 @@ public static LocalizedArgument[] Bind(string format, params ReadOnlySpan argu } private static string[] GetNames(string format) - => format.AsSpan().ContainsAny('{', '}') ? HoleNames.GetValue(format, static text => [.. ReadNames(text)]) : []; + => format.AsSpan().ContainsAny('{', '}') || format.Contains(LocaleExpressionParser.OpeningDelimiter, StringComparison.Ordinal) + ? FormatNames.GetValue(format, static text => [.. ReadNames(text)]) + : []; + // The holes and the expressions' arguments are each read in order, and merged by where their names stand. private static List ReadNames(string format) { var names = new List(); + var expressions = LocaleExpressionParser.Parse(format, LocaleExpressionEvaluator.Keywords).Expressions; + var expressionIndex = 0; foreach (var segment in LocalizedSegment.Parse(format)) { @@ -104,14 +112,36 @@ private static List ReadNames(string format) continue; } - var name = segment.Name.ToString(); - if (!names.Contains(name, StringComparer.Ordinal)) + _ = format.AsSpan().Overlaps(segment.Name, out var position); + expressionIndex = AddArguments(format, expressions, expressionIndex, position, names); + Add(names, segment.Name.ToString()); + } + + AddArguments(format, expressions, expressionIndex, format.Length, names); + + return names; + } + + // The arguments named before the position are added, and the index of the first expression after it returned. + private static int AddArguments(string format, IReadOnlyList expressions, int index, int position, List names) + { + for (; index < expressions.Count && expressions[index].Span.Start < position; index++) + { + if (!expressions[index].NameSpan.IsEmpty) { - names.Add(name); + Add(names, expressions[index].NameSpan.Slice(format).ToString()); } } - return names; + return index; + } + + private static void Add(List names, string name) + { + if (!names.Contains(name, StringComparer.Ordinal)) + { + names.Add(name); + } } // A value is written in the culture it is rendered in, padded to the hole's alignment. diff --git a/src/Framework/Forma.Framework.Localization/LocalizedPattern.cs b/src/Framework/Forma.Framework.Localization/LocalizedPattern.cs index cbba5a427..52b4941f4 100644 --- a/src/Framework/Forma.Framework.Localization/LocalizedPattern.cs +++ b/src/Framework/Forma.Framework.Localization/LocalizedPattern.cs @@ -1,6 +1,6 @@ namespace Forma.Framework.Localization; -/// A localized composite format string whose plural forms are resolved but whose holes are still open. +/// A localized composite format string whose plural and gender forms are resolved but whose holes are still open. /// The key the pattern was looked up under. /// The localized composite format, such as "Stored {stored} of {total}.". /// The values the holes name. diff --git a/src/Framework/Forma.Framework.Localization/NullStringLocale.cs b/src/Framework/Forma.Framework.Localization/NullStringLocale.cs index 1b3d9204c..4d03c4821 100644 --- a/src/Framework/Forma.Framework.Localization/NullStringLocale.cs +++ b/src/Framework/Forma.Framework.Localization/NullStringLocale.cs @@ -4,13 +4,13 @@ namespace Forma.Framework.Localization; using Forma.Framework.Localization.Language; -/// A locale whose every key is its own text, with its holes and plural forms resolved for the source language. +/// A locale whose every key is its own text, with its holes and its plural and gender forms resolved for the source language. /// The language the keys are written in. /// The culture that formats the values, or to read the current one. /// The culture whose plural rules apply, or to read the current one. internal sealed class NullStringLocale(CultureInfo sourceCulture, CultureInfo? boundCulture = null, CultureInfo? boundUICulture = null) : IStringLocale { - private readonly PluralExpressionEvaluator _pluralEvaluator = new(CommonPluralRuleSet.Default); + private readonly LocaleExpressionEvaluator _expressionEvaluator = new(CommonPluralRuleSet.Default); private CultureInfo Culture => boundCulture ?? CultureInfo.CurrentCulture; @@ -79,5 +79,5 @@ private LocalizedPattern Resolve(string name, LocalizedArgument[] arguments) => new(name, Evaluate(name, arguments), arguments, ResourceNotFound: true); private string Evaluate(string format, IReadOnlyList arguments) - => _pluralEvaluator.Evaluate(format, sourceCulture, UICulture, arguments); + => _expressionEvaluator.Evaluate(format, sourceCulture, UICulture, arguments); } diff --git a/src/Framework/Forma.Framework.Localization/Parser/Syntax/LocaleDiagnosticKind.cs b/src/Framework/Forma.Framework.Localization/Parser/Syntax/LocaleDiagnosticKind.cs index a49c330c1..558ad01cf 100644 --- a/src/Framework/Forma.Framework.Localization/Parser/Syntax/LocaleDiagnosticKind.cs +++ b/src/Framework/Forma.Framework.Localization/Parser/Syntax/LocaleDiagnosticKind.cs @@ -15,7 +15,7 @@ public enum LocaleDiagnosticKind /// The header names a keyword no expression defines. UnknownKeyword, - /// The header does not carry the bracketed name the count comes from. + /// The header does not carry the bracketed name of the argument it reads. MissingArgumentName, /// The bracketed name is not a plain identifier. diff --git a/src/Framework/Forma.Framework.Localization/README.md b/src/Framework/Forma.Framework.Localization/README.md index eb66d8de4..51563c26f 100644 --- a/src/Framework/Forma.Framework.Localization/README.md +++ b/src/Framework/Forma.Framework.Localization/README.md @@ -3,7 +3,7 @@ A localization contract for .NET libraries and applications. A type looks a string up by its text in the source language, English unless `SourceLanguage` says otherwise, so a string no locale file localizes renders as written, and localized strings are found by the name of the type asking. -The package carries the hole and plural syntax a string is written in, the CLDR plural rules, and +The package carries the hole, plural and gender syntax a string is written in, the CLDR plural rules, and the build that makes a project a locale pack. ## Install and register @@ -30,7 +30,7 @@ builder.Services.AddJsonLocalization(); That registers `IStringLocaleFactory` and `IStringLocale`. A backend of your own implements the same two contracts. Code written against Microsoft's `IStringLocalizer` reads the same strings through [`formaui-net.Framework.Localization.StringLocalizerAdapter`](https://github.com/FormaUI/Forma/blob/main/src/Framework/Forma.Framework.Localization.StringLocalizerAdapter/README.md). `NullStringLocaleFactory.Instance` is a factory whose locales return every key -as its own text, with holes filled and plural forms resolved in the source language, and +as its own text, with holes filled and plural and gender forms resolved in the source language, and `GetStringLocaleFactory` resolves the registered factory or that one, which is how Forma's components read their strings where a host registers no localization. @@ -91,10 +91,11 @@ such as one that began before the switch. ### Holes A hole is `{Name}`, optionally with an alignment and a format specifier, `{Name,8}` or -`{Ratio:P1}`. Values pair with the key's holes by position, in the order the holes first appear, -one value per distinct hole; any other count throws `ArgumentException`. A localized string refers to -the holes by name, so it may reorder them, and it may choose its own specifier. A literal brace is -doubled, `{{`, in keys and localized strings alike. +`{Ratio:P1}`. Values pair by position with the names the key uses, its holes and the arguments its +expressions name, in the order each name first appears, one value per distinct name; any other count +throws `ArgumentException`. A localized string refers to the holes by name, so it may reorder them, +and it may choose its own specifier. A literal brace is doubled, `{{`, in keys and localized strings +alike. ### Plural forms @@ -118,9 +119,41 @@ count's category directly: CommonPluralRuleSet.Default.Select(CultureInfo.GetCultureInfo("he"), 2) // PluralCategory.Two ``` +### Gender forms + +A gender expression selects one of its fields by whom the string is about: + +```text +[$ [Rider] gender; female: Escaladora; other: Escalador; $] +``` + +`[Rider]` names the argument holding the gender, and is left out when the gender is the only value. +The fields are `female`, `male` and `other`, and each language writes the ones its words change for: +Spanish writes `female` beside `other` for a climber, and a language whose words don't change writes +`other` alone. A field a localized string omits falls back to `other`. + +The argument is an enum value or a string, and selects the field its name spells, whatever its +case: `Gender.Female` and `"female"` select `female`. A null, or a name without a field of its own, +such as `NonBinary`, selects `other`. + +A key whose gender is its only value carries no expression where its words are the same for +everyone, and its localization reads the value unnamed. A key with other values carries the +expression with `other` alone, which names the argument, so the values pair with `[Rider]` and +`{Name}` in the order they first appear: + +```csharp +locale["Climber", rider.Gender] +locale["[$ [Rider] gender; other: {Name} is the best climber; $]", rider.Gender, rider.Name] +``` + +```json +"Climber": "[$ gender; female: Escaladora; other: Escalador; $]", +"[$ [Rider] gender; other: {Name} is the best climber; $]": "[$ [Rider] gender; female: {Name} es la mejor escaladora; other: {Name} es el mejor escalador; $]" +``` + ### Rendering holes as markup -`Resolve` returns the localized format with its plural forms selected and its holes still open, so +`Resolve` returns the localized format with its plural and gender forms selected and its holes still open, so a caller can render a hole as something other than text, such as a link or a component: ```csharp @@ -379,7 +412,7 @@ instead. | `LocalizedText` | A localized string: `Value`, `Name`, `ResourceNotFound`, `SearchedLocation`. | | `LocalizedPattern` | A localized format with its holes open: `Format`, `Arguments`, `EnumerateSegments()`. | | `LocalizedSegment` | One run of a format: literal `Text`, or a hole with a `Name`, `Alignment` and `Format`. | -| `LocalizedFormat` | Pairs values with a format's holes, `Bind`, and renders it, `Render`, without a locale. | +| `LocalizedFormat` | Pairs values with the names a format uses, `Bind`, and renders it, `Render`, without a locale. | | `CommonPluralRuleSet` | The CLDR plural rules behind `IPluralRuleSet`, in `Forma.Framework.Localization.Language`. | The `Forma.Framework.Localization.Files` and `Forma.Framework.Localization.Parser` namespaces read diff --git a/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/Fixtures/Gendered/.locales/es.json b/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/Fixtures/Gendered/.locales/es.json new file mode 100644 index 000000000..8aaf622ac --- /dev/null +++ b/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/Fixtures/Gendered/.locales/es.json @@ -0,0 +1,5 @@ +{ + "$localization": "SchemaVersion: 1.0.0; Culture: es;", + "Climber": "[$ gender; female: Escaladora; other: Escalador; $]", + "[$ [Rider] gender; other: {Name} is the best climber; $]": "[$ [Rider] gender; female: {Name} es la mejor escaladora; other: {Name} es el mejor escalador; $]" +} diff --git a/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/Fixtures/ResourceSources.cs b/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/Fixtures/ResourceSources.cs index 06260514c..c85d64397 100644 --- a/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/Fixtures/ResourceSources.cs +++ b/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/Fixtures/ResourceSources.cs @@ -16,6 +16,9 @@ public sealed class PathScoped; /// A type whose localized string carries a plural expression. public sealed class Pluralized; +/// A type whose localized strings carry a gender expression. +public sealed class Gendered; + /// A type whose file carries no metadata entry. public sealed class Unmarked; diff --git a/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/JsonStringLocaleTests.cs b/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/JsonStringLocaleTests.cs index ac467952b..51c68a60f 100644 --- a/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/JsonStringLocaleTests.cs +++ b/tests/unit/Framework/Forma.Framework.Localization.Json.Tests/JsonStringLocaleTests.cs @@ -5,6 +5,12 @@ namespace Forma.Framework.Localization.Json.Tests; public sealed class JsonStringLocaleTests { + private enum RiderGender + { + Female, + Male, + } + private static IStringLocale CreateLocale() => new JsonStringLocaleFactory().Create(typeof(T)); @@ -571,6 +577,38 @@ public void Should_evaluate_the_plural_expression_in_a_text() }); } + [Fact] + public void Should_evaluate_the_gender_expression_in_a_text() + { + // Arrange + using var culture = new CultureScope("es"); + var strings = CreateLocale(); + + // Act + var female = strings["Climber", RiderGender.Female]; + var male = strings["Climber", RiderGender.Male]; + + // Assert + Assert.Equal(["Escaladora", "Escalador"], [female.Value, male.Value]); + } + + [Theory] + [InlineData("es", "Ana es la mejor escaladora")] + [InlineData("en", "Ana is the best climber")] + public void Should_pair_a_gender_the_key_names_with_its_holes(string language, string expected) + { + // Arrange + const string Key = "[$ [Rider] gender; other: {Name} is the best climber; $]"; + using var culture = new CultureScope(language); + var strings = CreateLocale(); + + // Act + var localized = strings[Key, RiderGender.Female, "Ana"]; + + // Assert + Assert.Equal(expected, localized.Value); + } + [Theory] [InlineData("[$ plural; one: # file; other: # files $]")] [InlineData("[$ select; male: his; female: her; $]")] diff --git a/tests/unit/Framework/Forma.Framework.Localization.Tests/Language/PluralExpressionEvaluatorLanguageTests.cs b/tests/unit/Framework/Forma.Framework.Localization.Tests/Language/LocaleExpressionEvaluatorLanguageTests.cs similarity index 96% rename from tests/unit/Framework/Forma.Framework.Localization.Tests/Language/PluralExpressionEvaluatorLanguageTests.cs rename to tests/unit/Framework/Forma.Framework.Localization.Tests/Language/LocaleExpressionEvaluatorLanguageTests.cs index da5942022..498f7995e 100644 --- a/tests/unit/Framework/Forma.Framework.Localization.Tests/Language/PluralExpressionEvaluatorLanguageTests.cs +++ b/tests/unit/Framework/Forma.Framework.Localization.Tests/Language/LocaleExpressionEvaluatorLanguageTests.cs @@ -1,13 +1,13 @@ namespace Forma.Framework.Localization.Tests.Language; -public sealed class PluralExpressionEvaluatorLanguageTests +public sealed class LocaleExpressionEvaluatorLanguageTests { private const string English = "[$ plural; one: # file; other: # files; $]"; private const string Hebrew = "[$ plural; one: קובץ אחד; two: שני קבצים; other: # קבצים; $]"; private const string Arabic = "[$ plural; zero: لا ملفات; one: ملف واحد; two: ملفان; few: # ملفات; many: # ملفًا; other: # ملف; $]"; private const string French = "[$ plural; one: # fichier; many: # millions de fichiers; other: # fichiers; $]"; - private static readonly PluralExpressionEvaluator Evaluator = new(CommonPluralRuleSet.Default); + private static readonly LocaleExpressionEvaluator Evaluator = new(CommonPluralRuleSet.Default); [Theory] [InlineData("en", English, 0, "0 files")] diff --git a/tests/unit/Framework/Forma.Framework.Localization.Tests/Language/PluralExpressionEvaluatorTests.cs b/tests/unit/Framework/Forma.Framework.Localization.Tests/Language/LocaleExpressionEvaluatorTests.cs similarity index 57% rename from tests/unit/Framework/Forma.Framework.Localization.Tests/Language/PluralExpressionEvaluatorTests.cs rename to tests/unit/Framework/Forma.Framework.Localization.Tests/Language/LocaleExpressionEvaluatorTests.cs index dcaea4d7c..3e9981b57 100644 --- a/tests/unit/Framework/Forma.Framework.Localization.Tests/Language/PluralExpressionEvaluatorTests.cs +++ b/tests/unit/Framework/Forma.Framework.Localization.Tests/Language/LocaleExpressionEvaluatorTests.cs @@ -2,7 +2,7 @@ namespace Forma.Framework.Localization.Tests.Language; using Forma.Framework.Localization.Language; -public sealed class PluralExpressionEvaluatorTests +public sealed class LocaleExpressionEvaluatorTests { private const string AllFields = "[$ [count] plural; zero: none; one: # one; two: # two; few: # few; many: # many; other: # other; $]"; @@ -19,7 +19,7 @@ private static LocalizedArgument Count(object? value) public void Should_choose_the_field_the_rules_select(PluralCategory category, string expected) { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(category)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(category)); // Act var evaluated = evaluator.Evaluate(AllFields, CultureInfo.InvariantCulture, [Count(3)]); @@ -32,7 +32,7 @@ public void Should_choose_the_field_the_rules_select(PluralCategory category, st public void Should_leave_a_hash_alone_when_the_text_holds_no_expression() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act var evaluated = evaluator.Evaluate("Issue #42 in C# is #1.", CultureInfo.InvariantCulture, []); @@ -45,7 +45,7 @@ public void Should_leave_a_hash_alone_when_the_text_holds_no_expression() public void Should_leave_a_hash_outside_an_expression_alone() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act var evaluated = evaluator.Evaluate( @@ -61,7 +61,7 @@ public void Should_leave_a_hash_outside_an_expression_alone() public void Should_write_a_doubled_hash_in_a_field_as_a_literal_hash() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act var evaluated = evaluator.Evaluate( @@ -77,7 +77,7 @@ public void Should_write_a_doubled_hash_in_a_field_as_a_literal_hash() public void Should_write_the_count_beside_a_literal_hash() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); // Act var evaluated = evaluator.Evaluate( @@ -93,7 +93,7 @@ public void Should_write_the_count_beside_a_literal_hash() public void Should_keep_a_doubled_hash_outside_an_expression_as_written() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act var evaluated = evaluator.Evaluate( @@ -109,7 +109,7 @@ public void Should_keep_a_doubled_hash_outside_an_expression_as_written() public void Should_read_the_sole_argument_for_an_expression_naming_none() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act var evaluated = evaluator.Evaluate( @@ -125,7 +125,7 @@ public void Should_read_the_sole_argument_for_an_expression_naming_none() public void Should_reject_an_expression_naming_no_argument_when_more_than_one_is_supplied() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act & Assert Assert.Throws(() => evaluator.Evaluate( @@ -138,7 +138,7 @@ public void Should_reject_an_expression_naming_no_argument_when_more_than_one_is public void Should_reject_an_expression_naming_no_argument_when_the_argument_is_named() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act & Assert Assert.Throws(() => evaluator.Evaluate( @@ -151,7 +151,7 @@ public void Should_reject_an_expression_naming_no_argument_when_the_argument_is_ public void Should_fall_back_to_other_when_the_text_omits_the_chosen_field() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Many)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Many)); // Act var evaluated = evaluator.Evaluate("[$ [count] plural; one: # file; other: # files; $]", CultureInfo.InvariantCulture, [Count(7)]); @@ -164,7 +164,7 @@ public void Should_fall_back_to_other_when_the_text_omits_the_chosen_field() public void Should_fall_back_to_other_when_the_rules_carry_no_entry_for_the_language() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(category: null)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(category: null)); // Act var evaluated = evaluator.Evaluate(AllFields, CultureInfo.InvariantCulture, [Count(3)]); @@ -177,7 +177,7 @@ public void Should_fall_back_to_other_when_the_rules_carry_no_entry_for_the_lang public void Should_leave_other_holes_open_for_formatting() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); // Act var evaluated = evaluator.Evaluate("[$ [count] plural; other: # files; $] in {album}", CultureInfo.InvariantCulture, [Count(2), new LocalizedArgument("album", "Photos")]); @@ -190,7 +190,7 @@ public void Should_leave_other_holes_open_for_formatting() public void Should_resolve_every_plural_expression_in_one_sentence() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act var evaluated = evaluator.Evaluate( @@ -206,7 +206,7 @@ public void Should_resolve_every_plural_expression_in_one_sentence() public void Should_return_a_format_without_plurals_unchanged() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); // Act var evaluated = evaluator.Evaluate("Stored {stored} of {total}.", CultureInfo.InvariantCulture, [new LocalizedArgument("stored", 1), new LocalizedArgument("total", 2)]); @@ -219,7 +219,7 @@ public void Should_return_a_format_without_plurals_unchanged() public void Should_treat_a_missing_argument_as_no_count() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Zero)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Zero)); // Act var evaluated = evaluator.Evaluate(AllFields, CultureInfo.InvariantCulture, []); @@ -235,7 +235,7 @@ public void Should_treat_a_missing_argument_as_no_count() public void Should_leave_a_malformed_plural_expression_alone(string format) { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act var evaluated = evaluator.Evaluate(format, CultureInfo.InvariantCulture, [Count(1)]); @@ -249,7 +249,7 @@ public void Should_leave_a_expression_named_for_something_else_alone() { // Arrange const string Format = "[$ select {count}; male: his; female: her; $] bike"; - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.One)); // Act var evaluated = evaluator.Evaluate(Format, CultureInfo.InvariantCulture, [Count(1)]); @@ -262,7 +262,7 @@ public void Should_leave_a_expression_named_for_something_else_alone() public void Should_treat_a_count_that_is_not_a_number_as_zero() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); // Act var evaluated = evaluator.Evaluate("[$ [count] plural; other: # files; $]", CultureInfo.InvariantCulture, [Count("abc")]); @@ -276,7 +276,7 @@ public void Should_report_an_argument_that_is_not_a_count_once_per_format_withou { // Arrange using var loggerFactory = new FakeLoggerFactory(); - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other), loggerFactory.CreateLogger("plural")); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other), loggerFactory.CreateLogger("plural")); // Act var first = evaluator.Evaluate(AllFields, CultureInfo.InvariantCulture, [Count("secret")]); @@ -301,7 +301,7 @@ public void Should_report_an_argument_that_is_not_a_count_as_a_warning_under_dia { // Arrange using var loggerFactory = new FakeLoggerFactory(); - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other), loggerFactory.CreateLogger("plural"), new LocalizationDiagnostics()); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other), loggerFactory.CreateLogger("plural"), new LocalizationDiagnostics()); // Act _ = evaluator.Evaluate(AllFields, CultureInfo.InvariantCulture, [Count("secret")]); @@ -316,12 +316,12 @@ public void Should_report_an_argument_that_is_not_a_count_as_a_warning_under_dia [Fact] public void Should_reject_a_null_rule_set() - => Assert.Throws(() => new PluralExpressionEvaluator(null!)); + => Assert.Throws(() => new LocaleExpressionEvaluator(null!)); [Fact] public void Should_reject_a_null_format() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); // Assert Assert.Throws(() => evaluator.Evaluate(null!, CultureInfo.InvariantCulture, [])); @@ -331,9 +331,171 @@ public void Should_reject_a_null_format() public void Should_reject_a_null_culture() { // Arrange - var evaluator = new PluralExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other)); // Assert Assert.Throws(() => evaluator.Evaluate(AllFields, null!, [])); } + + public sealed class Gender + { + private const string Format = "[$ [Rider] gender; female: Escaladora; male: Escalador; other: Ciclista; $]"; + + public enum RiderGender + { + Female, + Male, + Unstated, + } + + private static LocaleExpressionEvaluator CreateEvaluator() + => new(new StubPluralRuleSet(PluralCategory.Other)); + + private static LocalizedArgument Rider(object? value) + => new("Rider", value); + + [Theory] + [InlineData(RiderGender.Female, "Escaladora")] + [InlineData(RiderGender.Male, "Escalador")] + public void Should_choose_the_field_an_enum_member_names(RiderGender gender, string expected) + { + // Act + var evaluated = CreateEvaluator().Evaluate(Format, CultureInfo.InvariantCulture, [Rider(gender)]); + + // Assert + Assert.Equal(expected, evaluated); + } + + [Theory] + [InlineData("female", "Escaladora")] + [InlineData("FEMALE", "Escaladora")] + [InlineData("Male", "Escalador")] + public void Should_choose_the_field_a_string_names_whatever_its_case(string gender, string expected) + { + // Act + var evaluated = CreateEvaluator().Evaluate(Format, CultureInfo.InvariantCulture, [Rider(gender)]); + + // Assert + Assert.Equal(expected, evaluated); + } + + [Theory] + [InlineData(RiderGender.Unstated)] + [InlineData("nonbinary")] + [InlineData(null)] + public void Should_choose_other_for_a_gender_without_a_field_of_its_own(object? gender) + { + // Act + var evaluated = CreateEvaluator().Evaluate(Format, CultureInfo.InvariantCulture, [Rider(gender)]); + + // Assert + Assert.Equal("Ciclista", evaluated); + } + + [Fact] + public void Should_fall_back_to_other_when_the_text_omits_the_named_field() + { + // Act + var evaluated = CreateEvaluator().Evaluate( + "[$ [Rider] gender; female: Escaladora; other: Escalador; $]", + CultureInfo.InvariantCulture, + [Rider(RiderGender.Male)]); + + // Assert + Assert.Equal("Escalador", evaluated); + } + + [Fact] + public void Should_read_the_sole_argument_for_an_expression_naming_none() + { + // Act + var evaluated = CreateEvaluator().Evaluate( + "[$ gender; female: Escaladora; other: Escalador; $]", + CultureInfo.InvariantCulture, + [LocalizedArgument.Unnamed(RiderGender.Female)]); + + // Assert + Assert.Equal("Escaladora", evaluated); + } + + [Fact] + public void Should_write_a_hash_in_a_field_as_written() + { + // Act + var evaluated = CreateEvaluator().Evaluate( + "[$ [Rider] gender; female: La #1; other: El #1; $]", + CultureInfo.InvariantCulture, + [Rider(RiderGender.Female)]); + + // Assert + Assert.Equal("La #1", evaluated); + } + + [Fact] + public void Should_resolve_a_gender_and_a_plural_in_one_sentence() + { + // Act + var evaluated = CreateEvaluator().Evaluate( + "{Name} [$ [Rider] gender; female: ganó; other: ganó; $] [$ [Stages] plural; one: # etapa; other: # etapas; $], [$ [Rider] gender; female: invicta; other: invicto; $]", + CultureInfo.InvariantCulture, + [new LocalizedArgument("Name", "Ana"), Rider(RiderGender.Female), new LocalizedArgument("Stages", 3)]); + + // Assert + Assert.Equal("{Name} ganó 3 etapas, invicta", evaluated); + } + + [Fact] + public void Should_report_a_gender_that_is_neither_an_enum_nor_a_string_once_per_format_without_its_value() + { + // Arrange + using var loggerFactory = new FakeLoggerFactory(); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other), loggerFactory.CreateLogger("gender")); + + // Act + var first = evaluator.Evaluate(Format, CultureInfo.InvariantCulture, [Rider(1)]); + var second = evaluator.Evaluate(Format, CultureInfo.InvariantCulture, [Rider(1)]); + + // Assert + var entry = Assert.Single(loggerFactory.Entries); + Assert.Multiple(() => + { + Assert.Equal("Ciclista", first); + Assert.Equal("Ciclista", second); + Assert.Equal(Microsoft.Extensions.Logging.LogLevel.Debug, entry.Level); + Assert.Equal(9, entry.EventId.Id); + Assert.Equal("Rider", entry.Fields["Argument"]); + Assert.Equal("Int32", entry.Fields["ArgumentType"]); + Assert.Contains("neither an enum nor a string", entry.Message, StringComparison.Ordinal); + }); + } + + [Fact] + public void Should_report_a_gender_that_is_neither_an_enum_nor_a_string_as_a_warning_under_diagnostics() + { + // Arrange + using var loggerFactory = new FakeLoggerFactory(); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other), loggerFactory.CreateLogger("gender"), new LocalizationDiagnostics()); + + // Act + _ = evaluator.Evaluate(Format, CultureInfo.InvariantCulture, [Rider(1)]); + + // Assert + var entry = Assert.Single(loggerFactory.Entries); + Assert.Equal(Microsoft.Extensions.Logging.LogLevel.Warning, entry.Level); + } + + [Fact] + public void Should_report_nothing_for_a_null_gender() + { + // Arrange + using var loggerFactory = new FakeLoggerFactory(); + var evaluator = new LocaleExpressionEvaluator(new StubPluralRuleSet(PluralCategory.Other), loggerFactory.CreateLogger("gender"), new LocalizationDiagnostics()); + + // Act + _ = evaluator.Evaluate(Format, CultureInfo.InvariantCulture, [Rider(null)]); + + // Assert + Assert.Empty(loggerFactory.Entries); + } + } } diff --git a/tests/unit/Framework/Forma.Framework.Localization.Tests/LocalizedFormatTests.cs b/tests/unit/Framework/Forma.Framework.Localization.Tests/LocalizedFormatTests.cs index 992cfcc72..c52606ca1 100644 --- a/tests/unit/Framework/Forma.Framework.Localization.Tests/LocalizedFormatTests.cs +++ b/tests/unit/Framework/Forma.Framework.Localization.Tests/LocalizedFormatTests.cs @@ -32,6 +32,38 @@ public void Should_hold_a_lone_value_unnamed_when_the_format_names_no_hole() Assert.Equal([LocalizedArgument.Unnamed(2)], arguments); } + [Fact] + public void Should_pair_values_with_the_holes_and_the_expressions_arguments_in_the_order_they_first_appear() + { + // Act + var arguments = LocalizedFormat.Bind("{Team}: [$ [Rider] gender; other: {Name} won; $] in {Stage}", "Azul", "female", "Ana", 3); + + // Assert + Assert.Equal( + [new LocalizedArgument("Team", "Azul"), new LocalizedArgument("Rider", "female"), new LocalizedArgument("Name", "Ana"), new LocalizedArgument("Stage", 3)], + arguments); + } + + [Fact] + public void Should_count_an_argument_an_expression_names_once_with_its_hole() + { + // Act + var arguments = LocalizedFormat.Bind("{Count} [$ [Count] plural; one: file; other: files; $] in {Folder}", 2, "Photos"); + + // Assert + Assert.Equal([new LocalizedArgument("Count", 2), new LocalizedArgument("Folder", "Photos")], arguments); + } + + [Fact] + public void Should_name_the_value_an_expression_names_when_the_format_has_no_hole() + { + // Act + var arguments = LocalizedFormat.Bind("[$ [Rider] gender; other: Climber; $]", "female"); + + // Assert + Assert.Equal([new LocalizedArgument("Rider", "female")], arguments); + } + [Fact] public void Should_pair_nothing_for_a_format_with_neither_holes_nor_values() => Assert.Empty(LocalizedFormat.Bind("Save")); @@ -40,6 +72,7 @@ public void Should_pair_nothing_for_a_format_with_neither_holes_nor_values() [InlineData("Stored {stored} of {total}.", 1)] [InlineData("Stored {stored} of {total}.", 3)] [InlineData("Save", 2)] + [InlineData("[$ [Rider] gender; other: {Name} won; $]", 1)] public void Should_reject_a_value_count_the_format_has_no_holes_for(string format, int count) => Assert.Throws(() => LocalizedFormat.Bind(format, new object?[count])); From 14b1bb9577cff0c47c5444ee3237be031b0843d6 Mon Sep 17 00:00:00 2001 From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com> Date: Fri, 20 Nov 2026 03:42:24 +0200 Subject: [PATCH 3/8] build: lint with Locali 1.0.0-preview.26 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8e67e23c4..c56410cb7 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "formaui-net.locali": { - "version": "1.0.0-preview.25", + "version": "1.0.0-preview.26", "commands": [ "locali" ], From 76173cc91b721ccd7ab901e26ce5839e549a6940 Mon Sep 17 00:00:00 2001 From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com> Date: Fri, 20 Nov 2026 09:37:18 +0200 Subject: [PATCH 4/8] test(culture): name what the document reads when it doesn't take a culture in time --- .../CulturePages.cs | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/e2e/Forma.Blazor.Browser.Tests/CulturePages.cs b/tests/e2e/Forma.Blazor.Browser.Tests/CulturePages.cs index 4bef5fb9b..c205f0b4a 100644 --- a/tests/e2e/Forma.Blazor.Browser.Tests/CulturePages.cs +++ b/tests/e2e/Forma.Blazor.Browser.Tests/CulturePages.cs @@ -22,7 +22,28 @@ public static async Task WaitForDocumentAsync(IPage page, string document, float { ArgumentNullException.ThrowIfNull(page); - await page.WaitForFunctionAsync("expected => `${document.documentElement.lang}/${document.documentElement.dir}` === expected", document, new() { Timeout = timeout }).ConfigureAwait(false); + try + { + await page.WaitForFunctionAsync("expected => `${document.documentElement.lang}/${document.documentElement.dir}` === expected", document, new() { Timeout = timeout }).ConfigureAwait(false); + } + catch (TimeoutException exception) + { + throw new TimeoutException($"The document didn't read {document} within {timeout} ms: {await DescribeDocumentAsync(page).ConfigureAwait(false)}", exception); + } + } + + // The document's language and direction, and the UI culture of the marker it started from, which a page whose coordinator never + // started lacks. + private static async Task DescribeDocumentAsync(IPage page) + { + try + { + return await page.EvaluateAsync("() => `it reads ${document.documentElement.lang}/${document.documentElement.dir}, and its culture marker names ${document.head.querySelector('meta[name=\"forma-culture\"]')?.getAttribute('data-ui-culture') ?? 'nothing, since the page carries none'}`").ConfigureAwait(false); + } + catch (PlaywrightException exception) + { + return $"it couldn't be read: {exception.Message}"; + } } /// Waits until the Server's culture panel on the page is interactive. From 70c3da20aac386bc2a16e2981d50cdd59afe1a96 Mon Sep 17 00:00:00 2001 From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:09:47 +0200 Subject: [PATCH 5/8] test(feedback): wait for the popover to show before reading its placement --- .../e2e/Forma.Blazor.Browser.Tests/Components/FeedbackTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/Forma.Blazor.Browser.Tests/Components/FeedbackTests.cs b/tests/e2e/Forma.Blazor.Browser.Tests/Components/FeedbackTests.cs index c6d58cc76..7ccd87989 100644 --- a/tests/e2e/Forma.Blazor.Browser.Tests/Components/FeedbackTests.cs +++ b/tests/e2e/Forma.Blazor.Browser.Tests/Components/FeedbackTests.cs @@ -157,9 +157,10 @@ public async Task Should_open_below_its_anchor_at_the_anchor_s_start(string runt var details = page.Locator("#details"); var trigger = page.Locator("#details-trigger"); - // Act + // Act — the layer is stamped as the popover registers, ahead of the call that shows and places it await trigger.ClickAsync(); await WaitForLayerAsync(details); + await Assertions.Expect(details).ToBeVisibleAsync(); // Assert — four pixels below the anchor, its start edge held four pixels within the viewport var anchor = (await page.Locator("span", new() { Has = trigger }).BoundingBoxAsync())!; From eca108545fbc958b78cb94309159510ffabce911 Mon Sep 17 00:00:00 2001 From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com> Date: Fri, 20 Nov 2026 15:19:59 +0200 Subject: [PATCH 6/8] test(transfer): paste each document of megabytes as paragraphs Chromium lays out a paragraph that takes its direction from its own text in time growing with the square of the paragraph's length, so one paragraph of two megabytes held the page for up to half a minute; in paragraphs it takes no longer than WebKit does, and the export check waits as long as any other. --- .../Components/TransferTests.cs | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tests/e2e/Forma.Blazor.Browser.Tests/Components/TransferTests.cs b/tests/e2e/Forma.Blazor.Browser.Tests/Components/TransferTests.cs index 35bf8bab6..fffa9914d 100644 --- a/tests/e2e/Forma.Blazor.Browser.Tests/Components/TransferTests.cs +++ b/tests/e2e/Forma.Blazor.Browser.Tests/Components/TransferTests.cs @@ -14,15 +14,20 @@ public sealed class TransferTests // for a script's. private static readonly LocatorAssertionsToHaveTextOptions Saved = new() { Timeout = 30_000 }; - // A paste of megabytes is taken, and its preview drawn, on WebAssembly's one thread, which a loaded runner took longer than - // half a minute to do, so the check waits for each as long as for WebAssembly to start. - private static readonly LocatorAssertionsToHaveTextOptions Taken = new() { Timeout = 60_000 }; - private static readonly LocatorClickOptions Drawn = new() { Timeout = 60_000 }; + // A document of two megabytes in words and paragraphs, as a reader's document runs, since WebKit takes half a minute to lay out + // as much on one unbroken line, and Chromium lays out a paragraph that takes its direction from its own text, as the composer's + // do, in time growing with the square of the paragraph's length. + private const int ParagraphWords = 100; + private const int Paragraphs = 2_000; // A value as the check page writes it: its length and the start of its SHA-256. private static string Describe(string value) => $"{value.Length}:{Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(value)))[..16]}"; + // The document of two megabytes, every word of it the one given. + private static string CreateDocument(string word) + => string.Concat(Enumerable.Repeat($"

{string.Join(' ', Enumerable.Repeat(word, ParagraphWords))}

", Paragraphs)); + public sealed class Forms(BrowserHost host) { [Theory] @@ -72,15 +77,14 @@ public async Task Should_save_a_document_of_megabytes_pasted_into_the_rich_text_ await using var _ = context; var canvas = page.Locator("#forma-body .forma-composer-rich-text-canvas"); await WaitForInputScopeAsync(page, "#forma-body .forma-composer-rich-text-canvas"); - // Two megabytes as words, as a reader's text runs, since WebKit takes half a minute to lay out as much on one unbroken line. - const int Words = 200_000; - await canvas.EvaluateAsync("(canvas, words) => { canvas.focus(); canvas.innerHTML = '

' + Array(words).fill('xxxxxxxxx').join(' ') + '

'; canvas.dispatchEvent(new Event('input', { bubbles: true })); }", Words); + var document = CreateDocument("xxxxxxxxx"); + await canvas.EvaluateAsync("(canvas, html) => { canvas.focus(); canvas.innerHTML = html; canvas.dispatchEvent(new Event('input', { bubbles: true })); }", document); // Act await page.Locator("#forma-save").ClickAsync(); // Assert - await Assertions.Expect(page.Locator("#forma-body-saved")).ToHaveTextAsync(Describe($"

{string.Join(' ', Enumerable.Repeat("xxxxxxxxx", Words))}

"), Saved); + await Assertions.Expect(page.Locator("#forma-body-saved")).ToHaveTextAsync(Describe(document), Saved); } [Theory] @@ -232,12 +236,10 @@ public async Task Should_export_a_document_of_megabytes_from_its_preview(string await using var _ = context; var canvas = page.Locator("#forma-body .forma-composer-rich-text-canvas"); await WaitForInputScopeAsync(page, "#forma-body .forma-composer-rich-text-canvas"); - // Two megabytes as words, as a reader's text runs, since WebKit takes half a minute to lay out as much on one unbroken line. - const int Words = 200_000; - await canvas.EvaluateAsync("(canvas, words) => { canvas.focus(); canvas.innerHTML = '

' + Array(words).fill('zzzzzzzzz').join(' ') + '

'; canvas.dispatchEvent(new Event('input', { bubbles: true })); }", Words); - var document = $"

{string.Join(' ', Enumerable.Repeat("zzzzzzzzz", Words))}

"; - await Assertions.Expect(page.Locator("#forma-body-length")).ToHaveTextAsync(document.Length.ToString(CultureInfo.InvariantCulture), Taken); - await page.Locator("#forma-body").GetByRole(AriaRole.Tab, new() { Name = "Preview", Exact = true }).ClickAsync(Drawn); + var document = CreateDocument("zzzzzzzzz"); + await canvas.EvaluateAsync("(canvas, html) => { canvas.focus(); canvas.innerHTML = html; canvas.dispatchEvent(new Event('input', { bubbles: true })); }", document); + await Assertions.Expect(page.Locator("#forma-body-length")).ToHaveTextAsync(document.Length.ToString(CultureInfo.InvariantCulture)); + await page.Locator("#forma-body").GetByRole(AriaRole.Tab, new() { Name = "Preview", Exact = true }).ClickAsync(); var export = page.Locator("#forma-body .forma-composer-toolbar").GetByRole(AriaRole.Button, new() { Name = "Export HTML", Exact = true }); // Act @@ -245,7 +247,7 @@ public async Task Should_export_a_document_of_megabytes_from_its_preview(string // Assert — the page the browser composed, the document whole within it var exported = await page.EvaluateAsync("address => fetch(address).then(response => response.text()).then(text => text.split('zzzzzzzzz').length - 1)", download.Url); - Assert.Equal(Words, exported); + Assert.Equal(Paragraphs * ParagraphWords, exported); } // The name as an item of the list holds it. From a65ae71f83baf97f943c4eea8f47ee086e429633 Mon Sep 17 00:00:00 2001 From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com> Date: Fri, 20 Nov 2026 16:13:29 +0200 Subject: [PATCH 7/8] test(culture): name the window titles and a later switch when a web view's document misses Hebrew --- .../WebViewExampleTests.cs | 45 ++++++++++++++++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/tests/e2e/Forma.Blazor.Browser.Tests/WebViewExampleTests.cs b/tests/e2e/Forma.Blazor.Browser.Tests/WebViewExampleTests.cs index 142620680..cf76aca41 100644 --- a/tests/e2e/Forma.Blazor.Browser.Tests/WebViewExampleTests.cs +++ b/tests/e2e/Forma.Blazor.Browser.Tests/WebViewExampleTests.cs @@ -31,8 +31,8 @@ public async Task Should_switch_every_web_view_and_native_window_title_with_stri await first.Locator(".hebrew").ClickAsync(); // Assert - await ExpectHebrewAsync(first); - await ExpectHebrewAsync(second); + await ExpectHebrewAsync(application, first); + await ExpectHebrewAsync(application, second); await WaitForTitlesAsync(windows, HebrewTitle); Assert.False(Directory.Exists(Path.Combine(application.Folder, ".locales")), "The publish carries no folder of locale files, so the host's strings come from its assembly."); } @@ -57,7 +57,7 @@ public async Task Should_keep_switching_the_native_window_left_and_its_web_view_ await first.Locator(".hebrew").ClickAsync(); // Assert - await ExpectHebrewAsync(first); + await ExpectHebrewAsync(application, first); await WaitForTitlesAsync(opened, HebrewTitle); Assert.False(application.HasExited, $"The application exited as its other native window closed. It wrote:{Environment.NewLine}{application.GetOutput(40)}"); } @@ -71,7 +71,7 @@ public async Task Should_start_in_the_culture_its_last_run_saved(string example) { var page = await OpenInEnglishAsync(previous); await page.Locator(".hebrew").ClickAsync(); - await ExpectHebrewAsync(page); + await ExpectHebrewAsync(previous, page); NativeWindows.Close((await WaitForWindowsAsync(previous, 1)).Single()); await previous.WaitForExitAsync(); } @@ -81,7 +81,7 @@ public async Task Should_start_in_the_culture_its_last_run_saved(string example) var restarted = await application.GetOtherWebViewAsync([], Runtime); // Assert - await ExpectHebrewAsync(restarted); + await ExpectHebrewAsync(application, restarted); await WaitForTitlesAsync(await WaitForWindowsAsync(application, 1), HebrewTitle); await restarted.Locator(".english").ClickAsync(); await Assertions.Expect(restarted.Locator(".welcome")).ToHaveTextAsync("Welcome"); @@ -103,11 +103,42 @@ private static async Task OpenInEnglishAsync(WebViewApplication applicati } // The host's own string, from the files its application embeds, the library's from the Hebrew pack, and the document's language and direction. - private static async Task ExpectHebrewAsync(IPage page) + private static async Task ExpectHebrewAsync(WebViewApplication application, IPage page) { await Assertions.Expect(page.Locator(".welcome")).ToHaveTextAsync(Welcome); await Assertions.Expect(page.Locator("nav")).ToHaveAttributeAsync("aria-label", PaginationLabel); - await WaitForDocumentAsync(page, "he/rtl"); + + try + { + await WaitForDocumentAsync(page, "he/rtl"); + } + catch (TimeoutException exception) + { + throw new TimeoutException($"{exception.Message}; {await DescribeFollowingAsync(application, page)}", exception); + } + } + + // What tells a web view its application's coordinator let go of from one whose document missed a single switch: the native + // windows' titles, which follow the application's culture, and whether the document follows a switch to English after it. + private static async Task DescribeFollowingAsync(WebViewApplication application, IPage page) + { + var titles = string.Join(", ", NativeWindows.Find(application.ProcessId).Select(NativeWindows.GetTitle)); + + try + { + await page.Locator(".english").ClickAsync(new() { Timeout = 5000 }); + await WaitForDocumentAsync(page, "en-US/ltr", 5000); + + return $"the native windows' titles read {titles}, and a switch to English after it moved the document to en-US/ltr"; + } + catch (TimeoutException exception) + { + return $"the native windows' titles read {titles}, and a switch to English after it didn't move the document: {exception.Message}"; + } + catch (PlaywrightException exception) + { + return $"the native windows' titles read {titles}, and a switch to English after it couldn't be made: {exception.Message}"; + } } // The application's native windows, once it shows as many as it is asked for. From 88056ea3d87c4efb9b5315c484266aac8c41a281 Mon Sep 17 00:00:00 2001 From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com> Date: Fri, 20 Nov 2026 16:17:56 +0200 Subject: [PATCH 8/8] chore: release 1.0.0-preview.12 --- CHANGELOG.md | 2 +- Directory.Build.props | 2 +- docs/features-status.md | 2 +- src/Framework/Forma.Framework.Localization/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd467561f..57db3ae13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ set out. What Forma gained before its first release, month by month, is in [the ## `1.0.0-preview.12` -*Unreleased* +*November 20, 2026* - A gender expression chooses a string's words by whom it is about, as a plural expression chooses them by a count: `[$ [Rider] gender; female: Escaladora; other: Escalador; $]`. Its fields are `female`, `male` and `other`, and an diff --git a/Directory.Build.props b/Directory.Build.props index 4a79036f0..85ff12137 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -27,7 +27,7 @@ 1.0.0 - preview.11 + preview.12 diff --git a/docs/features-status.md b/docs/features-status.md index 6ba814047..427c64586 100644 --- a/docs/features-status.md +++ b/docs/features-status.md @@ -7,7 +7,7 @@ | Measure | Now | | --- | --- | | Components | 67 implemented and 7 in progress, as [the catalog](component-catalog.md) lists them, and 21 planned, as [the roadmap](component-roadmap.md) orders them | -| Packages | Every project under `src/` but the Showcase, released from `main` by `release.yml` to nuget.org and the organization's GitHub feed, the latest published release `1.0.0-preview.11` | +| Packages | Every project under `src/` but the Showcase, released from `main` by `release.yml` to nuget.org and the organization's GitHub feed, the latest published release `1.0.0-preview.12` | | Render modes | Interactive Server, WebAssembly and Auto implemented: every call a component makes to a script and every call back checked in each, and on the Server in WebKit, the engine of Safari and of Apple's web views, every runtime on a page following its culture coordinator, a client reading its host's own strings, and a host setting either arrangement up as the README says; static rendering implemented, every check page rendered statically with no enabled control that needs interactivity; Blazor Hybrid implemented on WPF, Windows Forms and MAUI on Windows, every component checked in a web view and each host's application set up as the README says; an inventory holds every component to a check page in every render mode | The gate runs every check [the verification design](verification-design.md#gates) sets out, each platform's where the machine can run it. It passes locally on Windows and in CI on Linux, on Windows and on an Android emulator. diff --git a/src/Framework/Forma.Framework.Localization/README.md b/src/Framework/Forma.Framework.Localization/README.md index 51563c26f..aa92f5853 100644 --- a/src/Framework/Forma.Framework.Localization/README.md +++ b/src/Framework/Forma.Framework.Localization/README.md @@ -368,7 +368,7 @@ and referencing this package, whose build does the rest: - +