Hi everyone,
I have a question about the following example, inspired from
OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide (page 265-266).
Suppose I have the following properties files:
Zoo_en.properties
hello=Hello
open=is open
Zoo_en_CA.properties
visitor=Canada visitor
Zoo_fr.properties
hello=Bonjour
open=est ouvert
Zoo_fr_CA.properties
visitor=Canada visiteur
name=Zoo de Vancouver
TestClass.java
From what I understand (see table 5.7 on page 264), Java looks first into
Zoo_en_CA.properties (requested locale) and doesn't find the key. Then it looks into
Zoo_en.properties (requested language with no country) and doesn't find the key. Finally, it looks into
Zoo_fr_CA.properties (default locale) and finds the key.
So why do I get a
java.util.MissingResourceException when running this code? Can anyone tell me where I'm wrong?
Thanks in advance.
Kind regards,
Guillaume