Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localize map window title #378

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions SCANassets/Resources/Localization/en-us/OtherText.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@
#autoLOC_SCANsat_Types = <b>SCAN Types:</b>
#autoLOC_SCANsat_Daylight = Requires Daylight: <<1>>
#autoLOC_SCANsat_FOV = FOV: <<1>>
#autoLOC_SCANsat_MapTitle = S.C.A.N. <<1>> Map of <<2>>
#autoLOC_SCANsat_MapProjection = Projection
#autoLOC_SCANsat_MapType = Map Type
#autoLOC_SCANsat_MapResource = Resource
#autoLOC_SCANsat_MapBody = Celestial Body
#autoLOC_SCANsat_MapType_Altimetry = Altimetry
#autoLOC_SCANsat_MapType_Biome = Biome
#autoLOC_SCANsat_MapType_Slope = Slope
#autoLOC_SCANsat_MapType_Visual = Visual
#autoLOC_SCANsat_GeneralSettings = General Settings
#autoLOC_SCANsat_BackgroundSettings = Background Settings
#autoLOC_SCANsat_ResourceSettings = Resource Settings
Expand Down
5 changes: 5 additions & 0 deletions SCANassets/Resources/Localization/fr-fr/OtherText.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@
#autoLOC_SCANsat_AltitudeBest = Altitude (opti): <<1>>km\n
#autoLOC_SCANsat_AltitudeMax = Altitude ( max): <<1>>km\n
#autoLOC_SCANsat_FOV = FOV: <<1>>
#autoLOC_SCANsat_MapTitle = Carte S.C.A.N. (<<1>>) de <<2>>
#autoLOC_SCANsat_MapProjection = Projection
#autoLOC_SCANsat_MapType = Type de carte
#autoLOC_SCANsat_MapResource = Ressource
#autoLOC_SCANsat_MapBody = Corps céleste
#autoLOC_SCANsat_MapType_Altimetry = Altimétrie
#autoLOC_SCANsat_MapType_Biome = Biome
#autoLOC_SCANsat_MapType_Slope = Pente
#autoLOC_SCANsat_MapType_Visual = Visuelle
#autoLOC_SCANsat_GeneralSettings = Paramètres généraux
#autoLOC_SCANsat_BackgroundSettings = Paramètres d'arrière-plan
#autoLOC_SCANsat_ResourceSettings = Paramètres de ressources
Expand Down
6 changes: 6 additions & 0 deletions SCANsat/SCAN_Platform/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using KSP.Localization;
using SCANsat.SCAN_Map;

namespace SCANsat
{
Expand All @@ -8,5 +9,10 @@ public static string LocalizeBodyName(this string input)
{
return Localizer.Format("<<1>>", input);
}

public static string LocalizeMapType(this mapType input)
{
return Localizer.Format("#autoLOC_SCANsat_MapType_" + input);
}
}
}
4 changes: 2 additions & 2 deletions SCANsat/SCAN_Unity/SCAN_UI_BigMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ private void SetTitle()
if (uiElement == null || bigmap == null)
return;

uiElement.UpdateTitle(string.Format("S.C.A.N. {0} Map of {1}", bigmap.MType, body.displayName.LocalizeBodyName()));
uiElement.UpdateTitle(Localizer.Format("#autoLOC_SCANsat_MapTitle", bigmap.MType.LocalizeMapType(), body.displayName.LocalizeBodyName())); // #autoLOC_SCANsat_MapTitle = S.C.A.N. <<1>> Map of <<2>>
}

public string Version
Expand Down Expand Up @@ -1552,7 +1552,7 @@ public IList<string> Projections

public IList<string> MapTypes
{
get { return new List<string>(3) { "Altimetry", "Slope", "Biome", "Visual" }; }
get { return new List<string>(Enum.GetNames(typeof(mapType))); }
}

public IList<string> Resources
Expand Down