コード例 #1
0
 public LocalisationApiHelper(StellarisDirectoryHelper stellarisDirectoryHelper,
                              IEnumerable <StellarisDirectoryHelper> modDirectoryHelpers,
                              STLLang language)
 {
     //When using the ILocalisationAp for a specific language, the key thing being used is the Values property,
     //which is a raw dictionary of keys to text values.
     localisation = new Dictionary <string, string>();
     foreach (var directoryHelper in StellarisDirectoryHelper.CreateCombinedList(stellarisDirectoryHelper, modDirectoryHelpers))
     {
         if (Directory.Exists(directoryHelper.Localisation))
         {
             var localisationService =
                 new STLLocalisation.STLLocalisationService(new LocalisationSettings(directoryHelper.Localisation));
             var values = localisationService.Api(Lang.NewSTL(language)).Values;
             localisation.PutAll(values);
         }
         else
         {
             Log.Logger.Debug("{name} has no localisation files", directoryHelper.ModName);
         }
     }
 }
コード例 #2
0
 public LocalisationApiHelper(StellarisDirectoryHelper stellarisDirectoryHelper, STLLang language) : this(stellarisDirectoryHelper,
                                                                                                          new StellarisDirectoryHelper[] { }, language)
 {
 }