Vixen
dd8b0a81
csharp
public static class StringCatalogYaml

Reading and writing a StringCatalog as YAML.

Read the guide page for this →

Remarks

⚠ Here rather than on the catalog, and the reason is a package closure. StringCatalog is in Vixen.Ui, which every application that shows a word references; Vixen.Core.Yaml is a serialiser these two methods are the only use of. Leaving them attached would add a package to the pin of every consumer for a code path most of them never call — and an application publishing NativeAOT with a vendored closure pays that in files it has to vendor. So the catalog proper is Set/Find/Ids/Count, and the format is the application's.

The editor's format is YAML for the reason DockLayout gives about layouts: a translation is a file a person diffs, checks in and occasionally repairs by hand. Another application is free to answer differently — JSON through a source-generated reader, or resources — without either choice reaching the other.

Methods (2)

  • public static string Save(this StringCatalog catalog)

    Writes a catalog as YAML.

  • public static StringCatalog Load(string yaml, string language = "source")

    Reads a catalog back.

Used by (3)

  • EditorApplicationVixen.Editor.App
  • ServiceTestsVixen.Editor.Ui.Tests
  • StringCatalogChainTestsVixen.Editor.App.Tests