org.h2.server.web.WebServer.readTranslations()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(145)

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

WebServer.readTranslations介绍

[英]Read the translation for this language and save them in the 'text' property of this session.
[中]

代码示例

代码示例来源:origin: com.h2database/h2

session.locale = locale;
session.put("language", headerLanguage);
server.readTranslations(session, headerLanguage);

代码示例来源:origin: com.h2database/h2

/**
 * Create a new web session id and object.
 *
 * @param hostAddr the host address
 * @return the web session object
 */
WebSession createNewSession(String hostAddr) {
  String newId;
  do {
    newId = generateSessionId();
  } while (sessions.get(newId) != null);
  WebSession session = new WebSession(this);
  session.lastAccess = System.currentTimeMillis();
  session.put("sessionId", newId);
  session.put("ip", hostAddr);
  session.put("language", DEFAULT_LANGUAGE);
  session.put("frame-border", "0");
  session.put("frameset-border", "4");
  sessions.put(newId, session);
  // always read the english translation,
  // so that untranslated text appears at least in english
  readTranslations(session, DEFAULT_LANGUAGE);
  return getSession(newId);
}

代码示例来源:origin: com.h2database/h2

locale.getLanguage()).equals(language)) {
locale = new Locale(language, "");
server.readTranslations(session, locale.getLanguage());
session.put("language", language);
session.locale = locale;

代码示例来源:origin: com.h2database/com.springsource.org.h2

String language = locale.getLanguage();
session.put("language", language);
server.readTranslations(session, language);
break;

代码示例来源:origin: com.h2database/com.springsource.org.h2

WebSession createNewSession(String hostAddr) {
  String newId;
  do {
    newId = generateSessionId();
  } while(sessions.get(newId) != null);
  WebSession session = new WebSession(this);
  session.put("sessionId", newId);
  session.put("ip", hostAddr);
  session.put("language", DEFAULT_LANGUAGE);
  sessions.put(newId, session);
  // always read the english translation, 
  // to that untranslated text appears at least in english
  readTranslations(session, DEFAULT_LANGUAGE);
  return getSession(newId);
}

代码示例来源:origin: org.wowtools/h2

session.locale = locale;
session.put("language", headerLanguage);
server.readTranslations(session, headerLanguage);

代码示例来源:origin: com.eventsourcing/h2

session.locale = locale;
session.put("language", headerLanguage);
server.readTranslations(session, headerLanguage);

代码示例来源:origin: com.eventsourcing/h2

/**
 * Create a new web session id and object.
 *
 * @param hostAddr the host address
 * @return the web session object
 */
WebSession createNewSession(String hostAddr) {
  String newId;
  do {
    newId = generateSessionId();
  } while (sessions.get(newId) != null);
  WebSession session = new WebSession(this);
  session.lastAccess = System.currentTimeMillis();
  session.put("sessionId", newId);
  session.put("ip", hostAddr);
  session.put("language", DEFAULT_LANGUAGE);
  session.put("frame-border", "0");
  session.put("frameset-border", "4");
  sessions.put(newId, session);
  // always read the english translation,
  // so that untranslated text appears at least in english
  readTranslations(session, DEFAULT_LANGUAGE);
  return getSession(newId);
}

代码示例来源:origin: org.wowtools/h2

/**
 * Create a new web session id and object.
 *
 * @param hostAddr the host address
 * @return the web session object
 */
WebSession createNewSession(String hostAddr) {
  String newId;
  do {
    newId = generateSessionId();
  } while (sessions.get(newId) != null);
  WebSession session = new WebSession(this);
  session.lastAccess = System.currentTimeMillis();
  session.put("sessionId", newId);
  session.put("ip", hostAddr);
  session.put("language", DEFAULT_LANGUAGE);
  session.put("frame-border", "0");
  session.put("frameset-border", "4");
  sessions.put(newId, session);
  // always read the english translation,
  // so that untranslated text appears at least in english
  readTranslations(session, DEFAULT_LANGUAGE);
  return getSession(newId);
}

代码示例来源:origin: com.eventsourcing/h2

locale.getLanguage()).equals(language)) {
locale = new Locale(language, "");
server.readTranslations(session, locale.getLanguage());
session.put("language", language);
session.locale = locale;

代码示例来源:origin: com.h2database/com.springsource.org.h2

if (locale == null || !StringUtils.toLowerEnglish(locale.getLanguage()).equals(language)) {
  locale = new Locale(language, "");
  server.readTranslations(session, locale.getLanguage());
  session.put("language", language);
  session.locale = locale;

代码示例来源:origin: org.wowtools/h2

locale.getLanguage()).equals(language)) {
locale = new Locale(language, "");
server.readTranslations(session, locale.getLanguage());
session.put("language", language);
session.locale = locale;

相关文章