LanguageTag

*/-->

div.org-src-container {
font-size: 85%;
font-family: monospace;
}
pre.src {
background-color:#2e3436;
color:#fefffe;
}

p {font-size: 15px}
li {font-size: 15px}

Table of Contents

This is a memo of RFC 5646, ie BCP-47.

1 The Language Tag

Language tags are used to help identify languages, whether spoken,
written, signed, or otherwise signaled, for the purpose of
communication. This includes constructed and artificial languages
but excludes languages not intended primarily for human
communication, such as programming languages.

1.1 Syntax

  • TAG is composed from a sequence of one or more subtags
  • SubTags are sequence of alphanumric characters to narrow the range of languge.
  • SubTags are concated suing "-".

The syntax of the language tag in ABNF [RFC5234] is:

Language-Tag  = langtag             ; normal language tags
/ privateuse ; private use tag
/ grandfathered ; grandfathered tags langtag = language
["-" script]
["-" region]
*("-" variant)
*("-" extension)
["-" privateuse] language = *3ALPHA ; shortest ISO code
["-" extlang] ; sometimes followed by
; extended language subtags
/ 4ALPHA ; or reserved for future use
/ *8ALPHA ; or registered language subtag extlang = 3ALPHA ; selected ISO codes
*("-" 3ALPHA) ; permanently reserved script = 4ALPHA ; ISO code region = 2ALPHA ; ISO - code
/ 3DIGIT ; UN M. code variant = *8alphanum ; registered variants
/ (DIGIT 3alphanum) extension = singleton *("-" (*8alphanum)) ; Single alphanumerics
; "x" reserved for private use
singleton = DIGIT ; -
/ %x41- ; A - W
/ %x59-5A ; Y - Z
/ %x61- ; a - w
/ %x79-7A ; y - z privateuse = "x" *("-" (*8alphanum)) grandfathered = irregular ; non-redundant tags registered
/ regular ; during the RFC era irregular = "en-GB-oed" ; irregular tags do not match
/ "i-ami" ; the 'langtag' production and
/ "i-bnn" ; would not otherwise be
/ "i-default" ; considered 'well-formed'
/ "i-enochian" ; These tags are all valid,
/ "i-hak" ; but most are deprecated
/ "i-klingon" ; in favor of more modern
/ "i-lux" ; subtags or subtag
/ "i-mingo" ; combination
/ "i-navajo"
/ "i-pwn"
/ "i-tao"
/ "i-tay"
/ "i-tsu"
/ "sgn-BE-FR"
/ "sgn-BE-NL"
/ "sgn-CH-DE" regular = "art-lojban" ; these tags match the 'langtag'
/ "cel-gaulish" ; production, but their subtags
/ "no-bok" ; are not extended language
/ "no-nyn" ; or variant subtags: their meaning
/ "zh-guoyu" ; is defined by their registration
/ "zh-hakka" ; and all of these are deprecated
/ "zh-min" ; in favor of a more modern
/ "zh-min-nan" ; subtag or sequence of subtags
/ "zh-xiang" alphanum = (ALPHA / DIGIT) ; letters and numbers

Figure 1: Language Tag ABNF

Note:

1.1.1 Formatting of Languge Tags

Although tags should be case-insensitive, there are formatting conventions:

  • recommends that language codes be written in lowercase ('mn' Mongolian).
  • recommends that script codes use lowercase with the initial letter capitalized ('Cyrl' Cyrillic).
  • recommends that country codes be capitalized ('MN' Mongolia).

1.2 Language Subtag Sources and Interpretation

The namespace of language tags and their subtags is administered by
the Internet Assigned Numbers Authority (IANA) according to the rules
in Section 5 of this document. The Language Subtag Registry
maintained by IANA is the source for valid subtags: other standards
referenced in this section provide the source material for that
registry.

1.2.1 Primary Language Subtag

Should never be omitted in most cases, can be two or three characters.

