Denne side er ikke oversat endnu. Den vises på engelsk.
Dette kapitel findes på engelsk og bulgarsk.
Interface languages
The interface of the editor (toolbar, menus, dialogs, messages, panels) comes in ten languages:
| Code | Language |
|---|---|
en-US | English (the default) |
bg-BG | Bulgarian |
de-DE | German |
fr-FR | French |
es-ES | Spanish |
pt-BR | Brazilian Portuguese |
nl-NL | Dutch |
da-DK | Danish |
sv-SE | Swedish |
nb-NO | Norwegian Bokmal |
Choose the language with UiLanguage:
var options = new RteOptions { UiLanguage = "de-DE" }; The value may be a full code (de-DE) or only the language (de, de-AT); the first pack with the same language is used. no and nn map to Norwegian Bokmal. An unknown language, or English, keeps the English texts. To follow the language of the current user, pass the name of the current culture:
options.UiLanguage = CultureInfo.CurrentUICulture.Name; The packs are JSON files inside the assembly. Each holds 528 texts and is keyed by the English text, so a text that is missing from a pack falls back to English. The languages other than English and Bulgarian were translated without a native review and have not been read in a browser; please report wrong wording.
Changing single texts
Labels changes texts by key; Texts replaces texts by their English wording:
options.Labels = new() { ["bold"] = "Strong" };
options.Texts = new() { ["Insert block"] = "Add block" }; Labels wins over Texts and the pack. Texts may contain placeholders such as {count}; keep them in your translation. The label keys are the first argument of the t(...) calls in the scripts under wwwroot/js.
Note: when you set Texts yourself, the language pack is not loaded. To change a few texts of a language, start from the pack:
var texts = new Dictionary<string, string>(RteLanguagePacks.Load("de-DE") ?? []);
texts["Insert block"] = "Add block";
options.Texts = texts; Direction
Direction = RteDirection.Rtl switches the editor to right-to-left. The toolbar has a direction button that changes the direction of the current text.
Spell check
Spellcheck.Language is the language for spell checking and is separate from UiLanguage. The default checker is the one of the browser (Native). A server checker is plugged in through IRteSpellChecker; the default one is only a word list.
Adding a language
To use a language that has no pack, put its texts in Texts (keyed by the English wording) when you create RteOptions. RteLanguagePacks.SupportedLanguages lists the codes that have a pack and RteLanguagePacks.Load(language) returns a pack (or null for English).
Klar til at prøve RayCraft Write?
Start den 14 dages prøve, intet kort nødvendigt.
Start 14 dages prøve