-
-
Notifications
You must be signed in to change notification settings - Fork 0
localizationsharedmodels LString
Localized string
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph Localization.Shared.Models
Localization.Shared.Models.LString[[LString]]
end
subgraph System.ComponentModel
System.ComponentModel.INotifyPropertyChanged[[INotifyPropertyChanged]]
end
subgraph System
System.IEquatable_1[[IEquatable]]
System.IComparable_1[[IComparable]]
System.IDisposable[[IDisposable]]
end
System.ComponentModel.INotifyPropertyChanged --> Localization.Shared.Models.LString
System.IEquatable_1 --> Localization.Shared.Models.LString
System.IComparable_1 --> Localization.Shared.Models.LString
System.IDisposable --> Localization.Shared.Models.LString
| Type | Name | Methods |
|---|---|---|
string |
IdentifierLocalization unique identifier |
get |
bool |
IsEmptyDetermines whether the string is empty |
get |
string |
KeyLocalization key |
get, init |
string |
NamespaceLocalization namespace |
get, init |
string |
StringLocalized string |
get, private set |
| Returns | Name |
|---|---|
LString |
CreateConstant(string value)Create a constant localized string |
LString |
CreateFormatted(LString format, LString[] args)Creates a formatted localized string |
(string namespace, string key) |
SplitIdentifier(string identifier)Splits a localized string identifier into its namespace and key components |
string |
implicit operator string(LString localized) |
| Returns | Name |
|---|---|
int |
CompareTo(LString other) |
void |
Dispose() |
bool |
Equals(...) |
string |
Format(...)Formats the localized string with supplied args
|
int |
GetHashCode() |
string |
ToString() |
Localized string
The provided string is localized based on the current culture, which is managed by the CultureManager .
Constant LString instances are not affected by culture changes and will always return the same value (see LString.CreateConstant(System.String) )
public LString()Default constructor
public static (string namespace, string key) SplitIdentifier(string identifier)| Type | Name | Description |
|---|---|---|
string |
identifier | Identifier in the format "Namespace:Key" |
Splits a localized string identifier into its namespace and key components
Tuple containing the namespace and key
public static LString CreateConstant(string value)| Type | Name | Description |
|---|---|---|
string |
value | Constant value |
Create a constant localized string
Created string
public static LString CreateFormatted(LString format, LString[] args)| Type | Name | Description |
|---|---|---|
LString |
format | Format source |
LString[]
|
args | Formatting arguments |
Creates a formatted localized string
public string Format(object[] args)| Type | Name | Description |
|---|---|---|
object``[] |
args | Formatting arguments |
Formats the localized string with supplied args
Formatted string
public string Format(object arg)| Type | Name | Description |
|---|---|---|
object |
arg | Formatting argument |
Formats the localized string with supplied arg
Formatted string
public virtual bool Equals(LString other)| Type | Name | Description |
|---|---|---|
LString |
other |
public override bool Equals(object obj)| Type | Name | Description |
|---|---|---|
object |
obj |
public override int GetHashCode()public virtual int CompareTo(LString other)| Type | Name | Description |
|---|---|---|
LString |
other |
public override string ToString()public static implicit operator string(LString localized)| Type | Name | Description |
|---|---|---|
LString |
localized |
public virtual void Dispose()public string Namespace { get; init; }Localization namespace
public string Key { get; init; }Localization key
public string Identifier { get; }Localization unique identifier
public bool IsEmpty { get; }Determines whether the string is empty
public string String { get; private set; }Localized string
public event PropertyChangedEventHandler PropertyChangedGenerated with ModularDoc