Vixen
02b45cc4
csharp
public readonly record struct StringId

A string the editor shows, named by an id and carrying the source text it says.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The pair is the whole idea, and it is why localisation is not a retrofit. item.Label = EditorStrings.Save.Text is no more work at the call site than item.Label = "Save", so there is never a reason to write the literal — which is the failure Stride's Stride.Core.Translation exists to repair, and repairing it means finding every literal in an editor after the fact.

⚠ The source text lives at the declaration rather than in an en catalog. An editor whose fallback is a file is an editor that shows editor.command.file.save to anybody whose install is missing it, and the missing file is exactly what a localisation bug looks like. Here the worst case is English.

What a Strings.Resource generator would add — doc 11 asks for one — is emitting these declarations from a catalog rather than the other way round, so that an id used nowhere and an id declared nowhere are both build errors. The shape it would emit is EditorStrings, member for member; nothing at a call site changes when it lands.

Fields and properties (3)

  • public string Id

    What a catalog calls it: editor.command.file.save.

  • public string Source

    What it says as it was written here, and what it says when nothing translates it.

  • public string Text

    What it says in the current language.

Methods (2)

  • public StringId(string Id, string Source)

    A string the editor shows, named by an id and carrying the source text it says.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

Used by (67, showing 40)

  • AssetPickerVixen.Editor.App
  • BlockoutModeVixen.Editor.Blockout
  • BlockoutModeTestsVixen.Editor.Blockout.Tests
  • BlockoutModuleVixen.Editor.Blockout
  • ChromeFixtureVixen.Editor.Ui.Tests
  • CommandPaletteVixen.Editor.Ui
  • CommandPaletteSourceVixen.Editor.Ui
  • CommandRegistryVixen.Editor.Ui
  • CommandTestsVixen.Editor.Ui.Tests
  • ConsoleViewVixen.Editor.Ui
  • DeclaredContributionTestsVixen.Editor.App.Tests
  • DeclaredContributionsVixen.Editor.App
  • DiagnosticsModuleVixen.Editor.Diagnostics
  • DialogServiceVixen.Editor.Ui
  • DialogTestsVixen.Editor.Ui.Tests
  • DockingWorkspaceVixen.Editor.Ui
  • DropIntoSceneTestsVixen.Editor.App.Tests
  • EditorAffordanceTestsVixen.Editor.App.Tests
  • EditorApplicationVixen.Editor.App
  • EditorCommandVixen.Editor.Ui
  • EditorShellVixen.Editor.Ui
  • EditorShellTestsVixen.Editor.Ui.Tests
  • EditorStringsVixen.Editor.Ui
  • FakeVixen.Editor.Ui.Tests
  • FoliageModeVixen.Editor.Terrain
  • FoliageModeTestsVixen.Editor.Terrain.Tests
  • IEditorModeVixen.Editor.Ui
  • KeyBindingsViewVixen.Editor.Ui
  • LoadingTestsVixen.Editor.Plugin.Tests
  • MenuBarTestsVixen.Editor.App.Tests
  • MenuCompositionTestsVixen.Editor.Ui.Tests
  • MenuGroupVixen.Editor.Ui
  • MenuModelVixen.Editor.Ui
  • MenuPresenterVixen.Editor.Ui
  • MenuTestsVixen.Editor.Ui.Tests
  • MessageLogViewVixen.Editor.Ui
  • MilestoneE3TestsVixen.Editor.App.Tests
  • ModeVixen.Editor.App.Tests
  • ModeTestsVixen.Editor.Ui.Tests
  • ModuleTestsVixen.Editor.Plugin.Tests