Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8646209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:44:46+00:00 2026-06-12T12:44:46+00:00

Can someone please explain what is the relation between Locale and ResourceBundle classes provided

  • 0

Can someone please explain what is the relation between Locale and ResourceBundle classes provided by the JDK ? Is it the same as the difference between i18n vs l10n as given in this answer ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:44:47+00:00Added an answer on June 12, 2026 at 12:44 pm

    The relation between Locale and ResourceBundle is, Locale is used to read the right properties file. Basically, the ResourceBundle.Control class takes a Locale object, and given the base name of the properties file, it tries to find the best matching one. For example:

    ResourceBundle rb = ResourceBundle.getbundle("messages", Locale.forLanguageTag("zh-TW");
    

    If you do that, the ResourceBundle.Control will look for messsages_zh_TW.properties, messages_zh-Hant-TW.properties, messages_zh-Hant.properties, messages_zh.properties and finally fall-back to messages.properties if it cannot find any of the specific resource file.

    EDIT

    Just to add one final thing. If you omit the Locale parameter, the ResourceBundle.getBundle(String) will return the properties file based on your default Locale – the one that you can obtain like this:

    Locale default = Locale.getDefault(Locale.Category.DISPLAY);
    

    Although it might seem unnecessary of excessive typing (in the context of desktop applications), it is a good practice to always pass the Locale, as it makes code easier to understand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please explain to me difference between extends and super in java generics
Can someone please explain with example that I can understand about the difference between
Can someone please explain to me the difference between the AppSettings and ApplicationSettings sections
Can someone please explain the difference between the following queries. The joins in the
Can someone please explain to me the difference in the OSI Model between the
Can someone please explain the difference between the following cases and where would we
Can someone please explain to me what is the difference between protected / public
Can someone please explain me what's the difference between Swing and AWT? Are there
Can someone please explain the major differences between Scala, Groovy and Clojure. I know
Can someone please explain about the size of the classes in the case of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.