| 24 | DEFINE_LOG_CATEGORY(LogDlgJsonParser); |
| 25 | |
| 26 | bool GetTextFromObject(const TSharedRef<FJsonObject>& Obj, FText& TextOut) |
| 27 | { |
| 28 | // get the prioritized culture name list |
| 29 | const FCultureRef CurrentCulture = FInternationalization::Get().GetCurrentCulture(); |
| 30 | const TArray<FString> CultureList = CurrentCulture->GetPrioritizedParentCultureNames(); |
| 31 | |
| 32 | // try to follow the fall back chain that the engine uses |
| 33 | FString TextString; |
| 34 | for (const FString& CultureCode : CultureList) |
| 35 | { |
| 36 | if (Obj->TryGetStringField(CultureCode, TextString)) |
| 37 | { |
| 38 | TextOut = FText::FromString(TextString); |
| 39 | return true; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // no luck, is this possibly an unrelated json object? |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | FString GetStringForJsonType(const EJson Type) |
| 48 | { |
no outgoing calls
no test coverage detected