Skip to content

Commit

Permalink
v1.1.1: update french translation + FIX luxury resources text
Browse files Browse the repository at this point in the history
  • Loading branch information
Ewaken committed Jun 22, 2024
1 parent 6d84a68 commit debcea9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
20 changes: 10 additions & 10 deletions TPE/TopPanel_Text.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Text>[ICON_RESOURCE_TOYS] Number of Luxury Resources Owned:({1_Type} type)</Text>
</Replace>
<Replace Tag="LOC_TPT_TOP_PANEL_LUXURY_RESOURCES" Language="fr_FR">
<Text>[ICON_RESOURCE_TOYS] Ressources de luxes possedées:({1_Type} type)</Text>
<Text>[ICON_RESOURCE_TOYS] Nombre de ressource de luxe possédé : ({1_Type} différentes)</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_MORE_LUXURY_NAME" Language="zh_Hans_CN">
<Text>[NEWLINE][NEWLINE]自己额外的奢侈品[NEWLINE]</Text>
Expand All @@ -17,7 +17,7 @@
<Text>[NEWLINE][NEWLINE]Own Extra Luxury Resources[NEWLINE]</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_MORE_LUXURY_NAME" Language="fr_FR">
<Text>[NEWLINE][NEWLINE]Mes ressources de luxes en trop[NEWLINE]</Text>
<Text>[NEWLINE][NEWLINE]Ressources de luxe en double[NEWLINE]</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_TEAM_MORE_LUXURY_NAME" Language="zh_Hans_CN">
<Text>[NEWLINE][NEWLINE]队友额外的奢侈品</Text>
Expand All @@ -26,13 +26,13 @@
<Text>[NEWLINE][NEWLINE]Team Extra Luxury Resources</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_TEAM_MORE_LUXURY_NAME" Language="fr_FR">
<Text>[NEWLINE][NEWLINE]Ressources de luxes de mes coéquipiers en surplus</Text>
<Text>[NEWLINE][NEWLINE]Ressources de luxe en double de l'équipe</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_WORLD_MORE_LUXURY_NAME" Language="en_US">
<Text>[NEWLINE][NEWLINE]World Extra Luxury Resources</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_WORLD_MORE_LUXURY_NAME" Language="fr_FR">
<Text>[NEWLINE][NEWLINE]Ressources de luxes en surplus chez les autres joueurs</Text>
<Text>[NEWLINE][NEWLINE]Ressources de luxe en double des autres joueurs</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_TEAM_MORE_STRATEGIC_NAME" Language="zh_Hans_CN">
<Text>[NEWLINE]队友可用的战略[NEWLINE]</Text>
Expand All @@ -41,13 +41,13 @@
<Text>[NEWLINE][NEWLINE]Team Extra Strategic Resources</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_TEAM_MORE_STRATEGIC_NAME" Language="fr_FR">
<Text>[NEWLINE][NEWLINE]Ressources stratégiques de mes coéquipiers en surplus</Text>
<Text>[NEWLINE][NEWLINE]Ressources stratégiques de l'équipe</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_WORLD_MORE_STRATEGIC_NAME" Language="en_US">
<Text>[NEWLINE][NEWLINE]World Extra Strategic Resources</Text>
</Replace>
<Replace Tag="LOC_TOP_PANEL_WORLD_MORE_STRATEGIC_NAME" Language="fr_FR">
<Text>[NEWLINE][NEWLINE]Ressources stratégiques en surplus chez les autres joueurs</Text>
<Text>[NEWLINE][NEWLINE]Ressources stratégiques en double des autres joueurs</Text>
</Replace>
<Replace Tag="LOC_TOPPANEL_PRODUCTION_TOOLTIP_HEADER" Language="zh_Hans_CN">
<Text>+{1_Num} [Icon_ProductionLarge] 生产力</Text>
Expand All @@ -65,7 +65,7 @@
<Text>Total Production of the Empire</Text>
</Replace>
<Replace Tag="LOC_TOPPANEL_PRODUCTION_TOOLTIP_DESC" Language="fr_FR">
<Text>Production globale dans mon Empire</Text>
<Text>Production totale</Text>
</Replace>
<Replace Tag="LOC_TOPPANEL_PRODUCTION_TOOLTIP_REPORTS" Language="zh_Hans_CN">
<Text>生产力成长曲线</Text>
Expand All @@ -74,7 +74,7 @@
<Text>Production Growth Curve</Text>
</Replace>
<Replace Tag="LOC_TOPPANEL_PRODUCTION_TOOLTIP_REPORTS" Language="fr_FR">
<Text>Courbe de croissance de la production</Text>
<Text>Historique de la production</Text>
</Replace>
<Replace Tag="LOC_TOPPANEL_FOOD_TOOLTIP_HEADER" Language="zh_Hans_CN">
<Text>+{1_Num} [Icon_FoodLarge] 食物</Text>
Expand All @@ -92,7 +92,7 @@
<Text>Total Food of the Empire</Text>
</Replace>
<Replace Tag="LOC_TOPPANEL_FOOD_TOOLTIP_DESC" Language="fr_FR">
<Text>Nourriture globale dans mon Empire</Text>
<Text>Production de nourriture totale</Text>
</Replace>
<Replace Tag="LOC_TOPPANEL_POPULATION_TOOLTIP_HEADER" Language="zh_Hans_CN">
<Text>{1_Num} [Icon_Citizen] 人口</Text>
Expand All @@ -110,7 +110,7 @@
<Text>Total Citizen of the Empire</Text>
</Replace>
<Replace Tag="LOC_TOPPANEL_POPULATION_TOOLTIP_DESC" Language="fr_FR">
<Text>Nombre de citoyens dans mon Empire</Text>
<Text>Population totale</Text>
</Replace>
</LocalizedText>
</GameData>
33 changes: 22 additions & 11 deletions TPE/UI/TopPanelExtension.lua
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,23 @@ function RefreshLuxuryResourcesType()
local LUXURYWorldtext = Locale.Lookup("LOC_TOP_PANEL_WORLD_MORE_LUXURY_NAME")
local TeamMore = false
local WorldMore = false
local localPlayerId = Game.GetLocalPlayer()
local localTeam = Players[localPlayerId]:GetTeam()
local localPlayerDiplomacy = localPlayerId:GetDiplomacy()

