Refactor translation files
- Add prefixes to all message keys to provide context - Use messages with attributes for some UI elements (dropdowns, dialogs, checkboxes, menus) - Rename some class fields for consistency with translation keys
This commit is contained in:
committed by
Paul Chote
parent
46caa2d889
commit
a0f17b15ec
@@ -21,8 +21,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
public class ActorSelectorLogic : CommonSelectorLogic
|
||||
{
|
||||
[TranslationReference]
|
||||
const string Type = "type";
|
||||
[TranslationReference("actorType")]
|
||||
const string ActorTypeTooltip = "label-actor-type";
|
||||
|
||||
class ActorSelectorActor
|
||||
{
|
||||
@@ -115,8 +115,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (tooltip != null)
|
||||
searchTerms.Add(tooltip.Name);
|
||||
|
||||
var type = modData.Translation.GetString(Type);
|
||||
var tooltipText = (tooltip == null ? $"{type}: " : tooltip.Name + $"\n{type}: ") + a.Name;
|
||||
var actorType = modData.Translation.GetString(ActorTypeTooltip, Translation.Arguments("actorType", a.Name));
|
||||
var tooltipText = tooltip == null ? actorType : tooltip.Name + $"\n{actorType}";
|
||||
allActorsTemp.Add(new ActorSelectorActor(a, editorData.Categories, searchTerms.ToArray(), tooltipText));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user