Table of Contents

Class Language

Namespace
Quilt4Net.Toolkit.Features.Content
Assembly
Quilt4Net.Toolkit.dll
public record Language : IEquatable<Language>
Inheritance
Language
Implements
Inherited Members

Fields

DeveloperLanguageKey

public static readonly Guid DeveloperLanguageKey

Field Value

Guid

KeyLanguageKey

The second developer-only pseudo-language: every key resolves to its own key name instead of its text, so a screen can be read as a map of the keys behind it. Sibling of DeveloperLanguageKey — that one answers "is this managed content?", this one answers "which key is it?", the question you have when you want to change the text.

public static readonly Guid KeyLanguageKey

Field Value

Guid

Remarks

Fixed rather than generated: the selected language key is persisted in the host's local storage, so a value that differed per process would not survive a restart.

NoApiKeyLanguageKey

public static readonly Guid NoApiKeyLanguageKey

Field Value

Guid

Properties

Code

Stable ISO-639 code for this language — "sv", "en", "es" — or null when the server has not been given one.

public string Code { get; set; }

Property Value

string

Remarks

The identifier a host can map its own language identity onto. Key is per-tenant, so hardcoding it does not survive a move between teams or environments, and Name is a display string that spelling, localisation or a rename can change underneath a match. Neither is safe to key off; this is (issue #144).

Nullable on purpose, and expect nulls. A server older than this field never sends one, and a language whose code could not be determined keeps it null rather than being given a guess — a wrong code silently routes a host to the wrong language, which is the exact bug this field exists to prevent. Treat null as "cannot be matched by code", not as an error.

Developer

public bool Developer { get; set; }

Property Value

bool

Key

public Guid Key { get; set; }

Property Value

Guid

Name

public string Name { get; set; }

Property Value

string

Methods

IsPseudo(Guid)

Whether languageKey is one of the synthetic languages the client invents rather than one the server serves content for. Every remote path — cache warm-up included — has to skip these, and centralising the test is what keeps a newly added pseudo-language from slipping past one guard and generating traffic for content that cannot exist.

public static bool IsPseudo(Guid languageKey)

Parameters

languageKey Guid

Returns

bool