-
Notifications
You must be signed in to change notification settings - Fork 4
/
162.txt
184 lines (132 loc) · 8.84 KB
/
162.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
[3] [[実体]]の[[言語]]を指定する[[頭欄]]です。元々 RFC 1766
で定義されていましたが、2002年5月末に新しい RFC 3282
により再定義されました。
- [8] [[HTTP]] も別途定義しています。
[[#comment]]
* ABNF
- [4] Content-Language = "Content-Language" ":" [CFWS] Language-List
- [5] Language-List = Language-Tag [CFWS] *("," [CFWS] Language-Tag [CFWS])
- [6] obs-content-language = "Content-Language" *WSP ":" [CFWS] Language-List
(RFC 1766 および RFC 3282 より作成)
[7] [VAR(ABNF)[language-tag]] は、 [[BCP]] 47 / [[RFC3066]]
が定義しています。 (See [[言語札]])
* 歴史
** RFC 1766
[REFS[
- [18] [CITE@en[RFC 1766 - Tags for the Identification of Languages]]
<http://tools.ietf.org/html/rfc1766#section-3>
]REFS]
[21] [[RFC 2130]] はこの [CODE(MIME)@en[[[Content-Language]]]] と同様の形式による[[自然言語]]の指定を他の[[プロトコル]]でも
(必要なら) 使うことが好ましいと述べています。
[FIG[
[20]
> The specification technique should be a MIME identifier
with IANA registered values for languages. If headers are used, the
header should be 'Content-Language'.
[FIGCAPTION[
[CITE@en[RFC 2130 - The Report of the IAB Character Set Workshop held 29 February - 1 March, 1996]] ([TIME[2011-09-04 12:12:00 +09:00]] 版) <http://tools.ietf.org/html/rfc2130#page-12>
]FIGCAPTION]
]FIG]
** HTTP
[FIG[
[FIGCAPTION[
RFC 1945 (HTTP/1.0) D.2.5; (HTTP/1.1) RFC 2068 14.13; RFC 2616 14.12 Content-Language
]FIGCAPTION]
> The Content-Language entity-header field describes the natural
language(s) of the intended audience for the enclosed entity. Note
that this [DEL[[INS[{1945,2068}]] may]] [INS[[INS[{2616}]] might]] not be equivalent to all the languages used within the entity[INS[-body [INS[{2068,2616}]]]].
[CODE(HTTP)[Content-Language]] 実体頭欄は、
囲まれた実体の想定視聴者の自然言語を記述します。
これは [CODE(ABNF)[[[entity-body]]]] 中で使われている全ての言語と等しくないかもしれないことに注意して下さい。
[INS[
> [INS[{2068,2616}]]
- Content-Language = "Content-Language" ":" 1#language-tag
> Language tags are defined in section 3.10. The primary purpose of
Content-Language is to allow a user to identify and differentiate
entities according to the user's own preferred language. Thus, if the
body content is intended only for a Danish-literate audience, the
appropriate field is
[[言語札]]は 3.10 節で定義しています。 [CODE(HTTP)[Content-Language]]
の主たる区的は、利用者が利用者自身の優先言語に従って実態を識別・差別化することを可能とすることにあります。
従って、本体内容がデンマーク語が分かる視聴者のみを想定しているのであれば、
適切な欄は
>
- Content-Language: da
> If no Content-Language is specified, the default is that the content
is intended for all language audiences. This [DEL[may]] [INS[might]] mean that the sender
does not consider it to be specific to any natural language, or that
the sender does not know for which language it is intended.
[CODE(HTTP)[Content-Language]] が指定されていなければ、既定値はその内容がすべての言語の視聴者を想定しているになります。
これは、送信者がそれが何らかの自然言語に特有のものであると考えていないか、
送信者がどの言語が想定されているのか知らないことを意味するでしょう。
> Multiple languages MAY be listed for content that is intended for
multiple audiences. For example, a rendition of the "Treaty of
Waitangi," presented simultaneously in the original Maori and English
versions, would call for
複数の視聴者を想定している内容については、複数の言語を列挙しても'''構いません'''。
例えば、 [SAMP[Treaty of Waitangi]] の翻訳で、
元のマオリ版と英語版が並行して示されているなら、
>
- Content-Language: mi, en
となるでしょう。
> However, just because multiple languages are present within an entity
does not mean that it is intended for multiple linguistic audiences.
An example would be a beginner's language primer, such as "A First
Lesson in Latin," which is clearly intended to be used by an
English-literate audience. In this case, the Content-Language [DEL[should]] [INS[would properly]]
only include "en".
しかし、ただ単に実体中に複数の言語が示されていることは複数の言語の視聴者を想定していることを意味しません。
例えば、初めての言語入門書, 例えば『A First Lesson in Latin』のような明らかに英語の分かる視聴者に使われることを意図したものを考えましょう。
この場合だと、 [CODE(HTTP)[Content-Language]] は [CODE(lang)[en]]
だけを含めるのが適当でしょう。
> Content-Language [DEL[may]] [INS[MAY]] be applied to any media type -- it is not
limited to textual documents.
[CODE(HTTP)[Content-Language]] はどの媒体型に適用しても'''かまいません'''。
文的文書には制限しません。
]INS]
* RFC の部分の License
[[RFCのライセンス]]
]FIG]
** RFC 3282
[REFS[
- [19] [CITE@en[RFC 3282 - Content Language Headers]]
<http://tools.ietf.org/html/rfc3282>
]REFS]
* [CODE(HTML)@en[<meta http-equiv=Content-Language>]]
** 不思議解釈
[14]
よく、 [[HTML文書]]に [CODE(HTML deprecated example)@en[<[[meta]] [[http-equiv]]="[[Content-Language]]" [[content]]="[[ja]]">]]
のように[[言語]]を指定すれば[[文字化け]]しなくなるなどと適当な解説がされていますが、'''まったく意味がありません'''。
[CODE(HTMLa)@en[[[http-equiv]]]] は本来[[鯖]]が解釈するものでしたが、
そうするように設定されている[[鯖]]はほとんどありません。
[[Webブラウザ]]が解釈することもありますが、
保障されているわけではありませんでした。
''本当の'' [[HTTP]] [[頭欄]]としての [CODE(HTTP)@en[[[Content-Language]]:]] を指定するか、
[[HTML]] の[[要素]]に [CODE(HTMLa)@en[[[lang]]]]
を指定するのが適切なやり方です。
;; いずれにしても、[[文字コード]]とはまったく関係ありません。
[[文字化け]]がなくなるなどと解説している[[文書]]は信用してはいけません。
**歴史
[15] [CITE@en[<meta http-equiv="Content-Language">]] ([[Ian Hickson]] 著, [TIME[2008-12-02 16:05:28 +09:00]] 版) <http://lists.w3.org/Archives/Public/public-html/2008Dec/0032.html>
[CODE(HTML)@en[<meta http-equiv=Content-Language>]] は不適合になりました。
[16] [CITE@en[(X)HTML5 Tracking]]
([TIME[2009-10-27 22:21:31 +09:00]] 版)
<http://html5.org/tools/web-apps-tracker?from=4336&to=4337>
[17] [CITE@en[Web Applications 1.0 r5980 8088]]
( ([TIME[2011-04-09 07:20:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5979&to=5980>
* メモ
- [9] [WEAK[2002-11-16 (土) 19:06]] ''[[名無しさん]]'': 関連して[[内容折衝]]に使われる対応する欄として、 [[Accept-Language:欄]]があります。
- [10] [WEAK[2002-11-16 (土) 19:08]] ''[[名無しさん]]'': 言語情報は転送[[プロトコル]]層に使われるこの欄ではなく、より上の層で記述されることもあります。 (例えば [[HTML]] の [[lang属性]]や [[XML]] の [[xml:lang属性]], あるいは [[Unicode]] の[[14面言語タグ]], [[ファイル名]]の一部など。) どれを使うのが適切かは、その場面によるでしょう。
- [11] >>10 [[言語情報]]
- [12] この欄って使われてるのかなあ? MIME にしろ HTTP にしろ有意義に使われてるのって見たことなくない?
- [13] 欄自体は、 MIME ではたまにしか見ないけど、 HTTP では [[Apache]] とかで内容折衝に使う関係で、ちゃんと設定されてることも少なくないよね。情報提供側はまあまあいけてるけど、実際に応用側ではどうだろう。。。
[22] [CITE@en[Web Applications 1.0 r7283 Change Content-Language pragma to obeying the last pragma, not the first, as this is closer to what Firefox, IE9, and WebKit do.]]
( ([TIME[2012-08-28 04:32:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7282&to=7283>
[23] [CITE@en[Web Applications 1.0 r8389 Mention that the content-language pragma intentionally ignores words after the first (hopefully browsers end up matching this... they vary in their behaviour today)]]
( ([TIME[2014-01-10 04:19:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8388&to=8389>
[24] [CITE[IRC logs: freenode / #whatwg / 20140115]]
( ([TIME[2014-01-16 20:18:06 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140115#l-249>