made first demo almost fully working
This commit is contained in:
parent
2a0d992642
commit
01b3b5cc54
104 changed files with 3259 additions and 2181 deletions
|
|
@ -59,6 +59,15 @@ public class MergeableResourceBundle extends ResourceBundle {
|
|||
bundleData.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns copy of data of this loaded merged bundle.
|
||||
*/
|
||||
public Map<String,String> getBundleData() {
|
||||
Map<String,String> result = new HashMap<String,String>(bundleData.size());
|
||||
result.putAll(bundleData);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.util.ResourceBundle#handleGetObject(java.lang.String)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_by extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_by extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_da extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_da extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_de extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_de extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_en extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_en extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_es extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_es extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_fr extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_fr extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_it extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_it extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_nl extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_nl extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_pl extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_pl extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_pt extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_pt extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_ro extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_ro extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_ru extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_ru extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
package net.forwardfire.vasc.lib.i18n.bundle;
|
||||
|
||||
import net.forwardfire.vasc.lib.i18n.AbstractRootApplicationBundle;
|
||||
import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +30,7 @@ import net.forwardfire.vasc.lib.i18n.SupportedBundleLocale;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 8, 2012
|
||||
*/
|
||||
public class RootApplicationBundle_sv extends AbstractRootApplicationBundle {
|
||||
public class RootApplicationBundle_sv extends RootApplicationBundle {
|
||||
|
||||
@Override
|
||||
public SupportedBundleLocale getSupportedBundleLocale() {
|
||||
|
|
|
|||
|
|
@ -49,21 +49,21 @@ public class BundleConfigParser {
|
|||
|
||||
private Logger logger = null;
|
||||
public static final String CONFIG_RESOURCE_DEFAULT = "META-INF/root-bundle.properties";
|
||||
protected static final String DEFAULT_CHAR_SET = "UTF-8";
|
||||
protected List<Locale> applicationSupportedLocales = null;
|
||||
protected List<BundleConfig> bundlesConfigs = null;
|
||||
protected List<String> bundleNames = null;
|
||||
protected Charset defaultCharSet = null;
|
||||
|
||||
/**
|
||||
* Creates new BundleConfigParser object.
|
||||
*/
|
||||
protected static final String DEFAULT_CHAR_SET = "UTF-8";
|
||||
protected List<Locale> applicationSupportedLocales = null;
|
||||
protected List<BundleConfig> bundlesConfigs = null;
|
||||
protected List<String> bundleNames = null;
|
||||
protected Charset defaultCharSet = null;
|
||||
|
||||
/**
|
||||
* Creates new BundleConfigParser object.
|
||||
*/
|
||||
public BundleConfigParser() {
|
||||
logger = Logger.getLogger(BundleConfigParser.class.getName());
|
||||
applicationSupportedLocales = new ArrayList<Locale>(10);
|
||||
bundlesConfigs = new ArrayList<BundleConfig>(10);
|
||||
defaultCharSet = Charset.forName(DEFAULT_CHAR_SET);
|
||||
bundleNames = new ArrayList<String>(10);
|
||||
defaultCharSet = Charset.forName(DEFAULT_CHAR_SET);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -258,11 +258,11 @@ public class BundleConfigParser {
|
|||
*/
|
||||
protected void readPropertiesConfig(Properties p) {
|
||||
try {
|
||||
ClassLoader cl = Thread.currentThread().getContextClassLoader();
|
||||
if (cl == null) {
|
||||
cl = p.getClass().getClassLoader(); // fallback
|
||||
}
|
||||
readProperties(p,new InputStreamReader(cl.getResourceAsStream(CONFIG_RESOURCE_DEFAULT),defaultCharSet));
|
||||
ClassLoader cl = Thread.currentThread().getContextClassLoader();
|
||||
if (cl == null) {
|
||||
cl = p.getClass().getClassLoader(); // fallback
|
||||
}
|
||||
readProperties(p,new InputStreamReader(cl.getResourceAsStream(CONFIG_RESOURCE_DEFAULT),defaultCharSet));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Could not load resource: "+CONFIG_RESOURCE_DEFAULT+" error: "+e.getMessage(),e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue