Osy#betaRun it on Osyrin: osyrin.com

Reference

I18n

13 pages.

A count's plural forms — one text per CLDR category

A message with a whole-number hole (`$"{n} items"`) may take one text per plural category of its language — CLDR's `zero`, `one`, `two`, `few`…

A history in the reader's language — keep what happened, say it when it is read

A timeline, an audit trail or a "why is this here" list is read long after it is written, by readers in other languages. Store WHAT happened — its…

A language's words — locales/<language>.osy

A project's translations are checked-in source: one `locales/<language>.osy` per language, a `translations sv { }` block of `role "source" =>…

Declaring the time zones and cultures an app uses — zones { } and cultures { }

The time zones and cultures an app names are a declared, closed set: a `zones { }` and a `cultures { }` block in any model file (not in `app.osy`)…

Every language's page, for a search engine — hreflang, canonical, sitemap

An app that speaks more than one language tells search engines where each page lives in each one, with nothing written in its source: every public…

Right to left — an app that reads in Arabic with no change to the app

A language written right to left (Arabic, Hebrew, Persian, Urdu) mirrors the whole page: every horizontal side a style prop names is a START or END…

The Translations desk — Osysharp.Localization

`use Osysharp.Localization@0;` gives an app a translator's desk: its words and its `[Translatable]` data in each language it speaks, what is not…

Which language a reader gets — and switching it

A reader's language is, in order: their explicit choice (a `/sv/` address prefix or a language switch), their own `[PreferredCulture]`, the browser's…

Which words are translated — the compiler finds every text a reader sees

You write your app's words where they belong, in ordinary strings. The compiler finds every one a reader can see — by where it goes, not by what it…

[Label] on a field: what a report calls it, in the reader's language

Where the platform names a field itself (a report's field picker, a column heading, a filter read back as a sentence), it says the field's…

[Translatable] — an entity's own words in every language

`[Translatable]` on a stored `string` member keeps a translation per language, in a table beside its entity. Code reads, filters, sorts and writes…

app.SourceLanguage — the language the app is written in

`app.SourceLanguage = "es";` says the app's own text is written in Spanish. The page's `<html lang>` then says `es` when no translation is served…

osy translate — the request for any model, and its answer read back

There is no platform model. `osy translate --to sv,de` brings `locales/sv.osy` and `locales/de.osy` in step with the source and writes…