Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cb7734cf
authored
Apr 17, 2010
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i18n from java
1 parent
b3f7a65c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
code/LanBortalWeb/src/fi/insomnia/bortal/I18n.java
code/LanBortalWeb/src/fi/insomnia/bortal/I18n.java
0 → 100644
View file @
cb7734c
package
fi
.
insomnia
.
bortal
;
import
java.util.ResourceBundle
;
import
javax.faces.application.Application
;
import
javax.faces.context.FacesContext
;
/***
* Access i18n localisations from Java code. Feel free to make up a better way.
* @author jkj
*
*/
public
class
I18n
{
public
static
ResourceBundle
GetResourceBundle
()
{
FacesContext
facesContext
=
FacesContext
.
getCurrentInstance
();
Application
app
=
facesContext
.
getApplication
();
ResourceBundle
bundle
=
app
.
getResourceBundle
(
facesContext
,
"i18n"
);
return
bundle
;
}
public
static
String
Get
(
String
key
)
{
String
value
=
GetResourceBundle
().
getString
(
key
);
if
(
key
==
null
)
{
return
"########"
;
}
return
value
;
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment