[mcs] Support multiple string resource files
authorMarek Safar <marek.safar@gmail.com>
Tue, 12 May 2015 09:43:07 +0000 (11:43 +0200)
committerMarek Safar <marek.safar@gmail.com>
Tue, 12 May 2015 09:45:27 +0000 (11:45 +0200)
mcs/mcs/module.cs
mcs/mcs/settings.cs

index 262f55e7b53f37b34f383ffb509c289294af4411..00afac6c6042b510041e02e6389fc06b07881527 100644 (file)
@@ -745,29 +745,31 @@ namespace Mono.CSharp
                        this.assembly = assembly;
                }
 
-               public void LoadGetResourceStrings (string fileName)
+               public void LoadGetResourceStrings (List<string> fileNames)
                {
-                       if (!File.Exists (fileName)) {
-                               Report.Error (1566, "Error reading resource file `{0}'", fileName);
-                               return;
-                       }
+                       foreach (var fileName in fileNames) {
+                               if (!File.Exists (fileName)) {
+                                       Report.Error (1566, "Error reading resource file `{0}'", fileName);
+                                       return;
+                               }
 
-                       foreach (var l in File.ReadLines (fileName)) {
-                               if (GetResourceStrings == null)
-                                       GetResourceStrings = new Dictionary<string, string> ();
+                               foreach (var l in File.ReadLines (fileName)) {
+                                       if (GetResourceStrings == null)
+                                               GetResourceStrings = new Dictionary<string, string> ();
 
-                               var line = l.Trim ();
-                               if (line.Length == 0 || line [0] == '#' || line [0] == ';')
-                                       continue;
+                                       var line = l.Trim ();
+                                       if (line.Length == 0 || line [0] == '#' || line [0] == ';')
+                                               continue;
                                
-                               var epos = line.IndexOf ('=');
-                               if (epos < 0)
-                                       continue;
+                                       var epos = line.IndexOf ('=');
+                                       if (epos < 0)
+                                               continue;
 
-                               var key = line.Substring (0, epos).Trim ();
-                               var value = line.Substring (epos + 1).Trim ();
+                                       var key = line.Substring (0, epos).Trim ();
+                                       var value = line.Substring (epos + 1).Trim ();
 
-                               GetResourceStrings [key] = value;
+                                       GetResourceStrings [key] = value;
+                               }
                        }
                }
        }
index 42156d77ba9ab630a1abc513ac49c84cb28aee97..9b366d636d852ef5040f9d0d6d145a2b542dfbc1 100644 (file)
@@ -150,7 +150,7 @@ namespace Mono.CSharp {
                public bool BreakOnInternalError;
                #endregion
 
-               public string GetResourceStrings;
+               public List<string> GetResourceStrings;
 
                public bool ShowFullPaths;
 
@@ -1485,7 +1485,10 @@ namespace Mono.CSharp {
                                                return ParseResult.Error;
                                        }
 
-                                       settings.GetResourceStrings = file;
+                                       if (settings.GetResourceStrings == null)
+                                               settings.GetResourceStrings = new List<string> ();
+
+                                       settings.GetResourceStrings.Add (file);
                                        return ParseResult.Success;
                                }