Skip to content

Commit

Permalink
Add a warning on unassigned translation keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Fayti1703 committed Jan 1, 2023
1 parent 56fc145 commit bb7d405
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Ktisis/Locale/LocaleData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ public LocaleData(LocaleMetaData metaData, Dictionary<string, string> translatio

public string Translate(string key, Dictionary<string, string>? parameters = null) {
/* TODO: Implementing some form of fallback system might be good here. */
if(!_translationData.TryGetValue(key, out string? translationString))
if(!_translationData.TryGetValue(key, out string? translationString)) {
Logger.Warning("Unassigned translation key '{0}' for locale '{1}'", key, MetaData.TechnicalName);
return key;
}
return ReplaceParameters(key, translationString, parameters);
}

Expand Down

0 comments on commit bb7d405

Please sign in to comment.