@Override public Locale getLocale() { return org.jboss.seam.core.Locale.instance(); }
@Unwrap @Override public java.util.Locale getLocale() { return Contexts.isSessionContextActive() ? LocaleSelector.instance().getLocale() : super.getLocale(); }
@Unwrap @Override public java.util.Locale getLocale() { ServletContexts servletContexts = ServletContexts.getInstance(); ServletRequest request = servletContexts==null ? null : servletContexts.getRequest(); return request==null ? super.getLocale() : request.getLocale(); }
public static java.util.ResourceBundle getBundleNamed(String bundleName) { return java.util.ResourceBundle.getBundle(bundleName, org.jboss.seam.core.Locale.instance()); }
/** * Get an instance for the current Seam Locale * * @see Locale * * @return a SeamResourceBundle */ public static java.util.ResourceBundle getBundle() { return java.util.ResourceBundle.getBundle(SeamResourceBundle.class.getName(), org.jboss.seam.core.Locale.instance()); //note: it does not really matter what we pass here }
/** * Returns usual seam bundle, but with a custom resource control */ protected ResourceBundle getSeamResourceBundle() { ResourceBundle.Control control = HotReloadResourceBundleControl.instance(); return ResourceBundle.getBundle(SeamResourceBundle.class.getName(), org.jboss.seam.core.Locale.instance(), Thread.currentThread().getContextClassLoader(), control); }
private List<java.util.ResourceBundle> getBundlesForCurrentLocale() { Locale instance = org.jboss.seam.core.Locale.instance(); List<ResourceBundle> bundles = getCachedBundle().get(instance); if ( bundles==null ) { bundles = loadBundlesForCurrentLocale(); getCachedBundle().put(instance, bundles); } return bundles; }
@Override public ResourceBundle loadBundle(String bundleName) { try { ResourceBundle.Control control = HotReloadResourceBundleControl.instance(); ResourceBundle bundle = ResourceBundle.getBundle(bundleName, Locale.instance(), Thread.currentThread().getContextClassLoader(), control); log.debug("loaded resource bundle: " + bundleName); return bundle; } catch (MissingResourceException mre) { log.debug("resource bundle missing: " + bundleName); return null; } } }
Locale.instance(), Thread.currentThread().getContextClassLoader() );
String value = new MessageFormat(expr.toString(), Locale.instance()).format(params); builder.append(value);
params.put("lang", org.jboss.seam.core.Locale.instance().getLanguage()); Object result = as.run(ctx, operationName, params);
protected JSONObject getSingleDirectoryEntry(final String storedReference, final String directoryName, final boolean localize, String keySeparator, final boolean dbl10n, final String labelFieldName) { if (storedReference == null || storedReference.isEmpty()) { return null; } DirectoryService directoryService = Framework.getService(DirectoryService.class); try { Directory directory = directoryService.getDirectory(directoryName); if (directory == null) { log.error("Could not find directory with name " + directoryName); return null; } try (Session session = directory.getSession()) { String schemaName = directory.getSchema(); SchemaManager schemaManager = Framework.getService(SchemaManager.class); Schema schema = schemaManager.getSchema(schemaName); final Locale locale = org.jboss.seam.core.Locale.instance(); final String label = SuggestConstants.getLabelFieldName(schema, dbl10n, labelFieldName, locale.getLanguage()); JSONObject obj = resolveDirectoryEntry(storedReference, keySeparator, session, schema, label, localize, dbl10n); return obj; } } catch (DirectoryException de) { log.error("An error occured while obtaining directory " + directoryName, de); return null; } }
SchemaManager schemaManager = Framework.getService(SchemaManager.class); Schema schema = schemaManager.getSchema(schemaName); final Locale locale = org.jboss.seam.core.Locale.instance(); final String label = SuggestConstants.getLabelFieldName(schema, dbl10n, labelFieldName, locale.getLanguage());