for j, playerID in ipairs(PlayerManager.GetAliveMajorIDs()) do
if Players[Game.GetLocalPlayer()]:GetTeam() == Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then -- 是队友
local LUXURYstr = GetMoreLUXURYstr(playerID)
for j, playerId in ipairs(PlayerManager.GetAliveMajorIDs()) do
local playerTeam = Players[playerId]:GetTeam()

if localTeam == playerTeam and localPlayerId ~= playerId then -- 是队友
local LUXURYstr = GetMoreLUXURYstr(playerId)
if LUXURYstr then
TeamMore = true
LUXURYtext = LUXURYtext..LUXURYstr
end
end
if Players[Game.GetLocalPlayer()]:GetTeam() ~= Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then
local LUXURYstr = GetMoreLUXURYstr(playerID)

if localTeam ~= playerTeam and localPlayerId ~= playerId and localPlayerDiplomacy:IsAtWarWith( playerId ) == false then
local LUXURYstr = GetMoreLUXURYstr(playerId)
if LUXURYstr then
WorldMore = true
LUXURYWorldtext = LUXURYWorldtext..LUXURYstr
Expand All @@ -330,11 +336,13 @@ function RefreshLuxuryResourcesType()

if TeamMore == true and isLuxuriesTradingAllowed == true then
sToolTopText = sToolTopText..LUXURYtext
sYieldPerTurnText = sYieldPerTurnText.."[icon_PressureHigh]"
end

if WorldMore == true and isLuxuriesTradingAllowed == true then
sToolTopText = sToolTopText..LUXURYWorldtext
end

if ((TeamMore == true or WorldMore == true) and isLuxuriesTradingAllowed == true) then
sYieldPerTurnText = sYieldPerTurnText.."[icon_PressureHigh]"
end

