Skip to content

Commit

Permalink
make history labels translatable
Browse files Browse the repository at this point in the history
implements fluffy-mods#161
  • Loading branch information
FluffierThanThou committed May 22, 2020
1 parent f1b1b40 commit 5dd43f1
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ maarxx: Various fixes and improvements
rimpy-custom: Fix for Russian translation

<size=24>Version</size>
This is version 4.30.606, for RimWorld 1.1.2624.
This is version 4.30.607, for RimWorld 1.1.2624.

</description>
<supportedVersions>
Expand Down
Binary file modified Assemblies/Fluffy_ColonyManager.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ Show your appreciation by buying me a coffee (or contribute towards a nice singl
[![I Have a Black Dog](https://i.ibb.co/ss59Rwy/New-Project-2.png)](https://www.youtube.com/watch?v=XiCrniLQGYc)

# Version
This is version 4.30.606, for RimWorld 1.1.2624.
This is version 4.30.607, for RimWorld 1.1.2624.
24 changes: 24 additions & 0 deletions Source/Helpers/I18n.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// I18n.cs
// Copyright Karel Kroeze, 2020-2020

using Verse;

namespace FluffyManager
{
public class I18n
{
public static string Translate( string key, params object[] args )
{
return Key( key ).Translate( args ).ResolveTags();
}

public static string Key( string key ) => $"Fluffy.ColonyManager.{key}";
public static string HistoryStock = Translate( "HistoryStock" );
public static string HistoryDesignated = Translate( "HistoryDesignated" );
public static string HistoryCorpses = Translate( "HistoryCorpses" );
public static string HistoryChunks = Translate( "HistoryChunks" );
public static string HistoryProduction = Translate( "HistoryProduction" );
public static string HistoryConsumption = Translate( "HistoryConsumption" );
public static string HistoryBatteries = Translate( "HistoryBatteries" );
}
}
1 change: 1 addition & 0 deletions Source/Manager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<Compile Include="Helpers\Extensions\CompGlower_Extensions.cs" />
<Compile Include="Helpers\Extensions\Rect_Extensions.cs" />
<Compile Include="Helpers\Extensions\String_Extensions.cs" />
<Compile Include="Helpers\I18n.cs" />
<Compile Include="Helpers\Livestock\Utilities_Livestock.cs" />
<Compile Include="Helpers\Color\HSV_Helper.cs" />
<Compile Include="Helpers\History.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Source/ManagerJobs/ManagerJob_Foraging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ManagerJob_Foraging( Manager manager ) : base( manager )
Trigger = new Trigger_Threshold( this );

// create History tracker
History = new History( new[] {"stock", "designated"}, new[] {Color.white, Color.grey} );
History = new History( new[] {I18n.HistoryStock, I18n.HistoryDesignated }, new[] {Color.white, Color.grey} );

// init stuff if we're not loading
// todo: please, please refactor this into something less clumsy!
Expand Down
2 changes: 1 addition & 1 deletion Source/ManagerJobs/ManagerJob_Forestry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ManagerJob_Forestry( Manager manager ) : base( manager )
// initialize clearAreas list with current areas
UpdateClearAreas();

History = new History( new[] {"stock", "designated"}, new[] {Color.white, Color.grey} );
History = new History( new[] {I18n.HistoryStock, I18n.HistoryDesignated}, new[] {Color.white, Color.grey} );


// init stuff if we're not loading
Expand Down
2 changes: 1 addition & 1 deletion Source/ManagerJobs/ManagerJob_Hunting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ManagerJob_Hunting( Manager manager ) : base( manager )
Trigger.ThresholdFilter.SetAllow( Utilities_Hunting.InsectMeat, false );

// start the history tracker;
History = new History( new[] {"stock", "corpses", "designated"},
History = new History( new[] {I18n.HistoryStock, I18n.HistoryCorpses, I18n.HistoryDesignated },
new[] {Color.white, new Color( .7f, .7f, .7f ), new Color( .4f, .4f, .4f )} );

// init stuff if we're not loading
Expand Down
2 changes: 1 addition & 1 deletion Source/ManagerJobs/ManagerJob_Mining.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ManagerJob_Mining( Manager manager ) : base( manager )
Trigger = new Trigger_Threshold( this );

// start the history tracker;
History = new History( new[] {"stock", "chunks", "designated"},
History = new History( new[] { I18n.HistoryStock, I18n.HistoryChunks, I18n.HistoryDesignated },
new[] {Color.white, new Color( .7f, .7f, .7f ), new Color( .4f, .4f, .4f )} );

// init stuff if we're not loading
Expand Down
7 changes: 6 additions & 1 deletion Source/ManagerTabs/ManagerTab_Power.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ public ManagerTab_Power( Manager manager ) : base( manager )
DrawMaxMarkers = true
};

overallHistory = new History( new[] {"Production", "Consumption", "Batteries"} )
overallHistory = new History( new[]
{
I18n.HistoryProduction,
I18n.HistoryConsumption,
I18n.HistoryBatteries
} )
{
DrawOptions = false,
DrawInlineLegend = false,
Expand Down
2 changes: 1 addition & 1 deletion Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("4.0.0")]
[assembly: AssemblyFileVersion("4.30.606")]
[assembly: AssemblyFileVersion("4.30.607")]

0 comments on commit 5dd43f1

Please sign in to comment.