Class LocalesBestResource

java.lang.Object
ch.tocco.nice2.rest.core.spi.AbstractRestResource
ch.tocco.nice2.rest.core.impl.resources.LocalesBestResource
All Implemented Interfaces:
RestResource

@Path("/locales/best") public class LocalesBestResource extends AbstractRestResource
This resource provides the best available locale for a given locale. A locale can be passed with the query parameter "for". Example: Available locales are "de-CH", "fr-CH" Query parameter "for": "de" Result: "de-CH" If no query parameter is set, the fallback language will be returned. Resource is mapped to "/locales/best"
  • Constructor Details

    • LocalesBestResource

      public LocalesBestResource(L10N l10N)
  • Method Details

    • getBestLocale

      @GET @Produces("application/json") public LocalesBestBean getBestLocale(@QueryParam("for") String locale)