Expand All @@ -350,7 +358,6 @@ end
-- ===========================================================================
function GetMoreLUXURYstr(playerID)

local pPlayerConfig = PlayerConfigurations[playerID];
local leaderType = PlayerConfigurations[playerID]:GetLeaderTypeName();
local LeaderName = Locale.Lookup(GameInfo.Leaders[leaderType].Name);

Expand Down Expand Up @@ -395,8 +402,9 @@ end
-- ===========================================================================
function IsTradableResources(Resource)
local localPlayerID = Game.GetLocalPlayer()
local localPlayerTeam = Players[localPlayerID]:GetTeam()
for j, playerID in ipairs(PlayerManager.GetAliveMajorIDs()) do
if Players[Game.GetLocalPlayer()]:GetTeam() == Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then -- 是队友
if localPlayerTeam == Players[playerID]:GetTeam() and localPlayerID ~= playerID then -- 是队友
local pForDeal :table = DealManager.GetWorkingDeal(DealDirection.OUTGOING, localPlayerID, playerID);
local possibleResources :table = DealManager.GetPossibleDealItems(localPlayerID, playerID, DealItemTypes.RESOURCES, pForDeal);
if (possibleResources ~= nil) then
Expand Down Expand Up @@ -522,17 +530,19 @@ if BaseFile == "TopPanel_Expansion2" then
local WorldStrategicYtext = Locale.Lookup("LOC_TOP_PANEL_WORLD_MORE_STRATEGIC_NAME")
local TeamMore = false
local WorldMore = false
local localPlayerTeam = Players[localPlayerID]:GetTeam()

for j, playerID in ipairs(PlayerManager.GetAliveMajorIDs()) do
if Players[Game.GetLocalPlayer()]:GetTeam() == Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then -- 是队友
local playerTeam = Players[playerID]:GetTeam()
if localPlayerTeam == playerTeam and localPlayerID ~= playerID then -- 是队友
local Strategicstr = GetMoreStrategicstr(playerID,resource)
if Strategicstr ~= 0 then
TeamMore = true
TeamStrategicYtext = TeamStrategicYtext..Strategicstr
end
end

if Players[Game.GetLocalPlayer()]:GetTeam() ~= Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then
if localPlayerTeam ~= playerTeam and localPlayerID ~= playerID then
local Strategicstr = GetMoreStrategicstr(playerID,resource)
if Strategicstr ~= 0 then
WorldMore = true
Expand Down Expand Up @@ -626,7 +636,8 @@ end
-- 判断队友是否解锁了资源
-- ===========================================================================
function GetTeamVisibleResources(playerID)
if Players[Game.GetLocalPlayer()]:GetTeam() == Players[playerID]:GetTeam() or playerID == Game.GetLocalPlayer() then -- 是队友
local localPlayerId = Game.GetLocalPlayer()
if Players[localPlayerId]:GetTeam() == Players[playerID]:GetTeam() or playerID == localPlayerId then -- 是队友
local pPlayerResources = Players[playerID]:GetResources();
for i, kdate in ipairs(g_TopPanelResources) do
if pPlayerResources:IsResourceVisible(kdate.Hash) then
Expand Down
2 changes: 1 addition & 1 deletion TopPanelPro.modinfo
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</Text>
<Text id="LOC_TPE_DESCRIPTION">
<en_US>[icon_You]Add indicators for Food, Production, Population, and Luxury Resources to the Top Panel.</en_US>
<fr_FR>[icon_You]Ajoute des indicateurs pour la Nourriture, la Production, la Population, and les ressources de luxes dans le panneau du haut.</fr_FR>
<fr_FR>[icon_You]Ajoute des indicateurs pour la nourriture, la production, la population et les ressources de luxe sur le panneau supérieur.</fr_FR>
<zh_Hans_CN>[icon_You]新增顶栏额外内容:食物、生产力、人口、奢侈品。</zh_Hans_CN>
</Text>
<Text id="LOC_TPE_TEASER">
Expand Down

0 comments on commit debcea9

Please sign in to comment.