--- /dev/null
+/**
+ * Macaco
+ * Copyright (c) 2009-2017 Marco Zanon <info@marcozanon.com>.
+ * Released under MIT license (see LICENSE for details).
+ */
+
+package com.marcozanon.macaco;
+
+
+public class MConstants extends MObject {
+
+ public static final String MACACO_VERSION = "6.x";
+
+ public static final String TEXT_ENCODING = "UTF-8";
+
+}
public class MTranslator extends MObject {
- protected String file = null;
protected Locale basicLocale = null;
protected LinkedHashMap<String, LinkedHashMap<String, String>> messages = new LinkedHashMap<String, LinkedHashMap<String, String>>();
/* */
- public MTranslator(String file, Locale basicLocale) throws MTranslationFileParsingException {
+ public MTranslator(Locale basicLocale) {
super();
//
if (null == basicLocale) {
throw new IllegalArgumentException("Invalid 'basicLocale': null.");
}
//
- this.file = file;
this.basicLocale = basicLocale;
- //
- this.parseFile(this.getFile());
- }
-
- public MTranslator clone() {
- MTranslator tmpMTranslator = null;
- try {
- tmpMTranslator = new MTranslator(this.getFile(), this.getBasicLocale());
- }
- catch (MTranslationFileParsingException exception) { // should not happen
- }
- return tmpMTranslator;
}
- /* File. */
-
- protected String getFile() {
- return this.file;
+ public MTranslator(Locale basicLocale, String file) throws MTranslationFileParsingException {
+ this(basicLocale);
+ //
+ this.parseFile(file);
}
/* Locale. */