Skip to content

Commit 5297164

Browse files
committed
doc-translate: partly transalted
1 parent f3f8262 commit 5297164

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

dev/src/docs/Reference.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export default class Reference {
295295
}
296296

297297
Reference.NONPRINTING_CHARS = {
298-
"0": "NULL",
298+
"0": "空(NULL",
299299
"1": "SOH",
300300
"2": "STX",
301301
"3": "ETX",
@@ -306,8 +306,8 @@ Reference.NONPRINTING_CHARS = {
306306
"8": "BS",
307307
"9": "TAB制表符", //
308308
"10": "LF换行符", //
309-
"11": "VERTICAL TAB",
310-
"12": "FORM FEED",
309+
"11": "纵向制表符(VERTICAL TAB",
310+
"12": "换页符(FROM FEED",
311311
"13": "CR换行符", //
312312
"14": "SO",
313313
"15": "SI",

dev/src/docs/reference_content.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ o.kids = [
5353
},
5454
{
5555
id:"range",
56+
label: "范围",
5657
tip:"匹配ASCII码从{{getChar(prev)}}到{{getChar(next)}}的字符 (ASCII码从 {{prev.code}} 到 {{next.code}})。 {{getInsensitive()}}",
5758
example:["[g-s]","abcdefghijklmnopqrstuvwxyz"],
5859
desc: "匹配ASCII码在指定范围区间的字符。",
@@ -68,13 +69,15 @@ o.kids = [
6869
},
6970
{
7071
id:"dot",
72+
label: "点",
7173
tip:"匹配任何字符{{getDotAll()}}.",
7274
desc:"匹配除换行符之外的任何字符。",
7375
ext:" 等价于 <code>[^\\n\\r]</code>.",
7476
example:[".", "glib jocks vex dwarves!"],
7577
token:"."
7678
},
7779
{
80+
id: "matchany",
7881
label:"完全通配",
7982
desc:"可以用来匹配所有字符,包括换行符,但是除了dotall标符(<code>s</code>)."+
8083
"<p>另外一种形式是<code>[^]</code>, 但是它不被所有浏览器支持</p>",
@@ -90,6 +93,7 @@ o.kids = [
9093
},
9194
{
9295
id:"word",
96+
label: "单词",
9397
desc:"匹配字母、数字、下划线。",
9498
ext:" 只匹配小ASCII码的字符(无声调字母或非罗马英文字符)。 等价于 <code>[A-Za-z0-9_]</code>",
9599
example:["\\w","bonjour, mon fr\u00E8re"],
@@ -105,6 +109,7 @@ o.kids = [
105109
},
106110
{
107111
id:"digit",
112+
label: "数字",
108113
desc:"匹配任意数字 (0-9).",
109114
ext:" 等价于 <code>[0-9]</code>.",
110115
example:["\\d","+1-(444)-555-1234"],
@@ -120,6 +125,7 @@ o.kids = [
120125
},
121126
{
122127
id:"whitespace",
128+
label: "空白字符",
123129
desc:"匹配任何空白字符。(空格, 制表符, 换行符)",
124130
example:["\\s", "glib jocks vex dwarves!"],
125131
token:"\\s"
@@ -207,7 +213,7 @@ o.kids = [
207213
},
208214

209215
{
210-
label:"Anchors",
216+
label:"锚定",
211217
id:"anchors",
212218
desc:"锚定类比较特殊,它匹配位置,而不是字符。",
213219
kids:[
@@ -402,6 +408,7 @@ o.kids = [
402408
},
403409
{
404410
id:"define",
411+
label: "定义",
405412
desc:"用来在不被匹配的情况下定义一个命名分组用作子过程。",
406413
ext:"<p>例如,<code>/A(?(DEFINE)(?'foo'Z))B\\g'foo'/</code> 会匹配到 <code>ABZ</code>,因为定义组在匹配中被忽略了,除非在子过程定义<code>foo</code>子过程,即例子中后方的<code>\\g'foo'</code>。 ",
407414
token:"(?(DEFINE)(?'foo'ABC))"
@@ -477,12 +484,14 @@ o.kids = [
477484
kids: [
478485
{
479486
id:"plus",
487+
label: "+",
480488
desc:"匹配1个或更多前面的标记。",
481489
example:["b\\w+","b be bee beer beers"],
482490
token:"+"
483491
},
484492
{
485493
id:"star",
494+
label: "*",
486495
desc:"匹配0个或更多前面的标记。",
487496
example:["b\\w*","b be bee beer beers"],
488497
token:"*"
@@ -507,6 +516,7 @@ o.kids = [
507516
},
508517
{
509518
id:"lazy",
519+
label: "慵懒",
510520
tip:"令前面的标记 {{getLazy()}}, 让其尽可能 {{getLazyFew()}} 地匹配字符。",
511521
desc:"令前面的标记变慵懒,让其尽可能少地匹配字符。",
512522
ext:"默认情况下,量词是贪婪的会尽可能多地匹配字符。",
@@ -515,6 +525,7 @@ o.kids = [
515525
},
516526
{
517527
id:"possessive",
528+
label: "占有型",
518529
desc:"令前面的量词贪婪,但不回溯。它会尽可能多地匹配字符,但不会为了匹配后面的标记而释放它。",
519530
ext:"<p>例如 <code>/.*a/</code> 会匹配到 <code>aaa</code>, 但 <code>/.*+a/</code> 则不会。因为重复的<code>.</code>会匹配、但不会为了匹配最后一个字符<code>a</code>而释放。</p>",
520531
token:"+"
@@ -537,11 +548,13 @@ o.kids = [
537548
kids: [
538549
{
539550
id:"comment",
551+
label: "注释",
540552
desc:"允许你在正则表达式中插入注释,匹配时候会被忽略。",
541553
token:"(?#foo)"
542554
},
543555
{
544556
id:"conditional",
557+
label: "条件语句",
545558
desc:"当满足前瞻条件后,从两个选项中选择一个匹配。",
546559
ext:"<p>例如, <code>/(?(?=a)ab|..)/</code> 会匹配 <code>ab</code> 和 <code>zx</code> 但不会匹配到 <code>ax</code>, 因为如果第一个字符满足条件 <code>a</code> 那么它就尝试匹配表达式 <code>ab</code>。</p>"+
547560
"<p>任何前瞻都可以用在这个条件上。前瞻会在条件开始的位置启动子序列的匹配过程。后顾则会在结束的位置启动。</p>",
@@ -558,14 +571,15 @@ o.kids = [
558571
},
559572
{
560573
id:"recursion",
574+
label: "回溯",
561575
desc:"在相同位置尝试匹配整个表达式。",
562576
ext:"<p>例如, <code>/a(?R)?z/</code> 会匹配到任意数量的 <code>a</code> 紧跟相同数量的 <code>z</code>: 匹配 <code>az</code> 单词或 <code>aaaazzzz</code>, 但不会匹配<code>azzz</code>。</p>"+
563577
"<p>可以用不同语法使用这个特性:</p><p><code>(?R)</code> <code>(?0)</code> <code>\\g<0></code> <code>\\g'0'</code></p>",
564578
token:"(?R)"
565579
},
566580
{
567581
id:"mode",
568-
label:"mode modifier",
582+
label:"模式修改符",
569583
tip:"{{~getDesc()}}{{~getModes()}}",
570584
desc:"对正则的余下部分启用或禁用模式。",
571585
ext:"模式对应于正则表达式的标识。 例如 <code>(?i)</code> 会对余下的正则启用大小写不敏感(即禁用大小写敏感)。"+
@@ -656,20 +670,23 @@ o.kids = [
656670
},
657671
{
658672
id:"multiline",
673+
label: "多行",
659674
tip:"使用起始/结尾锚(<b>^</b>/<b>$</b>)会匹配到行首和行尾。",
660675
desc:"当启用 multiline标识时,使用起始和结尾锚(<b>^</b> 和 <b>$</b>)会匹配到行首和行尾, 而不是整个字符串的头部和尾部。"+
661676
"<p>需要注意的是类似<code>/^[\\s\\S]+$/m</code>的正则可能会匹配到含有换行符的字符串。因为锚会匹配到<b>任意</b>行的起始/结束位置。</p>",
662677
token:"m"
663678
},
664679
{
665680
id:"unicode",
681+
label: "Unicode",
666682
tip:"启用<code>\\x{FFFFF}</code>Unicode转义。",
667683
desc:"当启用Unicode标识时,你可以按<code>\\x{FFFFF}</code>格式转义Unicode字符。"+
668684
"<p>这会使转义更严格,会对不能识别的转义字符 (例如 <code>\\j</code>) 报错。</p>",
669685
token:"u"
670686
},
671687
{
672688
id:"sticky",
689+
label: "粘连",
673690
desc:"只会从lastIndex位置开始匹配,且如果设置了全局标识(<code>g</code>)的话会被忽略。",
674691
ext:" 因为在RegExr的每次解析是独立的,该标识对已显示的内容没有任何影响。",
675692
token:"y"
@@ -718,19 +735,22 @@ o.misc = {
718735
},
719736
{
720737
id:"open",
738+
label: "表达式头",
721739
tip:"标记正则表达式起始位置。"
722740
},
723741
{
724742
id:"close",
743+
label: "表达式尾",
725744
tip:"标记正则表达式的结束位置和标识的起始位置。"
726745
},
727746
{
728747
id:"condition",
748+
label: "条件",
729749
tip:"The lookaround to match in resolving the enclosing conditional statement. 详情见参考手册中”条件“部分。"
730750
},
731751
{
732752
id:"conditionalelse",
733-
label:"conditional else",
753+
label:"else条件",
734754
tip:"区分条件中的else部分"
735755
},
736756
{

dev/src/docs/sidebar_content.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ home.kids = [
8383
label:"关于",
8484
desc:"RegExr v[build-version] ([build-date])."+
8585
"<p>由 <a href='http://twitter.com/gskinner/' target='_blank'>Grant Skinner</a> 和 <a href='http://gskinner.com/' target='_blank'>gskinner</a> 团队创建, 并使用了 <a href='http://createjs.com/' target='_blank'>CreateJS</a> & <a href='http://codemirror.net/' target='_blank'>CodeMirror</a> 库.</p>"+
86-
"<p>您可以在 <a href='http://github.com/gskinner/regexr/' target='_blank'>GitHub</a> 上提供反馈和记录bugs.</p>"
86+
"<p>由 <a href='https://github.com/skys215' target='_blank'>skys215</a> 和 <a href='https://github.com/yaoyuan4102' target='_blank'>yaoyuan4102</a> 翻译成中文。</p>"+
87+
"<p>您可以在 <a href='http://github.com/gskinner/regexr/' target='_blank'>GitHub</a> 上提供反馈和记录bugs.</p>" +
88+
"<p>您可以在 <a href='http://github.com/skys215/regexr/' target='_blank'>此GitHub</a> 上提供翻译纠正或建议。</p>"
8789
},
8890
{
8991
label:"开始",
@@ -171,7 +173,7 @@ home.kids = [
171173
"<li>老的浏览器不支持u 或者 y 元字符</li>"+
172174
"<li>在处理模棱两可的转义中的区别: \\8 \\9</li>"+
173175
"<li>Chrome在处理 \\x & \\u 转义时,和其他浏览器有细微差别</li>"+
174-
"<li>Chrome支持lookbehind, 但是它还没有在JS规范中</li>"+
176+
"<li>Chrome支持后行断言, 但是它还没有在JS规范中</li>"+
175177
"<li>Safari忽略了八进制转义中的前导零 (ex. \\00020)</li>"+
176178
"</ul></p>"
177179
},

0 commit comments

Comments
 (0)