Interface I18nResource


@Path("/i18n") public interface I18nResource
Resource to translate given keys (optionally including parameters)
  • Method Details

    • list

      @GET @Path("/list") UILanguagesResponse list() throws Exception
      Throws:
      Exception
    • translateFromPath

      @GET @Path("/t/{key}") @Produces("text/plain; charset=UTF-8") String translateFromPath(@PathParam("key") String key, @QueryParam("p") List<String> parameters) throws Exception
      Translate the given key and optional parameters (variant with key given in the path)
      Parameters:
      key - translation key
      parameters - optional parameters
      Returns:
      translated string
      Throws:
      Exception
    • translateFromParam

      @GET @Path("/t") @Produces("text/plain; charset=UTF-8") String translateFromParam(@QueryParam("k") String key, @QueryParam("p") List<String> parameters) throws Exception
      Translate the given key and optional parameters (variant with key given as query parameter)
      Parameters:
      key - translation key
      parameters - optional parameters
      Returns:
      translated string
      Throws:
      Exception
    • setLanguage

      @POST @Path("/set") GenericResponse setLanguage(SetLanguageRequest request) throws Exception
      Set the current session language
      Parameters:
      request - request to set the current session language
      Returns:
      response
      Throws:
      Exception
    • getLanguage

      @GET @Path("/get") LanguageResponse getLanguage() throws Exception
      Get the current session language
      Returns:
      session language
      Throws:
      Exception