File Source: i18n.java
/*
P/P * Method: net.sourceforge.pebble.util.I18n__static_init
*/
1 package net.sourceforge.pebble.util;
2
3 import java.util.Locale;
4 import java.util.ResourceBundle;
5
6 import net.sourceforge.pebble.domain.Blog;
7
/*
P/P * Method: void net.sourceforge.pebble.util.I18n()
*/
8 public class I18n {
9 public static String getMessage(Locale locale, String key) {
/*
P/P * Method: String getMessage(Locale, String)
*
* Presumptions:
* java.util.ResourceBundle:getBundle(...)@19 != null
*
* Postconditions:
* init'ed(return_value)
*/
10 ResourceBundle bundle = getBundle(locale);
11 return bundle.getString(key);
12 }
13
14 public static String getMessage(Blog blog, String key) {
/*
P/P * Method: String getMessage(Blog, String)
*
* Preconditions:
* blog != null
*
* Postconditions:
* init'ed(return_value)
*/
15 return getMessage(blog.getLocale(), key);
16 }
17
18 public static ResourceBundle getBundle(Locale locale) {
/*
P/P * Method: ResourceBundle getBundle(Locale)
*
* Postconditions:
* init'ed(return_value)
*/
19 ResourceBundle bundle = ResourceBundle.getBundle("resources", locale);
20 return bundle;
21 }
22 }
SofCheck Inspector Build Version : 2.22510
| i18n.java |
2010-Jun-25 19:40:32 |
| i18n.class |
2010-Jul-19 20:23:38 |