@ GET @ Path ( "/{locale}" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response getTranslations ( @ PathParam ( "locale" ) String locale ) { Map < String , String > messages = getMessages ( locale ) ; if ( ! messages . isEmpty ( ) ) { return Response . ok ( messages ) . build ( ) ; } return Response . ok ( "{}" ) . build ( ) ; }
Returns a map of key translation for the given locale .