Table of Contents

Class LanguageInfo

Namespace
Uncreated.Warfare.Models.Localization
Assembly
Uncreated.Warfare.dll
[Table("lang_info")]
public class LanguageInfo : ITranslationArgument, IEquatable<LanguageInfo>
Inheritance
LanguageInfo
Implements
Inherited Members
Extension Methods

Constructors

LanguageInfo()

public LanguageInfo()

LanguageInfo(string, LanguageService)

public LanguageInfo(string tempCode, LanguageService langService)

Parameters

tempCode string
langService LanguageService

Fields

FormatCode

public static readonly SpecialFormat FormatCode

Field Value

SpecialFormat

FormatDisplayName

public static readonly SpecialFormat FormatDisplayName

Field Value

SpecialFormat

Properties

Aliases

public IList<LanguageAlias> Aliases { get; set; }

Property Value

IList<LanguageAlias>

Code

[Required]
[Column(TypeName = "char(5)")]
public string Code { get; set; }

Property Value

string

Contributors

public IList<LanguageContributor> Contributors { get; set; }

Property Value

IList<LanguageContributor>

DefaultCultureCode

[MaxLength(16)]
public string? DefaultCultureCode { get; set; }

Property Value

string

DisplayName

[Required]
[MaxLength(64)]
public string DisplayName { get; set; }

Property Value

string

FallbackTranslationLanguageCode

[Column(TypeName = "char(5)")]
public string? FallbackTranslationLanguageCode { get; set; }

Property Value

string

HasTranslationSupport

public bool HasTranslationSupport { get; set; }

Property Value

bool

IsDefault

[JsonIgnore]
[NotMapped]
public bool IsDefault { get; }

Property Value

bool

Key

[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("pk")]
public uint Key { get; set; }

Property Value

uint

NativeName

[MaxLength(64)]
public string? NativeName { get; set; }

Property Value

string

RequiresIMGUI

public bool RequiresIMGUI { get; set; }

Property Value

bool

SteamLanguageName

[MaxLength(32)]
public string? SteamLanguageName { get; set; }

Property Value

string

Support

[NotMapped]
public float Support { get; }

Property Value

float

SupportedCultures

public IList<LanguageCulture> SupportedCultures { get; set; }

Property Value

IList<LanguageCulture>

SupportsPluralization

public bool SupportsPluralization { get; set; }

Property Value

bool

Methods

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(LanguageInfo?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(LanguageInfo? other)

Parameters

other LanguageInfo

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetUnturnedLanguageName()

Gets the language in Unturned's naming scheme, or null if Unturned (Steam) doesn't support this language.

public string? GetUnturnedLanguageName()

Returns

string

SupportsCulture(CultureInfo)

If this language goes with culture.

public bool SupportsCulture(CultureInfo culture)

Parameters

culture CultureInfo

Returns

bool

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Translate(ITranslationValueFormatter, in ValueFormatParameters)

Allows objects to define how they're translated in their own definition instead of creating a value converter.

public string Translate(ITranslationValueFormatter formatter, in ValueFormatParameters parameters)

Parameters

formatter ITranslationValueFormatter
parameters ValueFormatParameters

Returns

string

Operators

operator ==(LanguageInfo?, LanguageInfo?)

Compare two LanguageInfo objects.

public static bool operator ==(LanguageInfo? left, LanguageInfo? right)

Parameters

left LanguageInfo
right LanguageInfo

Returns

bool

operator !=(LanguageInfo?, LanguageInfo?)

Compare two LanguageInfo objects.

public static bool operator !=(LanguageInfo? left, LanguageInfo? right)

Parameters

left LanguageInfo
right LanguageInfo

Returns

bool