Questions tagged [resourcebundle]

Resource bundles contain locale-specific objects. When your program needs a locale-specific resource, a String for example, your program can load it from the resource bundle that is appropriate for the current user's locale. In this way, you can write program code that is largely independent of the user's locale isolating most, if not all, of the locale-specific information in resource bundles.

Resource bundles contain locale-specific objects. When your program needs a locale-specific resource, a String for example, your program can load it from the resource bundle that is appropriate for the current user's locale. In this way, you can write program code that is largely independent of the user's locale isolating most, if not all, of the locale-specific information in resource bundles. This allows you to write programs that can:

be easily localized, or translated, into different languages handle multiple locales at once be easily modified later to support even more locales Resource bundles belong to families whose members share a common base name, but whose names also have additional components that identify their locales. For example, the base name of a family of resource bundles might be "MyResources". The family should have a default resource bundle which simply has the same name as its family - "MyResources" - and will be used as the bundle of last resort if a specific locale is not supported. The family can then provide as many locale-specific members as needed, for example a German one named "MyResources_de".

Each resource bundle in a family contains the same items, but the items have been translated for the locale represented by that resource bundle. For example, both "MyResources" and "MyResources_de" may have a String that's used on a button for canceling operations. In "MyResources" the String may contain "Cancel" and in "MyResources_de" it may contain "Abbrechen".

If there are different resources for different countries, you can make specializations: for example, "MyResources_de_CH" contains objects for the German language (de) in Switzerland (CH). If you want to only modify some of the resources in the specialization, you can do so.

763 questions
0
votes
1 answer

Spring: can ResourceBundleMessageSource be configured to load properties in xml format

As you may know, properties are usually written in files in key=value format but can also be written in XML format. The question is if (and how) can Spring's ResourceBundleMessageSource be configured to load properties in XML format.
flybywire
  • 261,858
  • 191
  • 397
  • 503
0
votes
1 answer

Custom ResourceBundle in ADF with only one class

Due to my project's requirements, I have implemented a custom java ResouceBundle class to take resource data from a directory configured in web.xml. My intention is to have only one ResourceBundle class in the project, and whatever resource and…
hoangbv15
  • 360
  • 2
  • 4
  • 14
0
votes
0 answers

Retrieve ResourceBundle Java .properties from source code

I would like to write a script to list Java properties files that are meant to be translated (i.e. Used by ResourceBundle) by scanning the source code. Just wondering whether it can be done by regex pattern, or it can only be obtained from Runtime?
Ding-Yi Chen
  • 2,830
  • 33
  • 27
0
votes
1 answer

error adding files to project

Something weird happened and interested in insights. I created 5 new custom button images in Photoshop and saved them as .png files. Opened my project, navigated to a "buttons" group in the side-bar, and deleted the existing placeholder custom…
Tony
  • 373
  • 5
  • 18
0
votes
0 answers

How to get a ResourceBundle in grails?

I put some properties files (resources.propperties for instance) that I put in the src/main/resources/com/ebiznext/agregation/service/payment/sips directory and I tried to retrieve them in my code like this : ResourceBundle resource =…
Dimitri
  • 8,122
  • 19
  • 71
  • 128
0
votes
2 answers

How to switch from ResourceBundle to Properties (class)?

How to switch from ResourceBundle to Properties (class)? I have an app split into 2 Java projects (core & web). A Java service in the core module have to read values from a .properties file located in the web module. When I use ResourceBundle, it…
maxxyme
  • 2,164
  • 5
  • 31
  • 48
0
votes
1 answer

Translate the Properties File from one language to another using ResourceBundle

I have message.properties file. by default it will load as English when I use Locale and Resource Bundle in Java file. Now, I need to specify the Country Code or Type in Locale, Then the message.properties file key values should be load as the…
0
votes
1 answer

How can i store streaming video in resource folder in iOS?

If i go to the point then my problem is, i want to make a web view where it will load a video and when stream starts then i want to download/store that video data in the resource folder of the application.How can i do that? Please somebody help me…
Emon
  • 452
  • 3
  • 11
  • 21
0
votes
2 answers

Add all files in Document on iphone into copy bundle resource at the runtime

I would like to add all JPEG files in Document on iphone into copy bundle resource at the runtime. Is it possible? How? My plist is FrameMarkers-Info.plist. Where can I put your code. When I add it, it tell me error.
kantawit
  • 101
  • 1
  • 1
  • 6
0
votes
1 answer

Using Resourcebundle Properties in Javascript

I work on a Java EE web application that uses a combination of Dojo and plain javascript for the front-end. We've discovered that when ResourceBundle properties are used in javascript, in some cases they end up breaking code. Specifically, this…
0
votes
0 answers

Locales: Eclipse vs. jar

This is a really simple question that I just don't understand. I use messages.properties files and the Messages class (generated by Eclipse) for my localization. I have this code: public class LocaleTest { public static void main(String[] args)…
wchargin
  • 15,589
  • 12
  • 71
  • 110
0
votes
1 answer

How to package a set of videos in multiple directories and play them in an iPhone app?

I am making a video delivery application and sending a bunch of files in the following directory structure: Home/Week 1/Day 1/123.mp4,abc.mp4,42343.mp4 Home/Week 1/Day 2/123.mp4,xyz.mp4 etc. I need to maintain the directory structure and play the…
manishKungwani
  • 925
  • 1
  • 12
  • 44
0
votes
0 answers

How Jasper retrieve values from resource bundle?

I am currently working on a customized behavior of how Jasper retrieves values from resource bundle object. As I know, I can pass a resource bundle as REPORT_RESOURCE_BUNDLE and $R{SOME_TEXT} in the report will be replaced as the value of resource…
NeoNosliw
  • 111
  • 1
  • 1
  • 7
0
votes
2 answers

Cannot get localization working in MVC 4

I've been trying to follow the blog post found here. I've added a new assembly that hosts my resource files (I used a separate assembly as the resources may need to be shared between multiple projects). I have added the following to my web.config: …
Kyle
  • 17,317
  • 32
  • 140
  • 246
0
votes
2 answers

Are keys unique in resource bundles?

What is the use of public final String[] getStringArray(String key) in ResourceBundle? Aren't keys in properties files unique? Would this ever return more than one value? If not why does it return an array?
Jim
  • 18,826
  • 34
  • 135
  • 254