Locale.ConvertTextKey (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Locale.

This is a static method, invoke it with a dot.


Converts a text key into a localized string


Usage

string Locale.ConvertTextKey(string key, ...)


Returned Value

Returns the textkey if it cannot be found in the dictionary, or a translated string.

Parameters

key: A valid text key.
...: none or many arguments that are used when composing the final localized string.

Notes

This is an alias for Locale.Lookup.
This localized string may or may not be in the user's current language. With support for fall-back language support, the localization system will attempt to search all available languages for the string.


Examples

local foo = Locale.ConvertTextKey("TXT_KEY_MAIN_MENU");
print(foo); -- prints "Main Menu" in English


Source code samples

Too many occurences. Only 50 out of 4278 are listed.

ActionInfoPanel.lua (G&K)

DLC/Expansion/UI/InGame/WorldView/ActionInfoPanel.lua
0380
strEndTurnMessage = Locale.ConvertTextKey("TXT_KEY_NOTIFICATION_SUMMARY_FOUND_RELIGION");


CityStateDiploPopup.lua (G&K)

DLC/Expansion/UI/InGame/Popups/CityStateDiploPopup.lua
0343
strResourceText = strResourceText .. pResource.IconString .. " [COLOR_POSITIVE_TEXT]" .. Locale.ConvertTextKey(pResource.Description) .. " (" .. iAmount .. ") [ENDCOLOR]";


CityStateStatusHelper.lua (G&K)

DLC/Expansion/UI/CityStateStatusHelper.lua
0380
strStatusTT = strStatusTT .. Locale.ConvertTextKey("TXT_KEY_CSTATE_RESOURCES_RECEIVED", strExportedResourceText);


CityView.lua

UI/InGame/CityView/CityView.lua
1212
local localizedLabel = "[ICON_PLUS] "..Locale.ConvertTextKey( "TXT_KEY_CITYVIEW_REGULARBUILDING_TEXT" );
2226
searchString = Locale.ConvertTextKey( thisUnitInfo.Description );


CivilopediaScreen.lua

UI/Civilopedia/CivilopediaScreen.lua
1608
UpdateSuperWideTextBlock( Locale.ConvertTextKey( "TXT_KEY_PEDIA_CIVS_HELP_TEXT" ), thisBBTextInstance.BBTextLabel, thisBBTextInstance.BBTextInnerFrame, thisBBTextInstance.BBTextFrame );
2248
abilitiesString = abilitiesString ..  Locale.ConvertTextKey( "TXT_KEY_ABLTY_OCEAN_EMBARK_STRING" );
2870
local strLabel = Locale.ConvertTextKey(GameInfo.Specialists[iGPType].GreatPeopleTitle);
3828
UpdateTextBlock( Locale.ConvertTextKey( thisCityState.Civilopedia ), Controls.HistoryLabel, Controls.HistoryInnerFrame, Controls.HistoryFrame );
3902
Controls.YieldLabel:SetText( Locale.ConvertTextKey( "TXT_KEY_PEDIA_NO_YIELD" ) );


DeclareWarMovePopup.lua

UI/InGame/PopupsGeneric/DeclareWarMovePopup.lua
0038
popupText = Locale.ConvertTextKey("TXT_KEY_POPUP_DOES_THIS_MEAN_WAR_PROTECTED_CITY_STATE", Teams[eRivalTeam]:GetNameKey());


Demographics.lua

UI/InGame/Popups/Demographics.lua
0209
instance.AverageTT:SetToolTipString( Locale.ConvertTextKey("TXT_KEY_DEMOGRAPHICS_PRODUCTION_MEASURE") );


DiploGlobalRelationships.lua

UI/InGame/Popups/DiploGlobalRelationships.lua
0133
controlTable.DenounceLabel:SetText(Locale.ConvertTextKey("TXT_KEY_DIPLO_YOU_HAVE_BACKSTABBED"));


DiploRelationships.lua (G&K)

DLC/Expansion/UI/InGame/Popups/DiploRelationships.lua
0173
strDiploState = Locale.ConvertTextKey( "TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_LIBERATED" );


DiploVotePopup.lua

UI/InGame/Popups/DiploVotePopup.lua
0081
TruncateString(controlTable.ButtonText, textBoxSize, Locale.ConvertTextKey("TXT_KEY_POP_UN_TEAM_LABEL", pOtherTeam:GetID() + 1) , " (" .. Locale.ConvertTextKey("TXT_KEY_POP_VOTE_RESULTS_YOUR_TEAM") .. ")");


DiscussionDialog.lua

UI/InGame/LeaderHead/DiscussionDialog.lua
0312
strButton1Text = Locale.ConvertTextKey( "TXT_KEY_DIPLO_DISCUSS_YES_LET_US_PREPARE" );


DiscussionDialog.lua (G&K)

DLC/Expansion/UI/InGame/LeaderHead/DiscussionDialog.lua
0430
strButton4Tooltip = Locale.ConvertTextKey( "TXT_KEY_DIPLO_MAY_NOT_ATTACK" );


EconomicGeneralInfo.lua

UI/InGame/Popups/EconomicGeneralInfo.lua
0299
strUnitTT = strUnitTT .. "[NEWLINE][NEWLINE]" .. Locale.ConvertTextKey("TXT_KEY_HANDICAP_MAINTENANCE_MOD", iUnitMaintMod);


FoRScenarioLoadScreen.lua (G&K)

DLC/Expansion/Scenarios/FallOfRomeScenario/FoRScenarioLoadScreen.lua
0267
local title = Locale.ConvertTextKey("TXT_KEY_RANDOM_LEADER_CIV", leaderDescription, civ.ShortDescription);


GameSetupScreen.lua

UI/FrontEnd/GameSetup/GameSetupScreen.lua
0528
title = Locale.ConvertTextKey( "TXT_KEY_RANDOM_LEADER_CIV", name, civName );


GenericWorldAnchor.lua

UI/InGame/GenericWorldAnchor.lua
0263
strToolTip = strToolTip .. Locale.ConvertTextKey(strCustomHelp);


GoodyHutPopup.lua

UI/InGame/Popups/GoodyHutPopup.lua
0029
Controls.DescriptionLabel:SetText(Locale.ConvertTextKey(pGoodyInfo.Description));


HappinessInfo.lua

UI/InGame/Popups/HappinessInfo.lua
0448
Controls.OCityCountUnhappinessTitle:SetText(Locale.ConvertTextKey("TXT_KEY_NUMBER_OF_OCCUPIED_CITIES", iNumOccupiedCities));
0605
Controls.ResourcesAvailableToggle:SetText("[ICON_PLUS]" .. Locale.ConvertTextKey("TXT_KEY_EO_RESOURCES_AVAILBLE"));


InfoTooltipInclude.lua

UI/InGame/InfoTooltipInclude.lua
0203
strHelpText = strHelpText .. Locale.ConvertTextKey("TXT_KEY_PRODUCTION_BUILDING_PRODUCTION", iProduction);
0780
strInfo = strInfo .. "[ICON_BULLET]" .. Locale.ConvertTextKey("TXT_KEY_DIPLO_DOF") .. "[NEWLINE]";


LoadMenu.lua

UI/FrontEnd/LoadMenu.lua
0233
Controls.EraTurn:SetText( Locale.ConvertTextKey("TXT_KEY_CUR_ERA_TURNS_FORMAT",
0234
Locale.ConvertTextKey(GameInfo.Eras[header.CurrentEra].Description), header.TurnNumber) );
0378
Controls.Handicap:SetToolTipString( Locale.ConvertTextKey( info.Description ) );


LoadTutorial.lua

UI/FrontEnd/LoadTutorial.lua
0167
Controls.TutorialNumber:SetText(  Locale.ConvertTextKey(Tutorials[ g_iSelected ].Num) );


OptionsMenu.lua

UI/Options/OptionsMenu.lua
0568
m_FOWText[ 1 ] = Locale.ConvertTextKey("TXT_KEY_OPSCREEN_SETTINGS_LOW");
0607
m_TutorialLevelText[ 3 ] = Locale.ConvertTextKey("TXT_KEY_OPSCREEN_TUTORIAL_OFF");


ProductionPopup.lua

UI/InGame/Popups/ProductionPopup.lua
0505
strItemName = Locale.ConvertTextKey(city:GetProductionNameKey());


ReturnCivilianPopup.lua

UI/InGame/PopupsGeneric/ReturnCivilianPopup.lua
0055
local buttonText = Locale.ConvertTextKey("TXT_KEY_POP_RETURN_CIVILIAN_CONFIRMATION_RETURN");


SocialPolicyPopup.lua

UI/InGame/Popups/SocialPolicyPopup.lua
0235
szText = Locale.ConvertTextKey("TXT_KEY_CULTURE_PER_TURN_LABEL", player:GetTotalJONSCulturePerTurn());
0357
strToolTip = strToolTip .. " " .. Locale.ConvertTextKey("TXT_KEY_POLICY_BRANCH_CANNOT_UNLOCK_CULTURE", player:GetNextPolicyCost());


StagingRoom.lua

UI/FrontEnd/Multiplayer/StagingRoom.lua
0314
local playerName = playerInfo.playerName or Locale.ConvertTextKey( "TXT_KEY_MULTIPLAYER_DEFAULT_PLAYER_NAME", playerID + 1);


TechButtonInclude.lua

UI/InGame/TechTree/TechButtonInclude.lua
0299
thisButton:SetToolTipString( Locale.ConvertTextKey( "TXT_KEY_ALLOWS_TRADE_AGREEMENTS" ) );


TopPanel.lua

UI/InGame/TopPanel.lua
0761
strText = strText .. Locale.ConvertTextKey("TXT_KEY_NEXT_POLICY_TURN_LABEL", iTurns);


TopPanel.lua (G&K)

DLC/Expansion/UI/InGame/TopPanel.lua
0629
strText = strText .. "  [ICON_BULLET]" .. Locale.ConvertTextKey("TXT_KEY_TP_HAPPINESS_CITIES", iCityHappiness);


TradeLogic.lua

UI/InGame/WorldView/TradeLogic.lua
0595
Controls.CancelButton:SetText( Locale.ConvertTextKey( "TXT_KEY_DIPLO_REFUSE" ));
0755
control:SetText( "[ICON_MINUS]" .. Locale.ConvertTextKey( label ) );
1293
Controls.ThemPocketCities:SetToolTipString( Locale.ConvertTextKey( "TXT_KEY_DIPLO_TO_TRADE_CITY_TT" ));
1670
strTooltip = Locale.ConvertTextKey( "TXT_KEY_DIPLO_CURRENT_GOLD", g_Deal:GetGoldAvailable(g_iThem, iItemToBeChanged) );
1950
local strTooltip = Locale.ConvertTextKey( "TXT_KEY_DIPLO_CURRENT_GOLD", g_Deal:GetGoldAvailable(g_iThem, iItemToBeChanged) );


TradeLogic.lua (G&K)

DLC/Expansion/UI/InGame/WorldView/TradeLogic.lua
1094
strOurTooltip = strOurTooltip .. " [COLOR_WARNING_TEXT]" .. Locale.ConvertTextKey("TXT_KEY_DIPLO_ALLOW_EMBASSY_NO_TECH_OTHER_PLAYER" ) .. "[ENDCOLOR]";


TurnsRemaining.lua - DLC_04 DLC

DLC/DLC_04/Scenarios/1066Scenario/TurnsRemaining.lua
0166
Text = Locale.ConvertTextKey("TXT_KEY_1066_SCENARIO_ALLY_LOST", strPlayerKey);


TurnsRemaining.lua (G&K)

DLC/Expansion/Scenarios/MedievalScenario/TurnsRemaining.lua
0773
popupInfo.Text = Locale.ConvertTextKey("TXT_KEY_MEDIEVAL_SCENARIO_OTHER_ADOPTED_PROTESTANTISM", pPlayer:GetName());


UnitFlagManager.lua

UI/InGame/UnitFlagManager.lua
1585
local desc = Locale.ConvertTextKey("TXT_KEY_PLOTROLL_UNIT_DESCRIPTION_CIV",  pPlayer:GetCivilizationAdjectiveKey(), pUnit:GetNameKey());


UnitPanel.lua

UI/InGame/WorldView/UnitPanel.lua
1055
strActionHelp = "[NEWLINE]" .. Locale.ConvertTextKey( "TXT_KEY_MISSION_START_GOLDENAGE_HELP", iGALength );


VictoryProgress.lua

UI/InGame/Popups/VictoryProgress.lua
0905
controlTableTT:SetToolTipString(Locale.ConvertTextKey( "TXT_KEY_POP_VOTE_RESULTS_YOU" ));



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.