Provide NLS support in JGit.
commit2ae9a85045915a38af2c300aa1874304fd8ea17b
authorSasa Zivkov <sasa.zivkov@sap.com>
Thu, 11 Mar 2010 14:19:34 +0000 (11 15:19 +0100)
committerSasa Zivkov <sasa.zivkov@sap.com>
Thu, 11 Mar 2010 14:19:34 +0000 (11 15:19 +0100)
tree9422a36ea6faca85c513640da521448cbdcbd48a
parent4aa7c5a9a97888224e419d983fcaf4ed0fca733e
Provide NLS support in JGit.

The support for NLS relies on java.util API to load a standard
ResourceBundle and then uses java reflection API to inject localized
strings into public String fields of the corresponding instance
of TranslationBundle.

Locale setting is supported per thread to enable concurrent threads
to use different locales. This is useful when JGit runs in a server
context where (error) messages might need to differ per-request to
suit the user's preference.

Change-Id: Ie0e63a0d7bb74eaad495dbe8248595d8a3a76883
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
18 files changed:
org.eclipse.jgit.test/META-INF/MANIFEST.MF
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/GermanTranslatedBundle.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/GermanTranslatedBundle.properties [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/GermanTranslatedBundle_de.properties [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/MissingPropertyBundle.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/MissingPropertyBundle.properties [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NoPropertiesBundle.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NonTranslatedBundle.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/NonTranslatedBundle.properties [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/TestNLS.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/nls/TestTranslationBundle.java [new file with mode: 0644]
org.eclipse.jgit/META-INF/MANIFEST.MF
org.eclipse.jgit/src/org/eclipse/jgit/errors/TranslationBundleException.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/errors/TranslationBundleLoadingException.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/errors/TranslationStringMissingException.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/nls/NLS.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/nls/TranslationBundle.java [new file with mode: 0644]