Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7245347

Browse files
1
1 parent e7bc1a1 commit 7245347

16 files changed

+157
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>ResourceBundleDemo</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.8
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
greeting=Hello, how are you?
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
greeting=Salut comment allez-vous?
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
greeting=Hello, how are you?
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
greeting=Salut comment allez-vous?
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import java.util.Locale;
2+
import java.util.ResourceBundle;
3+
4+
/**
5+
* If Application supports US Country and English language, then read
6+
* message from MessageBundle_en_US.properties file.
7+
*
8+
* If Application supports France country and French language, then
9+
* read message from MessageBundle_fr_FR.properties file.
10+
*/
11+
public class ResourceBundleDemo
12+
{
13+
14+
public static void main(String[] args)
15+
{
16+
17+
/*
18+
* Gets a resource bundle using the specified base name, the
19+
* default locale.
20+
*
21+
* Parameters:
22+
*
23+
* baseName - the base name of the resource bundle, a fully
24+
* qualified class name
25+
*
26+
* Returns:
27+
*
28+
* a resource bundle for the given base name and the default
29+
* locale
30+
*
31+
*/
32+
System.out.println("Default Locale = " + Locale.getDefault());
33+
ResourceBundle bundle = ResourceBundle.getBundle("MessageBundle");
34+
35+
System.out.println("Message in " + Locale.US + " = " + bundle.getString("greeting"));
36+
37+
Locale.setDefault(new Locale("fr", "FR"));
38+
System.out.println("Default Locale = " + Locale.getDefault());
39+
40+
bundle = ResourceBundle.getBundle("MessageBundle");
41+
System.out.println(
42+
"Message in " + Locale.getDefault() + " = " + bundle.getString("greeting"));
43+
44+
}
45+
46+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /