• Post Reply Bookmark Topic Watch Topic
  • New Topic

Message resource bundle

 
Hisouka Devera
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Day,

Im debugging a code that has the following setting:

<application>
<message-bundle>com.web.resources</message-bundle>
<locale-config>
<default-locale>en_US</default-locale>
<supported-locale>fr_FR</supported-locale>
</locale-config>
<resource-bundle>
<base-name>com.web.resources.message</base-name>
<var>message</var>
</resource-bundle>
</application>

Just want to ask, for example I have message_en_US.properties and message_en_SG.properties.

And the web is currently using the SG property but one property is not exist on it, can I just redirect to use the US property?

Cause right now im receiving ???missing_property???

Regards
 
Greg Charles
Sheriff
Posts: 3010
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you probably want is a file called message_en.properties, which contains everything that's the same between US and Singaporean English, and then use the message_en_US.properties and/or message_en_SG.properties just for the differences.

OK, la?
 
Hisouka Devera
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean, for example I have a new property namely:

new_property=New Property Message

I already define this in US but not in SG due to production deployment availabilty.

so SG site will have ???new_property???, can I just redirect to use US instead, if I received this ???new_property???, Until the deployment team define already the new_property.
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Message resources are stacked in layers. You always have a base layer that's used to resolve any resource IDs that the higher layers could not resolve.

In the specific case of language layers, the stack goes from most-specific to least-specific. For example, US English, "Universal" English, then the defaults (which are typically English as well, but that's just the Internet for you.)

Likewise, Brazilian Portuguese, Portuguese in general, default (English).

If the resource ID cannot be resolved by descending through (and searching) these layers, the resource resolver will return "??resource-id??" to let you know that there's no resolution and what the resource-id was that couldn't be resolved.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!