org.simpleframework.http.Request.getLocales()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(265)

本文整理了Java中org.simpleframework.http.Request.getLocales方法的一些代码示例,展示了Request.getLocales的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getLocales方法的具体详情如下:
包路径:org.simpleframework.http.Request
类名称:Request
方法名:getLocales

Request.getLocales介绍

暂无

代码示例

代码示例来源:origin: org.simpleframework/simple

/**
* This is used to acquire the locales from the request header. The
* locales are provided in the <code>Accept-Language</code> header.
* This provides an indication as to the languages that the client 
* accepts. It provides the locales in preference order.
* 
* @return this returns the locales preferred by the client
*/
public List<Locale> getLocales() {
 return request.getLocales();
}

代码示例来源:origin: org.simpleframework/simple-http

/**
* This is used to acquire the locales from the request header. The
* locales are provided in the <code>Accept-Language</code> header.
* This provides an indication as to the languages that the client 
* accepts. It provides the locales in preference order.
* 
* @return this returns the locales preferred by the client
*/
public List<Locale> getLocales() {
 return request.getLocales();
}

代码示例来源:origin: ngallagher/simpleframework

/**
* This is used to acquire the locales from the request header. The
* locales are provided in the <code>Accept-Language</code> header.
* This provides an indication as to the languages that the client 
* accepts. It provides the locales in preference order.
* 
* @return this returns the locales preferred by the client
*/
public List<Locale> getLocales() {
 return request.getLocales();
}

代码示例来源:origin: restx/restx

@Override
public Locale getLocale() {
  if (request.getLocales() != null && !request.getLocales().isEmpty()) {
    return request.getLocales().get(0);
  }
  return Locale.getDefault();
}

代码示例来源:origin: io.restx/restx-server-simple

@Override
public Locale getLocale() {
  if (request.getLocales() != null && !request.getLocales().isEmpty()) {
    return request.getLocales().get(0);
  }
  return Locale.getDefault();
}

代码示例来源:origin: restx/restx

@Override
public ImmutableList<Locale> getLocales() {
  List<Locale> locales = request.getLocales();
  if (locales.isEmpty()) {
    return ImmutableList.of(Locale.getDefault());
  } else {
    return ImmutableList.copyOf(locales);
  }
}

代码示例来源:origin: io.restx/restx-server-simple

@Override
public ImmutableList<Locale> getLocales() {
  List<Locale> locales = request.getLocales();
  if (locales.isEmpty()) {
    return ImmutableList.of(Locale.getDefault());
  } else {
    return ImmutableList.copyOf(locales);
  }
}

相关文章