-
国际化
2011-10-01 00:30:23应用名称国际化 创建对应语言的InfoPlist.strings文件 加入以下内容: CFBundleDisplayName = "应用程序的名字"; 源代码中的国际化 genstrings *.m -o zh-Hans.lproj 带递归查找所有子目录的 find ./ -...应用名称国际化
创建对应语言的InfoPlist.strings文件
加入以下内容:
CFBundleDisplayName = "应用程序的名字";
源代码中的国际化
genstrings *.m -o zh-Hans.lproj
带递归查找所有子目录的
find ./ -name *.m | xargs genstrings -o en.lproj
-
springboot国际化i18n
2020-05-20 22:13:19springboot国际化 支持多国语言展示 1、自动式国际化:通过浏览器发送请求头携带的信息自动使用国际化 2、手动式国际化:通过点击按钮,动态更改国际化 由于springboot自动配置中已集成国际化,直接使用即可 ...springboot国际化
支持多国语言展示
1、自动式国际化:通过浏览器发送请求头携带的信息自动使用国际化
2、手动式国际化:通过点击按钮,动态更改国际化
由于springboot自动配置中已集成国际化,直接使用即可
1、创建语言包:(文件编码为:ascii)
/src/main/resources/ static/i18n/messages.properties 默认配置 static/i18n/messages_zh_CN.properties 中文配置 static/i18n/messages_en_US.properties 英文配置 static/i18n/messages_zh_TW.properties 中文繁体
2、配置文件内容:(可以为空,但key不能不写)
messages_zh_CN.properties user.title=用户登录 user.welcome=欢迎使用 messages_en_US.properties user.title=User Login user.welcome=Welcome
3、初始化配置:
spring.messages.basename=static/i18n/messages
4、取国际化内容:
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> <fmt:message key="user.welcome" />
注:
此种方法是根据浏览器请求中的Accept-Language决定的
Accept-Language:zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4
切换语言:
谷歌--设置--高级--语言--等
2.1
通过点击按钮,动态更改国际化
1、增加自定义区域解析器
import java.util.Locale; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.util.StringUtils; import org.springframework.web.servlet.LocaleResolver; /** * @title: 自定义区域解析器 * @time: 2019年11月19日 * * <msg> * SpringBoot默认的Locale解析器是根据请求头的区域信息进行解析的(浏览器语言) * 使用自定义的Locale解析器对url的区域信息进行解析达到点击切换区域效果 * 一旦我们自定义的区域解析器注册到Spring容器中,则SpringBoot提供的将不自动注册 * </msg> * */ public class LocaleResolverConfig implements LocaleResolver { /** * 获取页面传输信息,执行对应的国际化 */ @Override public Locale resolveLocale(HttpServletRequest request) { String lang = request.getParameter("lang"); if (!StringUtils.isEmpty(lang)) { String[] langSplit = lang.split("_"); return new Locale(langSplit[0],langSplit[1]); } return Locale.getDefault();//使用默认配置 } @Override public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) { // 增加新语言时使用 //SessionLocaleResolver localeResolver = new SessionLocaleResolver(); //localeResolver.setDefaultLocale(Locale.SIMPLIFIED_CHINESE); } }
2、将自定义区域解析器注入容器
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; /** * * @title: 初始化自定义bean * @time: 2019年11月19日 * */ @Configuration public class InitLocalConfig { /** * 注入-自定义区域解析器 * @return */ @Bean public LocaleResolver localeResolver() { return new LocaleResolverConfig(); } }
3、通过点击,使用对应的国际化
<a href="<%=request.getContextPath()%>/?lang=zh_CN" >中文简体</a> <a href="<%=request.getContextPath()%>/?lang=zh_TW" >中文繁体</a> <a href="<%=request.getContextPath()%>/?lang=en_US" >English</a>
存在的问题一:
存在iframe跳转时,请求中的Accept-Language会改变原来解析,利用session转存即可
import java.util.Locale; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.util.StringUtils; import org.springframework.web.servlet.LocaleResolver; import com.axa.pricingplatform.constants.CommonConstant; /** * * @title: 自定义区域解析器 * @time: 2019年11月19日 * * <msg> * SpringBoot默认的Locale解析器是根据请求头的区域信息进行解析的(浏览器语言) * 使用自定义的Locale解析器对url的区域信息进行解析达到点击切换区域效果 * 一旦我们自定义的区域解析器注册到Spring容器中,则SpringBoot提供的将不自动注册 * </msg> * */ public class LocaleResolverConfig implements LocaleResolver { /** * 获取页面传输信息,执行对应的国际化 */ @Override public Locale resolveLocale(HttpServletRequest request) { String lang = request.getParameter("lang"); if (!StringUtils.isEmpty(lang)) { request.getSession().setAttribute(CommonConstant.LOGIN_LANG, lang); String[] langSplit = lang.split("_"); return new Locale(langSplit[0],langSplit[1]); } lang = (String) request.getSession().getAttribute(CommonConstant.LOGIN_LANG); if(!StringUtils.isEmpty(lang)){ String[] langSplit = lang.split("_"); return new Locale(langSplit[0],langSplit[1]); } return Locale.getDefault();//使用默认配置 } }
问题二:
jstl在单独的js文件中,获取不到国际化的值
原因:
jstl、el的标签会转化为服务器端的代码执行,而js代码则在客户端执行
如果是单独的js文件,jstl、el表达式是不起作用的,
jstl、EL表达式是在服务端执行的,服务端执行完成后再传给客户端的,js是在客户端执行的,el在js前就被执行了
解决办法:
将单独的js合并至对应的jsp页面即可
-
SpringMVC_国际化_点击国际化
2019-08-03 22:43:47SpringMVC_国际化<spring.version>5.2.6.RELEASE</spring.version>
1 步骤
1、写好国际化资源文件
2、让Spring的ResourceBundleMessageSource管理国际化资源文件
<!--id固定--> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <!--基础名--> <property name="basename" value="loginpage/login"/> </bean>
3、直接去页面取值
4、按照浏览器带来语言信息决定(现象)
//获取到浏览器的区域信息 Locale locale = request.getLocale();
2 SpringMVC中的区域信息解析器分析
SpringMVC中区域信息是由区域信息解析器得到的,默认会用一个AcceptHeaderLocaleResolver,所有用到区域信息的地方,都是用到AcceptHeaderLocaleResolver获取的
//org.springframework.web.servlet.DispatcherServlet.localeResolver private LocaleResolver localeResolver; //org.springframework.web.servlet.DispatcherServlet#render Locale locale = this.localeResolver.resolveLocale(request);
public interface LocaleResolver { // 获取Locale Locale resolveLocale(HttpServletRequest request); // 设置Locale void setLocale(HttpServletRequest request, @Nullable HttpServletResponse response, @Nullable Locale locale); }
// org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver#resolveLocale @Override public Locale resolveLocale(HttpServletRequest request) { return request.getLocale(); }
3 点击链接切换国际化
点击链接切换国际化,要求国际化信息能改变
3.1 AcceptHeaderLocaleResolver
AcceptHeaderLocaleResolver,使用请求头的区域信息,不能设置
// org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver#resolveLocale @Override public Locale resolveLocale(HttpServletRequest request) { // 没有用默认 Locale defaultLocale = getDefaultLocale(); if (defaultLocale != null && request.getHeader("Accept-Language") == null) { return defaultLocale; } // 请求头中获取Locale Locale requestLocale = request.getLocale(); List<Locale> supportedLocales = getSupportedLocales(); if (supportedLocales.isEmpty() || supportedLocales.contains(requestLocale)) { return requestLocale; } Locale supportedLocale = findSupportedLocale(request, supportedLocales); if (supportedLocale != null) { return supportedLocale; } return (defaultLocale != null ? defaultLocale : requestLocale); } // org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver#setLocale @Override public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) { throw new UnsupportedOperationException("Cannot change HTTP accept header - use a different locale resolution strategy"); }
2 FixedLocaleResolver
FixedLocaleResolver,使用系统默认的区域信息
//org.springframework.web.servlet.i18n.FixedLocaleResolver#resolveLocale @Override public Locale resolveLocale(HttpServletRequest request) { Locale locale = getDefaultLocale(); if (locale == null) { locale = Locale.getDefault(); } return locale; } // org.springframework.web.servlet.i18n.FixedLocaleResolver#resolveLocaleContext @Override public LocaleContext resolveLocaleContext(HttpServletRequest request) { return new TimeZoneAwareLocaleContext() { @Override @Nullable public Locale getLocale() { return getDefaultLocale(); } @Override public TimeZone getTimeZone() { return getDefaultTimeZone(); } }; } // org.springframework.web.servlet.i18n.FixedLocaleResolver#setLocaleContext @Override public void setLocaleContext( HttpServletRequest request, @Nullable HttpServletResponse response,@Nullable LocaleContext localeContext) { throw new UnsupportedOperationException("Cannot change fixed locale - use a different locale resolution strategy"); }
3 SessionLocaleResolver
SessionLocaleResolver,区域信息是从session中获取,可以根据请求参数创建一个locale对象,把他放在session中
public static final String LOCALE_SESSION_ATTRIBUTE_NAME = SessionLocaleResolver.class.getName() + ".LOCALE"; // org.springframework.web.servlet.i18n.SessionLocaleResolver#resolveLocale @Override public Locale resolveLocale(HttpServletRequest request) { Locale locale = (Locale) WebUtils.getSessionAttribute(request, this.localeAttributeName); if (locale == null) { locale = determineDefaultLocale(request); } return locale; }
@RequestMapping("/login") public String toLoginPage(@RequestParam(value = "locale", defaultValue = "zh_CN") String localeStr, Locale locale, HttpSession session) { // zh_CN Locale l; // 如果带了locale参数就用参数指定的区域信息,如果没带就用请求头的 if (localeStr != null && !"".equals(localeStr)) { l = new Locale(localeStr.split("_")[0], localeStr.split("_")[1]); } else { l = locale; } // session.setAttribute(SessionLocaleResolver.class.getName() + ".LOCALE", l); // 返回登陆页面 return "login"; }
4 CookieLocaleResolver
// org.springframework.web.servlet.i18n.CookieLocaleResolver#resolveLocale @Override public Locale resolveLocale(HttpServletRequest request) { parseLocaleCookieIfNecessary(request); return (Locale) request.getAttribute(LOCALE_REQUEST_ATTRIBUTE_NAME); }
4 代码演示
4.1 国际化资源文件
login_en_US.properties
welcomeinfo=welcome to Xxx.com username=USERNAME password=PASSWORD loginBtn=LOGIN
login_zh_CN.properties
welcomeinfo=欢迎来到Xxx username=用户名 password=密码 loginBtn=登录
4.2 登录页面
index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <a href="tologinpage">去登陆页面</a> </body> </html>
@RequestMapping("/tologinpage") public String tologinPage(Locale locale, Model model) { System.out.println(locale); //第一个参数是key、第二次参数是占位符、第三个是区域信息 String welcomeinfo = messageSource.getMessage("welcomeinfo", null, locale); System.out.println(welcomeinfo); model.addAttribute("welcomeinfo", welcomeinfo); return "login"; }
WEB-INF/pages/login.jsp
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <h1> <!-- 国际化的区域信息是决定国际化显示的因素 --> <fmt:message key="welcomeinfo"/> </h1> <form action=""> <fmt:message key="username"/>:<input/><br/> <fmt:message key="password"/>:<input/><br/> <input type="submit" value="<fmt:message key="loginBtn"/>"/> </form> <!-- 如果点击超链接切换国际化 --> <a href="tologinpage?locale=zh_CN">中文</a>|<a href="tologinpage?locale=en_US">English</a> </body> </html>
c)使用SessionLocaleResolver
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"> <context:component-scan base-package="com.atguigu"/> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/pages/"/> <property name="suffix" value=".jsp"/> </bean> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename" value="loginpage/login"/> </bean> <!-- 区域信息从session中拿 --> <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/> <mvc:interceptors> <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"/> </mvc:interceptors> <mvc:default-servlet-handler/> <mvc:annotation-driven/> </beans>
上面配置的这个拦截器,做的事情就和下面的代码差不多
/** * 配置一个拦截器来执行下面的方法 */ @RequestMapping("/tologinpage02") public String tologinPage02(@RequestParam(value = "locale", defaultValue = "zh_CN") String localeStr, Locale locale, HttpSession session) { // zh_CN Locale l; // 如果带了locale参数就用参数指定的区域信息,如果没带就用请求头的 if (localeStr != null && !"".equals(localeStr)) { l = new Locale(localeStr.split("_")[0], localeStr.split("_")[1]); } else { l = locale; } // session.setAttribute(SessionLocaleResolver.class.getName() + ".LOCALE", l); return "login"; }
d)自定义区域信息解析器
public class MyLocaleResolver implements LocaleResolver { /** * 解析返回locale * zh_CN */ @Override public Locale resolveLocale(HttpServletRequest req) { Locale locale; String localeStr = req.getParameter("locale"); //如果带了locale参数就用参数指定的区域信息 if (localeStr != null && !"".equals(localeStr)) { locale = new Locale(localeStr.split("_")[0], localeStr.split("_")[1]); } else {//如果没带就用请求头的 locale = req.getLocale(); } return locale; } /** * 修改locale * 不支持,直接抛异常 */ @Override public void setLocale(HttpServletRequest arg0, HttpServletResponse arg1, Locale arg2) { throw new UnsupportedOperationException( "Cannot change HTTP accept header - use a different locale resolution strategy"); } }
SpringMVC配置文件
<!--id固定--> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <!--基础名--> <property name="basename" value="loginpage/login"/> </bean> <!--自定义区域信息解析器 --> <!--id固定,找不到用默认的--> <bean id="localeResolver" class="com.atguigu.controller.MyLocaleResolver"/> <mvc:default-servlet-handler/> <mvc:annotation-driven/>
@RequestMapping("/tologinpage") public String tologinPage(Locale locale, Model model) { System.out.println(locale); //第一个参数是key、第二次参数是占位符、第三个是区域信息 String welcomeinfo = messageSource.getMessage("welcomeinfo", null, locale); System.out.println(welcomeinfo); model.addAttribute("welcomeinfo", welcomeinfo); return "login"; }
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.0.0.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency>
-
SpringBoot_国际化_点击国际化
2019-08-04 23:09:51SpringBoot_国际化_点击国际化SpringBoot国际化和SpringMVC的国际化是一样的,只是SpringBoot已经帮我们配置好了
1)、编写国际化配置文件;
2)、使用ResourceBundleMessageSource管理国际化资源文件
3)、在页面使用fmt:message取出国际化内容
一、ResourceBundleMessageSource
2)、SpringBoot自动配置好了管理国际化资源文件的组件
/org/springframework/boot/spring-boot-test-autoconfigure/1.5.10.RELEASE/spring-boot-test-autoconfigure-1.5.10.RELEASE.jar!/META-INF/spring.factories 里面已经加载了MessageSourceAutoConfiguration 这个类
@ConfigurationProperties(prefix = "spring.messages") public class MessageSourceAutoConfiguration { /** * Comma-separated list of basenames (essentially a fully-qualified classpath * location), each following the ResourceBundle convention with relaxed support for * slash based locations. If it doesn't contain a package qualifier (such as * "org.mypackage"), it will be resolved from the classpath root. */ private String basename = "messages"; //我们的配置文件可以直接放在类路径下叫messages.properties; @Bean public MessageSource messageSource() { ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); if (StringUtils.hasText(this.basename)) { //设置国际化资源文件的基础名(去掉语言国家代码的) messageSource.setBasenames(StringUtils.commaDelimitedListToStringArray( StringUtils.trimAllWhitespace(this.basename))); } if (this.encoding != null) { messageSource.setDefaultEncoding(this.encoding.name()); } messageSource.setFallbackToSystemLocale(this.fallbackToSystemLocale); messageSource.setCacheSeconds(this.cacheSeconds); messageSource.setAlwaysUseMessageFormat(this.alwaysUseMessageFormat); return messageSource; }
二、区域信息解析器
SpringBoot也帮我们配置了一个区域信息解析器AcceptHeaderLocaleResolver
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#localeResolver
//org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#localeResolver @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "spring.mvc", name = "locale") public LocaleResolver localeResolver() { if (this.mvcProperties .getLocaleResolver() == WebMvcProperties.LocaleResolver.FIXED) { return new FixedLocaleResolver(this.mvcProperties.getLocale()); } AcceptHeaderLocaleResolver localeResolver = new AcceptHeaderLocaleResolver(); localeResolver.setDefaultLocale(this.mvcProperties.getLocale()); return localeResolver; }
@ConditionalOnMissingBean 的意思是容器中没有才可以注册一个,如果我们自己注册过这个就不会加入容器中
/** * 自定义区域信息解析器 */ public class MyLocaleResolver implements LocaleResolver { @Override public Locale resolveLocale(HttpServletRequest request) { String l = request.getParameter("l"); Locale locale = Locale.getDefault(); if(!StringUtils.isEmpty(l)){ String[] split = l.split("_"); locale = new Locale(split[0],split[1]); } return locale; } @Override public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) { } }
@Bean public LocaleResolver localeResolver() { return new MyLocaleResolver(); }
-
Spring国际化--通过数据库存储国际化数据实现动态国际化
2018-06-16 14:55:22最近参与了一个境外钱包的项目,要求是实现SpringMVC的动态国际化。之前用Spring做国际化,都将国际化信息写在properties文件中。这次在项目中遇到一个需求,需要把properties文件去掉,直接从数据库读取国际化信息... -
Android国际化-图片国际化和文本字符国际化
2016-10-26 17:16:162、需要国际化的文本资源和图片资源名称是一样的 图片国际化 默认:drawable-xhdpi 中文简体:drawable-zh-rCN-xhdpi(或者不写) 韩文:drawable-ko-rKR-xhdpi 越南语:drawable-vi-rVN-xhdpi ... -
SpringBoot 国际化配置,SpringBoot Locale 国际化使用方法
2018-12-25 18:28:16在项目中,很多时候需要国际化的支持,这篇文章要介绍一下springboot项目中多语言国际化的使用。 本文项目结构如图: springboot默认就支持国际化的,而且不需要你过多的做什么配置,只需要在... -
Spring Boot 国际化踩坑指南
2020-03-05 09:05:51国际化,也叫 i18n,为啥叫这个名字呢?因为国际化英文是 internationalization ,在 i 和 n 之间有 18 个字母,所以叫 i18n。我们的应用如果做了国际化就可以在不同的语言环境下,方便的进行切换,最常见的就是中文... -
Android 国际化,文本国际化,图片国际化
2015-10-19 11:41:58Android 文本资源国际化 1. 新建一个中文资源文件夹 values-zh strings.xml 2.新建一个英文资源文件夹 values-en strings.xml 说明: 现在共有三个资源文件夹 1> values 默认资 -
jquery国际化
2019-02-13 10:40:55近期公司准备重构项目,语言翻译要求不能用映射表,后来发现了jquery国际化(jQuery.i18n.properties ),在前端实现 先简单的一下jQuery.i18n.properties jQuery.i18n.properties是一款轻量级的jQuery国际化插件,... -
Java国际化及Spring国际化解决方法
2018-08-06 19:16:59假设我们正在开发一个支持多国语言的Web应用程序,要求系统能够根据客户端的系统的语言类型返回对应的界面:英文的操作系统返回英文界面,而中文的操作系统则返回中文界面——这便是典型的i18n国际化问题。... -
springboot实现国际化
2019-07-08 18:32:38在springmvc中实现国际化的步骤一般分为以下几步: 1)、编写国际化配置文件; 2)、使用ResourceBundleMessageSource管理国际化资源文件 3)、在页面使用fmt:message取出国际化内容 在springboot中自动装配好了国际... -
JavaWeb开发——软件国际化(动态元素国际化)
2019-04-24 23:05:44软件国际化的第二个部分,就是动态元素国际化。 数值,货币,时间,日期等数据由于可能在程序运行时动态产生,所以无法像文字一样简单地将它们从应用程序中分离出来,而是需要特殊处理。Java 中提供了解决这些问题... -
iOS国际化及应用内部实现国际化
2016-01-08 13:29:07iOS国际化 转载:1、点击打开链接 包含了App程序的国际化化例如App名字的国际化 、应用内部内容的国际化 转载:2、点击打开链接 介绍的很详细,包括了图片,xib,storyboar的国际化,还分享了... -
superset国际化
2017-03-09 19:20:22最近由于工作需要研究开源可视化项目superset,由于其国际化做不怎么好,故而记录下国际化的过程,本篇本着『授人以鱼不如授人以渔』的原则,只叙述国际化的过程及方法,不提供直接的国际化文件。 -
Spring 国际化
2015-07-08 03:07:37问一下 各位大神 我有个国际化的问题, 就是我spring配置了基于session的国际化,现在只有经过controller然后转到jsp的可以国际化是成功的,但直接访问JSP的不行,这是怎么回事? JSP里面是直接用的jstl标签。 -
JavaWeb开发——软件国际化(文本元素国际化)
2019-04-22 23:28:55前几天围绕着JDBC编程进行了系统的学习。现在我们对Java程序数据库操作已经是轻车熟路了。...软件的国际化:软件开发时,要使它能同时应对世界不同地区和国家的访问,并针对不同地区和国家的访问,提供相应的... -
spring 国际化
2018-03-06 13:58:21spring 国际化 i18n(其 来源是英文单词 internationalization的首末字符i和n,18为中间的字符数)是“国际化”的简称。在资讯领域,国际化(i18n)指让产品(出版 物,软件,硬件等)无需做大的改变就能够适应不同的... -
SpringBoot 国际化配置,SpringBoot Locale 国际化
2018-05-25 15:56:37一、效果所下: 二、SpringBoot 国际化配置1、创建国际化配置文件(3个):mess.propertiesJava代码 mess.user.name=用户名 mess.user.password=密码 mess.user.btn=登录 mess_zh_CN.propertiesJava代码 mess.... -
springmvc 国际化
2016-07-11 11:34:08描述了如何实现Spring的国际化,在jsp页面中如何获取国际化信息,本文描述如何在java代码中获取国际化信息,同时国际化切换和返回信息语言切换。 1、主要的jar包为: org.springframework spring-webmvc $... -
antd国际化
2018-10-08 08:59:25在项目当中主要在用confirm方法或者modal弹框的时候用到了antd的国际化,将对应按钮对应的text改成中文 1. 全局国际化 import { LocaleProvider } from 'antd' import zn_CN from 'antd/lib/locale-provider/zh_CN' ... -
iOS 国际化 没有国际化的语言显示默认语言
2016-07-27 17:15:01iOS 国际化 没有国际化的语言显示默认语言我们公司只做了简体,繁体,英文国际化 需求是如果没有国际化的语言默认显示英语。 -
SpringMVC国际化
2017-03-04 18:10:511、SpringMVC国际化流程: 2、localeResolver作用: 3、基于session的国际化实现: 4、测试源代码: 5、SpringMVC配置文件: -
一篇文章解决springboot+thymeleaf多语言国际化
2020-07-17 16:12:061.前言 博主最近在写一个多语言的项目,因为之前没实际接触过多语言的设计,所以写这篇文章记录下这次多语言开发的过程。 博主的开发环境是:Springboot... 利用拦截器和注解自动设置前端页面显示国际化信息的文件 -
Spring Boot国际化支持
2020-02-21 09:00:36文章目录添加Maven支持...国际化支持应该是所有的做国际化网站都需要考虑的一个问题,Spring Boot为国际化提供了强有力的支持,本文将会通过一个例子来讲解Spring Boot的国际化。 添加Maven支... -
springmvc +mybatis 动态国际化(使用数据库保存国际化配置)
2018-10-11 16:03:48springMVC的动态国际化,是使用数据库保存国际化对应的value值,系统启动后加载所有国际化配置到缓存(也可以直接读取数据库,效率低,不推荐),修改数据库中对应的国际化value值后刷新。自定义国际化的解析类,从... -
app名字国际化与字符串国际化
2015-07-21 20:24:44有时候我们的app需要不同的名字进行国际化, 下面就演示一下app名字的国际化,直接上图 InfoPlist.strings的内容,CFBundleDisplayName的值“Demo”就是app... -
Vue项目如何实现国际化?分享一下基于vue-i18n实现国际化的经验
2018-03-09 10:53:16vue项目如何实现国际化?分享一下基于vue-i18n实现国际化的经验 demo源码链接:https://github.com/XieTongXue/how-to/tree/master/vue-internationalization 步骤一:安装vue-i18n npm install vue-i18n --save ... -
SpringBoot后端国际化
2019-09-11 14:13:54国际化 思路 Spring对国际化支持的接口是MessageSource。 可以使用其子类ResourceBundleMessageSource,设置国际化文件的文职,和字符集,并把其交给Spring容器。 可以使用java.util.Locale对默认要使用的语言进行...
-
php 正则判断是否是手机号码
-
tuxing_print.py
-
转行做IT-第2章 HTML入门及高级应用
-
关于Qtdesigner中图像处理的一些踩过的坑:进程已结束,退出代码 -1073740791 (0xC0000409)
-
fcitx5在vscode中的BUG
-
反应过程vghtet.zip
-
分布式微服务例子:SpringBoot2.X+SpringCloud+SpringDataJPA+Consul+Feign+Swagger
-
Qt项目实战之基于Redis的网络聊天室
-
NPOI.Excel.2.1.1.7z
-
Qt and Qt Charts
-
性能测试面面观
-
汽车CAN总线系统原理、设计与应用.rar
-
从零开始学习jQuery教程_c#.net版.zip
-
转行做IT-第6章 IDEA、方法
-
【ZJU-Machine Learning】SVM的应用
-
初识linux
-
mirrors-llvm-project-master.zip
-
Python高级语法(第十讲)
-
centos7.2安装php7.2
-
百度翻译最新版的最精简版(功能完好).rar