Fix barter panel. Reported by Gameboy

This was SVN commit r15393.
This commit is contained in:
sanderd17 2014-06-19 12:34:52 +00:00
parent 12c7fe2bc7
commit 6d5039791f
2 changed files with 3 additions and 3 deletions

View File

@ -83,7 +83,7 @@ g_SelectionPanels.Barter = {
},
"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.Sell.tooltip = sprintf(translate("Sell %(resource)s"), {"resource": resource});
},

View File

@ -663,12 +663,12 @@ function getEntityOrHolder(ent)
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.");
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.");
return resourceCode;