LanguageTag的更多相关文章

  1. JS魔法堂:不完全国际化&本地化手册 之 理論篇

    前言  最近加入到新项目组负责前端技术预研和选型,其中涉及到一个熟悉又陌生的需求--国际化&本地化.熟悉的是之前的项目也玩过,陌生的是之前的实现仅仅停留在"有"的阶段而已. ...

  2. JS魔法堂:不完全国际化&本地化手册 之 实战篇

    前言  最近加入到新项目组负责前端技术预研和选型,其中涉及到一个熟悉又陌生的需求--国际化&本地化.熟悉的是之前的项目也玩过,陌生的是之前的实现仅仅停留在"有"的阶段而已. ...

  3. JS魔法堂:不完全国际化&本地化手册 之 拓展篇

    前言  最近加入到新项目组负责前端技术预研和选型,其中涉及到一个熟悉又陌生的需求--国际化&本地化.熟悉的是之前的项目也玩过,陌生的是之前的实现仅仅停留在"有"的阶段而已. ...

  4. Win10 UWP 开发系列:使用多语言工具包让应用支持多语言

    之前我在一篇blog中写过如何使用多语言工具包,见http://www.cnblogs.com/yanxiaodi/p/3800767.html 在WinEcos社区也发布过一篇详细的文章介绍多语言工 ...

  5. IIS 7 的 500 內部錯誤

    印象中這個有名的錯誤提示從 ASP 時代就已經存在 不是很明白微軟怎麼想的 你們所面對的客戶族群有為數不少的開發人員 除錯環境對開發者來說算是基本配備 為何不把這些相關設定做成「出廠預設值」? 都幾年 ...

  6. 在UWP应用中加入Cortana语音指令集

    本文介绍小娜语音指令集的使用场景,如何将UWP应用接入小娜的语音指令集,使用户直接通过小娜启动应用并使用应用中 一些轻量级的功能.文中以必应词典作为实例讲解必应词典UWP版本是如何接入小娜语音功能的. ...

  7. RFC-2068-http

    本文档规定了互联网社区的标准组协议,并需要讨论和建议以便更加完善.请参考 “互联网官方协议标准”(STD 1)来了解本协议的标准化状态.本协议不限流传发布. 版权声明 Copyright (C) Th ...

  8. 重新想象 Windows 8 Store Apps (57) - 本地化和全球化

    [源码下载] 重新想象 Windows 8 Store Apps (57) - 本地化和全球化 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 本地化和全球化 本地化 ...

  9. HTTP - 首部

    首部类型 首部类型 说明  通用首部   客户端和服务器都可以使用的通用首部.可以在客户端.服务器和其他应用程序之间提供一些有用的通用首部.  请求首部   请求首部时请求报文特有的.它们为服务器提供 ...

随机推荐

  1. ASP.NET MVC开发,编辑页面和添加页面基本相同,我们控制器 Add Edit是共用同一个View吗?

    http://q.cnblogs.com/q/51693/ 这种的话,一般公用就好了.,如下的写法: [HttpGet] public ActionResult UserManage(int user ...

  2. xampp+vscode开发php的配置流程

    一.所需文件 1.xampp集成服务器(个人使用7.1.7)https://www.apachefriends.org/download.html 2.vscode https://code.visu ...

  3. Dockerfile编写注意事项

    转载自:https://blog.fundebug.com/2017/05/15/write-excellent-dockerfile/ 一.目标 更快的构建速度 更小的Docker镜像大小 更少的D ...

  4. Python中hashlib模块

    介绍hashlib hashlib 是一个提供了一些流行的hash算法的 Python 标准库.其中所包括的算法有 md5, sha1, sha224, sha256, sha384, sha512. ...

  5. AVC的三种规格

    AVC其实就是H.264标准,是由ITU-T和ISO/IEC组成的联合视频组(JVT,Joint Video Team)一起开发的,ITU-T给这个标准命名为H.264(以前叫做H.26L),而ISO ...

  6. Docker容器加载宿主机的hosts解析

    前言 公司一直在用传统的tomcat下丢war包的架构体系,随着项目的增多.服务器数量的增多.需要为此花费很多时间在不同服务器的系统环境问题上.为了技术的与时俱进和工作的运维效率等方面,笔者引入doc ...

  7. Mac下配置环境变量(转)

    说明:Mac下一般使用bash作为默认shell 一.Mac系统的环境变量,加载顺序为: /etc/profile /etc/paths ~/.bash_profile ~/.bash_login ~ ...

  8. APScheduler定时执行外加supervisor管理后台运行

    最近写的天气爬虫想要让它在后台每天定时执行,一开始用的celery,但不知道为什么明明设置cron在某个时间运行,但任务却不间断的运行.无奈转用apscheduler,但是不管怎么设置都不能使得当调用 ...

  9. Javascript实现返回上一页面并刷新

    今天写了一个小小的提示成功的页面,同时要求返回上一页面,并实现对上一页面的操作进行刷新(例如删除的,添加的),在网上搜寻了一遍,基本上90%的都是说的是用window.history.go(-1), ...

  10. 【Foreign】tty的方程math [数学]

    tty的方程math Time Limit: 50 Sec  Memory Limit: 128 MB Description 给定n.m.k.p. a+b+c=n, a^2+b^2+c^2=m, a ...