//# 0 errors, 31 messages
//#
package net.sourceforge.pebble.util;
    //#i18n.java:1:1: class: net.sourceforge.pebble.util.I18n
    //#i18n.java:1:1: method: net.sourceforge.pebble.util.I18n.net.sourceforge.pebble.util.I18n__static_init

import java.util.Locale;
import java.util.ResourceBundle;

import net.sourceforge.pebble.domain.Blog;

public class I18n {
    //#i18n.java:8: method: void net.sourceforge.pebble.util.I18n.net.sourceforge.pebble.util.I18n()
    //#i18n.java:8: end of method: void net.sourceforge.pebble.util.I18n.net.sourceforge.pebble.util.I18n()
	public static String getMessage(Locale locale, String key) {
		ResourceBundle bundle = getBundle(locale);
    //#i18n.java:10: method: String net.sourceforge.pebble.util.I18n.getMessage(Locale, String)
    //#input(String getMessage(Locale, String)): key
    //#input(String getMessage(Locale, String)): locale
    //#output(String getMessage(Locale, String)): return_value
    //#presumption(String getMessage(Locale, String)): java.util.ResourceBundle:getBundle(...)@19 != null
    //#post(String getMessage(Locale, String)): init'ed(return_value)
    //#unanalyzed(String getMessage(Locale, String)): Effects-of-calling:java.util.ResourceBundle:getBundle
	    return bundle.getString(key);
    //#i18n.java:11: end of method: String net.sourceforge.pebble.util.I18n.getMessage(Locale, String)
	}
	
	public static String getMessage(Blog blog, String key) {
	    return getMessage(blog.getLocale(), key);
    //#i18n.java:15: method: String net.sourceforge.pebble.util.I18n.getMessage(Blog, String)
    //#i18n.java:15: Warning: method not available
    //#    -- call on Locale net.sourceforge.pebble.domain.Blog:getLocale()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.I18n
    //#    method: String getMessage(Blog, String)
    //#    unanalyzed callee: Locale net.sourceforge.pebble.domain.Blog:getLocale()
    //#input(String getMessage(Blog, String)): blog
    //#input(String getMessage(Blog, String)): key
    //#output(String getMessage(Blog, String)): return_value
    //#pre[1] (String getMessage(Blog, String)): blog != null
    //#post(String getMessage(Blog, String)): init'ed(return_value)
    //#unanalyzed(String getMessage(Blog, String)): Effects-of-calling:java.util.ResourceBundle:getBundle
    //#unanalyzed(String getMessage(Blog, String)): Effects-of-calling:java.util.ResourceBundle:getString
    //#i18n.java:15: end of method: String net.sourceforge.pebble.util.I18n.getMessage(Blog, String)
	}

	public static ResourceBundle getBundle(Locale locale) {
		ResourceBundle bundle = ResourceBundle.getBundle("resources", locale);
    //#i18n.java:19: method: ResourceBundle net.sourceforge.pebble.util.I18n.getBundle(Locale)
    //#input(ResourceBundle getBundle(Locale)): locale
    //#output(ResourceBundle getBundle(Locale)): return_value
    //#post(ResourceBundle getBundle(Locale)): init'ed(return_value)
		return bundle;
    //#i18n.java:20: end of method: ResourceBundle net.sourceforge.pebble.util.I18n.getBundle(Locale)
	}
}
    //#output(net.sourceforge.pebble.util.I18n__static_init): __Descendant_Table[net/sourceforge/pebble/util/I18n]
    //#post(net.sourceforge.pebble.util.I18n__static_init): __Descendant_Table[net/sourceforge/pebble/util/I18n] == &__Dispatch_Table
    //#i18n.java:: end of method: net.sourceforge.pebble.util.I18n.net.sourceforge.pebble.util.I18n__static_init
    //#i18n.java:: end of class: net.sourceforge.pebble.util.I18n
