net.sf.briar.i18n
Class I18nImpl

java.lang.Object
  extended by net.sf.briar.i18n.I18nImpl
All Implemented Interfaces:
I18n

public class I18nImpl
extends java.lang.Object
implements I18n


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.briar.api.i18n.I18n
I18n.Listener
 
Constructor Summary
I18nImpl(FontManager fontManager)
           
 
Method Summary
 void addListener(I18n.Listener l)
          Registers a listener for changes to the i18n locale.
 java.awt.ComponentOrientation getComponentOrientation()
          Returns the ComponentOrientation of the current i18n locale.
 java.util.Locale getLocale()
          Returns the i18n locale.
 void loadLocale()
          Loads the i18n locale from Briar/Data/locale.cfg.
 void loadLocale(java.io.File f)
          Loads the i18n locale from the given file.
 void removeListener(I18n.Listener l)
          Unregisters a listener for changes to the i18n locale.
 void saveLocale()
          Saves the i18n locale to Briar/Data/locale.cfg.
 void saveLocale(java.io.File f)
          Saves the i18n locale to the given file.
 void setLocale(java.util.Locale locale)
          Sets the i18n locale.
 java.lang.String tr(java.lang.String name)
          Returns the named string, translated for the current i18n locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

I18nImpl

@Inject
public I18nImpl(FontManager fontManager)
Method Detail

tr

public java.lang.String tr(java.lang.String name)
Description copied from interface: I18n
Returns the named string, translated for the current i18n locale.

Specified by:
tr in interface I18n

getLocale

public java.util.Locale getLocale()
Description copied from interface: I18n
Returns the i18n locale. This may not match the system locale.

Specified by:
getLocale in interface I18n

setLocale

public void setLocale(java.util.Locale locale)
Description copied from interface: I18n
Sets the i18n locale.

Specified by:
setLocale in interface I18n

loadLocale

public void loadLocale()
                throws java.io.IOException
Description copied from interface: I18n
Loads the i18n locale from Briar/Data/locale.cfg.

Specified by:
loadLocale in interface I18n
Throws:
java.io.IOException

loadLocale

public void loadLocale(java.io.File f)
                throws java.io.IOException
Description copied from interface: I18n
Loads the i18n locale from the given file.

Specified by:
loadLocale in interface I18n
Throws:
java.io.IOException

saveLocale

public void saveLocale()
                throws java.io.IOException
Description copied from interface: I18n
Saves the i18n locale to Briar/Data/locale.cfg.

Specified by:
saveLocale in interface I18n
Throws:
java.io.IOException

saveLocale

public void saveLocale(java.io.File f)
                throws java.io.IOException
Description copied from interface: I18n
Saves the i18n locale to the given file.

Specified by:
saveLocale in interface I18n
Throws:
java.io.IOException

getComponentOrientation

public java.awt.ComponentOrientation getComponentOrientation()
Description copied from interface: I18n
Returns the ComponentOrientation of the current i18n locale.

Specified by:
getComponentOrientation in interface I18n

addListener

public void addListener(I18n.Listener l)
Description copied from interface: I18n
Registers a listener for changes to the i18n locale.

Specified by:
addListener in interface I18n

removeListener

public void removeListener(I18n.Listener l)
Description copied from interface: I18n
Unregisters a listener for changes to the i18n locale.

Specified by:
removeListener in interface I18n