code: @Route(method = HttpMethod.GET, uri = "i18n")
      public Result getMessages(@QueryParameter("locales") List<Locale> locales,
                                @HttpParameter(HeaderNames.IF_NONE_MATCH) String ifNoneMatch) {
  
          // We have to deal with several format here.
          // First, if `locales` is set, use it
          // Finally use the Accept-Language header
  
          Map<String, String> messages;
  
          String etag;
          StringBuilder builder = new StringBuilder();
          if (locales != null && !locales.isEmpty()) {
              for (Locale locale : locales) {
                  builder.append(service.etag(locale));
              }
          } else {
              for (Locale locale : context().request().languages()) {
                  builder.append(service.etag(locale));
              }
          }
          etag = builder.toString();
  
          if (ifNoneMatch != null && ifNoneMatch.equals(etag)) {
              return new Result(Status.NOT_MODIFIED);
          }
  
          if (locales != null && !locales.isEmpty()) {
              messages = service.getAllMessages(locales.toArray(new Locale[locales.size()]));
          } else {
              messages = service.getAllMessages(context().request().languages());
          }
  
          if (messages != null) {
              return ok(messages).with(HeaderNames.ETAG, etag).json();
          } else {
              return notFound().json();
          }
      }
docs: Gets all messages of the given locales as JSON. The format is just a set of key:value.
  
  @param locales     the locales to include, if {@code null} it uses the languages from the request
  @param ifNoneMatch the received ETAG if any
  @return the set of messages