1
0
forked from 0ad/0ad

Fix some translations.

- Idle builder hotkey 28bd4f0092.
- "Other hotkey"-catagory.
- Tooltipless hotkeys.

Patch by: @nwtour
Differential revision: https://code.wildfiregames.com/D3862
This was SVN commit r25282.
This commit is contained in:
Freagarach 2021-04-17 07:47:30 +00:00
parent 518fb7eafa
commit fd008e11ad
4 changed files with 13 additions and 5 deletions

View File

@ -18,8 +18,8 @@ class HotkeyMetadata
let hotkey_i = 0;
let categories = {
[this.DEFAULT_CATEGORY]: {
"name": markForTranslation("Other Hotkeys"),
"desc": markForTranslation("Other Hotkeys"),
"name": translate(this.DefaultCategoryString),
"desc": translate(this.DefaultCategoryString),
}
};
for (let file of files)
@ -65,3 +65,5 @@ class HotkeyMetadata
return Engine.ListDirectoryFiles("gui/hotkeys/spec/", "*.json");
}
}
HotkeyMetadata.prototype.DefaultCategoryString = markForTranslation("Other Hotkeys");

View File

@ -121,7 +121,7 @@ class HotkeysPage
let hotkey = hotkeyList.list_data[hotkeyList.hovered];
hotkeyList.tooltip = this.metadata.hotkeys[hotkey]?.desc ?
translateWithContext("hotkey metadata", this.metadata.hotkeys[hotkey]?.desc) :
translate(markForTranslation("No tooltip available"));
translate(this.UnavailableTooltipString);
}
}
@ -194,3 +194,5 @@ function init()
{
let hotkeyPage = new HotkeysPage(new HotkeyMetadata());
}
HotkeysPage.prototype.UnavailableTooltipString = markForTranslation("No tooltip available.");

View File

@ -47,6 +47,10 @@
"name": "Select next idle unit",
"desc": "Select next idle unit."
},
"selection.idlebuilder": {
"name": "Select next idle builder",
"desc": "Select next idle builder."
},
"selection.offscreen": {
"name": "Include offscreen",
"desc": "Include offscreen units in selection."

View File

@ -22,11 +22,11 @@ class BarterButton
let resourceName = { "resource": resourceNameWithinSentence(resourceCode) };
this.sellButton.tooltip = sprintf(this.SellTooltip, resourceName);
this.sellButton.tooltip = sprintf(translate(this.SellTooltip), resourceName);
this.sellButton.onPress = () => { barterButtonManager.setSelectedResource(this.resourceCode); };
this.sellButton.hidden = false;
this.buyButton.tooltip = sprintf(this.BuyTooltip, resourceName);
this.buyButton.tooltip = sprintf(translate(this.BuyTooltip), resourceName);
this.buyButton.onPress = () => { this.buy(); };
this.iconPath = this.ResourceIconPath + resourceCode + ".png";