Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created May 12, 2011 14:55
Show Gist options
  • Save joshcough/968667 to your computer and use it in GitHub Desktop.
Save joshcough/968667 to your computer and use it in GitHub Desktop.
def availableLocales: Array[Locale] = {
def availble(locale:Locale) = try {
println("trying to find: " + ("GUI_Strings", locale))
val rb = ResourceBundle.getBundle("GUI_Strings", locale, Thread.currentThread.getContextClassLoader)
println("found it: " + rb)
rb
}
catch { case m: MissingResourceException => println("didnt find it"); false }
Locale.getAvailableLocales.filter(availble)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment