public MNls getNls(Locale locale) { if (locale == null) return getDefaultNls(); String tag = locale.toLanguageTag(); MNls out = getNls(tag); if (out != null) return out; tag = locale.getLanguage(); out = getNls(tag); if (out != null) return out; return getDefaultNls(); }
public MNlsBundle(String path) { setPath(path); }
@Override public synchronized MNls getNls() { if (nlsBundle == null) { // nlsBundle = base(MNlsBundle.class); return null; } return nlsBundle.getNls(locale); }
@Override protected void initUI() { model = createForm(); model.setShowInformation(true); if (model.getForm().getNlsBundle() == null && model.getForm() instanceof MutableMForm) ((MutableMForm)model.getForm()).setNlsBundle(MNlsBundle.lookup(this)); // model.doBuild(getActivator()); try { model.doBuild(); this.addComponent(model); } catch (Exception e) { log.e(e); } }
public synchronized MNls getNls(String locale) { Object out = cache.get(locale); if (out != null) { if (out instanceof MNls) return (MNls)out; return null; } out = createNls(locale); if (out == null || !(out instanceof MNls) || ((MNls)out).size() == 0) out = new Object(); cache.put(locale, out); if (out instanceof MNls) return (MNls)out; return null; }
public synchronized MNls getDefaultNls() { if (defaultNls != null) return defaultNls; defaultNls = getNls(""); if (defaultNls == null) defaultNls = new MNls(); return defaultNls; }
((MutableMForm)model.getForm()).setNlsBundle(MNlsBundle.lookup(this));
public MNlsBundle setOwner(Object owner) { setPath(MNlsFactory.toResourceName(owner)); return this; }
public MNlsBundle(Object owner) { setPath(MNlsFactory.toResourceName(owner)); }