Implemented a new constructor. Also reintroduced clone().
authorMarco Zanon <info@marcozanon.com>
Sat, 22 Jul 2017 08:05:07 +0000 (08:05 +0000)
committerMarco Zanon <info@marcozanon.com>
Sat, 22 Jul 2017 08:05:07 +0000 (08:05 +0000)
src/java/com/marcozanon/macaco/text/MTranslator.java

index 8ff5c695077487e6fe8d64b3a6034bdd46d638fa..56227520c0c6d802cf97b7eff751469f078abca3 100644 (file)
@@ -36,12 +36,22 @@ public class MTranslator extends MObject {
         this.basicLocale = basicLocale;
     }
 
+    public MTranslator(Locale basicLocale, LinkedHashMap<String, LinkedHashMap<String, String>> messages) {
+        this(basicLocale);
+        //
+        this.messages = messages;
+    }
+
     public MTranslator(Locale basicLocale, String file) throws MTranslationFileParsingException {
         this(basicLocale);
         //
         this.parseFile(file);
     }
 
+    public MTranslator clone() {
+        return new MTranslator(this.getBasicLocale(), this.getMessages());
+    }
+
     /* Locale. */
 
     protected Locale getBasicLocale() {