localization udpates
This commit is contained in:
@@ -33,6 +33,35 @@ void LocalizedStringTable::AddPluralString(const StringView& id, const StringVie
|
||||
values[n] = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
String LocalizedStringTable::GetString(const String& id)
|
||||
{
|
||||
StringView result;
|
||||
const auto messages = Entries.TryGet(id);
|
||||
if (messages && messages->Count() != 0)
|
||||
{
|
||||
result = messages->At(0);
|
||||
}
|
||||
if (result.IsEmpty() && FallbackTable)
|
||||
result = FallbackTable->GetString(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
String LocalizedStringTable::GetPluralString(const String& id, int32 n)
|
||||
{
|
||||
StringView result;
|
||||
const auto messages = Entries.TryGet(id);
|
||||
if (messages && messages->Count() != 0)
|
||||
{
|
||||
result = messages->At(0);
|
||||
}
|
||||
if (result.IsEmpty() && FallbackTable)
|
||||
result = FallbackTable->GetPluralString(id, n);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
bool LocalizedStringTable::Save(const StringView& path)
|
||||
|
||||
Reference in New Issue
Block a user