forked from 0ad/0ad
Fix barter panel. Reported by Gameboy
This was SVN commit r15393.
This commit is contained in:
parent
12c7fe2bc7
commit
6d5039791f
@ -83,7 +83,7 @@ g_SelectionPanels.Barter = {
|
|||||||
},
|
},
|
||||||
"setTooltip": function(data)
|
"setTooltip": function(data)
|
||||||
{
|
{
|
||||||
var resource = getLocalizedResourceName("WithinSentence", data.item);
|
var resource = getLocalizedResourceName(data.item, "WithinSentence");
|
||||||
data.button.Buy.tooltip = sprintf(translate("Buy %(resource)s"), {"resource": resource});
|
data.button.Buy.tooltip = sprintf(translate("Buy %(resource)s"), {"resource": resource});
|
||||||
data.button.Sell.tooltip = sprintf(translate("Sell %(resource)s"), {"resource": resource});
|
data.button.Sell.tooltip = sprintf(translate("Sell %(resource)s"), {"resource": resource});
|
||||||
},
|
},
|
||||||
|
@ -663,12 +663,12 @@ function getEntityOrHolder(ent)
|
|||||||
|
|
||||||
function getLocalizedResourceName(resourceCode, context)
|
function getLocalizedResourceName(resourceCode, context)
|
||||||
{
|
{
|
||||||
if (!context in localisedResourceNames)
|
if (!localisedResourceNames[context])
|
||||||
{
|
{
|
||||||
warn("Internationalization: Unexpected context for resource type localization found: ‘" + context + "’. This context is not supported.");
|
warn("Internationalization: Unexpected context for resource type localization found: ‘" + context + "’. This context is not supported.");
|
||||||
return resourceCode;
|
return resourceCode;
|
||||||
}
|
}
|
||||||
if (!resourceCode in localisedResourceNames[context])
|
if (!localisedResourceNames[context][resourceCode])
|
||||||
{
|
{
|
||||||
warn("Internationalization: Unexpected resource type found with code ‘" + resourceCode + ". This resource type must be internationalized.");
|
warn("Internationalization: Unexpected resource type found with code ‘" + resourceCode + ". This resource type must be internationalized.");
|
||||||
return resourceCode;
|
return resourceCode;
|
||||||
|
Loading…
Reference in New Issue
Block a user