Vixen
dd8b0a81
csharp
public readonly record struct StringId

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

Read the guide page for this →

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 application whose fallback is a file is one 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 a static class of these, member for member, plus an All list; 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 an interface 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 (127, showing 40)

  • AccessibilitySnapshotVixen.Ui.Testing
  • AccessibilityTreeTestsVixen.Ui.Controls.Advanced.Tests
  • AccessibilityTreeTestsVixen.Ui.Controls.Tests
  • AccessibleNameLocalisationTestsVixen.Ui.Controls.Advanced.Tests
  • AccessibleNameLocalisationTestsVixen.Ui.Controls.Tests
  • ColorFieldVixen.Ui.Controls.Advanced
  • ColorPickerVixen.Ui.Controls.Advanced
  • ColorPickerKeyboardTestsVixen.Ui.Controls.Advanced.Tests
  • ColorStripVixen.Ui.Controls.Advanced
  • ComboBoxVixen.Ui.Controls
  • CommandRegistryVixen.Ui.Controls
  • CommandRegistryTestsVixen.Ui.Controls.Tests
  • ControlStringsVixen.Ui.Controls
  • DialogVixen.Ui.Controls
  • DialogServiceVixen.Ui.Controls
  • DockGroupViewVixen.Ui.Controls.Advanced
  • DockTabVixen.Ui.Controls.Advanced
  • DocumentClosePromptVixen.Ui.Controls
  • DocumentClosePromptTestsVixen.Ui.Controls.Tests
  • EditorCommandVixen.Ui.Controls
  • FieldValidationTestsVixen.Ui.Controls.Tests
  • GradientEditorVixen.Ui.Controls.Advanced
  • GradientRailVixen.Ui.Controls.Advanced
  • GradientRailKeyboardTestsVixen.Ui.Controls.Advanced.Tests
  • LocalisationTestsVixen.Ui.Controls.Tests
  • LocalisedSheetVixen.Ui.Controls.Tests
  • NodeCanvasVixen.Ui.Controls.Advanced
  • NumericInputVixen.Ui.Controls
  • PaginationVixen.Ui.Controls
  • PropertyGridVixen.Ui.Controls.Advanced
  • PropertyGridTestsVixen.Ui.Controls.Advanced.Tests
  • PropertyRowVixen.Ui.Controls.Advanced
  • ScrollBarVixen.Ui.Controls
  • SearchBoxVixen.Ui.Controls
  • SplitViewVixen.Ui.Controls
  • StepperVixen.Ui.Controls
  • StringFamilyVixen.Ui
  • StringFamilyTestsVixen.Ui.Tests
  • StringsVixen.Ui
  • TextFieldVixen.Ui.Controls