From
@ocpsoft and
@lincolnthree
PrettyFaces:
* EL Api Access to PrettyContext
* JSF1.1 support
* Enhanced support for error pages and servlet forwards
PrettyTime:
* i18n support: (contributed by Thomas Weizel):
* Default handling of null values (no more Exceptions!)
PrettyTime now supports internationalization via resource bundles. Simply place an appropriate resources_**.xml bundle on the classpath: com.ocpsoft.pretty.time, then set the desired locale into your PrettyTime object.
If you create a new Locale resource bundle for PrettyTime, please submit it back to the project here!
import java.util.Date;
import java.util.Locale;
import com.ocpsoft.pretty.time.PrettyTime;
public class Basic_i18n
{
public static void main(final String[] args)
{
PrettyTime p = new PrettyTime(new Locale("de"));
System.out.println(p.format(new Date()));
}
}
Resource bundle example: (find full examples packaged inside pretty-time.jar)
<!-- Century -->
%n %u
In
Vor
Jahrhundert
Jahrhunderten
<!-- Day -->
%n %u
In
<!-- And so on... -->