I am trying to use ResourceBundle to read data from a ".properties" file but it cannot be loaded. I receive this error:
Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name language_Vi, locale vi
Code which collects the properties
// Vietnamese login version
private static void VietnameseLogin() {
Locale locale = new Locale("Vi");
ResourceBundle bundle = ResourceBundle.getBundle("language", locale);
Login(bundle);
}
// English login version
private static void EnglishLogin() {
Locale locale = Locale.ENGLISH;
ResourceBundle bundle = ResourceBundle.getBundle("language", locale);
Login(bundle);
}
Directory structure

The names of language should be lowercase and variants are uppercase - so be precise with name of the files:
language_en.propertiesandlanguage_vi.properties. It is a good idea to keep your preferred language file as the fallback so rename one of the above to justlanguage.propertieswithout the 2 digit iso country code.The following code would search for resource bundle named "language" as class and properties definitions in the top level of every classpath jar and directory:
=> SEARCHES FOR:
Resource pathnames should not contain
\\.If you wish to use a directory to keep them, use/. So this would search under a sub-folder:=> SEARCHES FOR: