Build web application with GolangIn this section, we'll be talking about internationalization and localization (usually expressed as i18n and L10N, respectively). Internationalization is the process of designing applications that are flexible language or cultural needs of specific locales. Currently, Go's standard package does not provide i18n support, but there are some useful and relatively simple third-party implementations available. In pages with locale appropriate content. Through these three sections, we'll be able to support full i18n in our web applications. Links Directory Previous Chapter: Chapter 9 Summary Next section: Setting0 码力 | 327 页 | 1.63 MB | 1 年前3
Go Web编程tion and localization,通常用i18n和L10N表示),国际化是将针对某个地区设 计的程序进行重构,以使它能够在更多地区使用,本地化是指在一个面向国际化的程序中增加对新地区的支持。 目前,Go语言的标准包没有提供对i18n的支持,但有一些比较简单的第三方实现,这一章我们将实现一个go-i18n 库,用来支持Go语言的i18n。 所谓的国际化:就是根据特定的locale信 将 介绍如何处理或存储字符串、货币、时间日期等与locale相关的信息,第三小节将介绍如何实现国际化站点,即如何 根据不同locale返回不同合适的内容。通过这三个小节的学习,我们将获得一个完整的i18n方案。 目录 目录 links links 目录 上一章: 第九章总结 下一节: 设置默认地区 216 10.1 设置默认地区 10.1 设置默认地区 什么是Locale 一部分,跟在一个句点之后,是可选的字符集说明符,例如"zh_CN.gb2312"表示中国使用gb2312字符集。 GO语言默认采用"UTF-8"编码集,所以我们实现i18n时不考虑第三部分,接下来我们都采用locale描述的前面两部分 来作为i18n标准的locale名。 在Linux和Solaris系统中可以通过locale -a命令列举所有支持的地区名,读者可以看到这些地区名的命名规范。 对于BS0 码力 | 295 页 | 5.91 MB | 1 年前3
Casdoor · An Open Source UI-first Identity Access Management (IAM) / Single-Sign-On (SSO) platform supporting OAuth 2.0, OIDC, SAML and CASCraco configuration file. You can change the theme color (blue by default) here crowdin.yml Crowdin i18n configuration file package.json NPM/Yarn dependency file yarn.lock Yarn lock file Inside the /src (dashboard page) for Casdoor, which contains several card widgets common Shared UI widgets locales i18n translation files in JSON, synced with our Crowdin project: https://crowdin.com/project/ casdoor-site For instance, signupUrl for variable names, Signup URL for UI. Ho How t w to Updat o Update i18n Data? e i18n Data? Please note that we use Crowdin as a translating platform and i18next as a translating0 码力 | 825 页 | 58.31 MB | 1 年前3
go web 框架 严清ErrBadRequest.WithMsgf(`invalid email: "%s"`, email) err := gear.Err.WithMsg("some error").WithStack() 还要⽀支持 i18n 的 errors 机制?没问题,参考 gear.Error 实现⼀一个,你⾏行行的! 集中、智能、灵活的异常处理理 Gear 框架⾃自定义 error 的响应 // 默认响应为 “appl0 码力 | 23 页 | 333.12 KB | 1 年前3
GoFrame框架介绍及设计技术体系化 • 开发规范化 • 组件统一化 • 形成技术沉淀 • 避免资源浪费 统一框架设计 统一框架设计-技术体系化 Container Converting Errors I18N Cache Validater Configure Server Logging ORM 这里的体系化是指微观层面的代码开发框架自顶向下统一 设计,使得整个框架的设计思想是一体的,而不是分散的。0 码力 | 37 页 | 8.84 MB | 1 年前3
共 5 条
- 1













