@ GET @ Path ( "/{localeId}" ) @ Produces ( MediaType . APPLICATION_JSON ) @ RequiresPermissions ( I18nPermissions . LOCALE_READ ) public Response getAvailableLocale ( @ PathParam ( "localeId" ) String localeId ) { WebAssertions . assertNotBlank ( localeId , LOCALE_SHOULD_NOT_BE_BLANK ) ; LocaleRepresentation availableLocale = localeFinder . findAvailableLocale ( localeId ) ; if ( availableLocale != null ) { return Response . ok ( availableLocale ) . build ( ) ; } return Response . status ( Response . Status . NOT_FOUND ) . build ( ) ; }
Gets the requested locale if it is available in the application .