Created
June 10, 2010 12:10
-
-
Save altamic/432895 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# java resource bundles initializer | |
if defined?(JRUBY_VERSION) | |
# include config directory in the class path | |
$CLASSPATH << "file:///#{File.expand_path(File.join(RAILS_ROOT, 'config'))}/" | |
# because ResourceBundle.getBundle doesn't seem to use the JRuby class loader, | |
# we need to pass it explicitly. | |
def load_resource_bundle(basename, lang = java.util.Locale::ENGLISH) | |
java.util.ResourceBundle::getBundle(basename, lang, JRuby.runtime.jruby_class_loader) | |
end | |
JAVA_RESOURCE_BUNDLE = load_resource_bundle('resource') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment