3 using System.Collections.Generic;
17 private int languageVersion = 0;
35 Language = GameSettings.CurrentConfig.Language;
36 languageVersion = TextManager.LanguageVersion;
41 return Language != GameSettings.CurrentConfig.Language || languageVersion != TextManager.LanguageVersion;
53 => !value.IsNullOrEmpty()
78 return !(left == right);
86 public bool Contains(
string subStr, StringComparison comparison = StringComparison.Ordinal)
88 return !
Value.IsNullOrEmpty() &&
Value.Contains(subStr, comparison);
91 public bool Contains(
char chr, StringComparison comparison = StringComparison.Ordinal)
93 return Value.Contains(chr, comparison);
103 return Join(separator, (IEnumerable<LocalizedString>)subStrs);
121 public IReadOnlyList<LocalizedString>
Split(params
char[] separators)
124 return splitter.Substrings;
129 return new ReplaceLString(
this, stringComparison, (find, replace));
134 return new ReplaceLString(
this, stringComparison, (find.ToIdentifier(), replace));
138 StringComparison stringComparison = StringComparison.Ordinal)
140 return new ReplaceLString(
this, stringComparison, (find, replace));
161 if (obj is
string str) {
return Equals(str, StringComparison.Ordinal); }
162 return base.Equals(obj);
170 public bool Equals(
string other, StringComparison comparison = StringComparison.Ordinal)
172 return string.Equals(
Value, other, comparison);
180 public bool StartsWith(
string other, StringComparison comparison = StringComparison.Ordinal)
182 return Value.StartsWith(other, comparison);
187 return Value.GetHashCode();
LocalizedString Replace(string find, LocalizedString replace, StringComparison stringComparison=StringComparison.Ordinal)
IReadOnlyList< LocalizedString > Split(params char[] separators)
LanguageIdentifier Language
static bool operator!=(LocalizedString? left, LocalizedString? right)
bool Contains(string subStr, StringComparison comparison=StringComparison.Ordinal)
LocalizedString Fallback(LocalizedString fallback, bool useDefaultLanguageIfFound=true)
Use this text instead if the original text cannot be found.
bool Equals(string other, StringComparison comparison=StringComparison.Ordinal)
LocalizedString Replace(LocalizedString find, LocalizedString replace, StringComparison stringComparison=StringComparison.Ordinal)
LocalizedString ToLower()
static bool MustRetrieveValue(LocalizedString str)
override int GetHashCode()
override bool Equals(object? obj)
override string ToString()
static LocalizedString operator+(LocalizedString left, object right)
abstract void RetrieveValue()
static readonly RawLString EmptyString
int CompareTo(object? obj)
virtual LocalizedString ToUpper()
LocalizedString TrimStart()
static LocalizedString Join(string separator, params LocalizedString[] subStrs)
LocalizedString Replace(Identifier find, LocalizedString replace, StringComparison stringComparison=StringComparison.Ordinal)
LocalizedString TrimEnd()
static LocalizedString operator+(LocalizedString left, LocalizedString right)
static LocalizedString operator+(object left, LocalizedString right)
bool Equals(LocalizedString other, StringComparison comparison=StringComparison.Ordinal)
bool StartsWith(string other, StringComparison comparison=StringComparison.Ordinal)
virtual bool MustRetrieveValue()
bool Contains(char chr, StringComparison comparison=StringComparison.Ordinal)
static LocalizedString Join(string separator, IEnumerable< LocalizedString > subStrs)
bool StartsWith(LocalizedString other, StringComparison comparison=StringComparison.Ordinal)
static bool operator==(LocalizedString? left, LocalizedString? right)
static readonly LanguageIdentifier None