qx.locale
Class Manager

java.lang.Object
  extended by qx.core.Object
      extended by qx.core.Target
          extended by qx.util.manager.Value
              extended by qx.locale.Manager

public class Manager
extends Value

Create a new instance of qx.locale.Manager


Constructor Summary
Manager()
           
 
Method Summary
 void _applyLocale(java.lang.Object value, java.lang.Object old)
           
 String _extractLanguage(String locale)
          Extract the language part from a locale.
 void addTranslation(String languageCode, java.lang.Object translationMap)
          Add a translation to the translation manager
 void addTranslationFromClass(String classname, java.lang.Object translationMap)
          Extract language code from class name and add a translation to the translation manager
 String getAvailableLocales()
          Return the available application locales
 String getLanguage()
          Get the language code of the currnt locale
 String getLocale()
          Returns the (computed) value of the property locale.
 String getTerritory()
          Get the territory code of the currnt locale
 void initLocale(String arg)
          Calls the apply method and dispatches the change event of the property locale with the default value defined by the class developer.
 void resetLocale()
          Resets the user value of the property locale.
 void setLocale(String arg)
          Sets the user value of the property locale.
 String translate(String messageId, java.lang.Object args, String locale)
          Translate a message using the current locale and apply format string to the arguments.
 
Methods inherited from class qx.util.manager.Value
_updateObjects, connect, disconnect, isDynamic, resolveDynamic
 
Methods inherited from class qx.core.Target
_dispatchEvent, addChangeSelectionListener, addChangeValueListener, addEventListener, addExecuteListener, addJavaEventListener, createDispatchChangeEvent, createDispatchDataEvent, createDispatchEvent, dispatchEvent, hasEventListeners, removeEventListener
 
Methods inherited from class qx.core.Object
_disposeFields, _disposeObjectDeep, _disposeObjects, base, dispose, get, getDisposed, isDisposed, reset, self, set, toHashCode, toString_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Manager

public Manager()
Method Detail

_applyLocale

public void _applyLocale(java.lang.Object value,
                         java.lang.Object old)

_extractLanguage

public String _extractLanguage(String locale)

Extract the language part from a locale.


addTranslation

public void addTranslation(String languageCode,
                           java.lang.Object translationMap)

Add a translation to the translation manager


addTranslationFromClass

public void addTranslationFromClass(String classname,
                                    java.lang.Object translationMap)

Extract language code from class name and add a translation to the translation manager


getAvailableLocales

public String getAvailableLocales()

Return the available application locales

This corresponds to the Makefile APPLICATION_LOCALES setting


getLanguage

public String getLanguage()

Get the language code of the currnt locale

This is the first part of a locale definition. The language for “de_DE” would be “de”


getLocale

public String getLocale()

Returns the (computed) value of the property locale.

For further details take a look at the property definition: locale.


getTerritory

public String getTerritory()

Get the territory code of the currnt locale

This is the second part of a locale definition. The territory for “de_DE” would be “DE”


initLocale

public void initLocale(String arg)

Calls the apply method and dispatches the change event of the property locale with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: locale.


resetLocale

public void resetLocale()

Resets the user value of the property locale.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: locale.


setLocale

public void setLocale(String arg)

Sets the user value of the property locale.

For further details take a look at the property definition: locale.


translate

public String translate(String messageId,
                        java.lang.Object args,
                        String locale)

Translate a message using the current locale and apply format string to the arguments.



Copyright © 2008 1&1. All Rights Reserved.