Skip to content

Commit 5f794ab

Browse files
committed
adapt to en
1 parent 9873f8e commit 5f794ab

File tree

14 files changed

+62
-34
lines changed

14 files changed

+62
-34
lines changed

handlers/markup/templates/blocks/sidebar.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
+e.inner
77
+e.content
88
+e.section
9-
+e('h4').section-title Раздел
9+
+e('h4').section-title= t("Chapter")
1010
+e('a').link(href="#") Основы JavaScript
1111
+e.section
1212
+e('h4').section-title Навигация по уроку

handlers/nodejsScreencast/templates/index.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ block content
4646
+e("p").info Если вы где-то выкладываете этот скринкаст (торрент и т.п.), то обязательно давайте ссылку на эту страницу, так как все обновления и важные изменения я публикую здесь.
4747

4848
+b.share-icons
49-
+e('span').title Поделиться
49+
+e('span').title= t('Share')
5050
include /blocks/social-icons
5151

5252

handlers/render.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,11 @@ exports.init = function(app) {
231231
// /intro/ -> /intro
232232
loc.canonicalPath = loc.canonicalPath.replace(/\/+$/, '');
233233
}
234-
console.log(loc.canonicalPath);
234+
235235
loc.canonicalUrl = config.server.siteHost + loc.canonicalPath;
236236

237+
loc.disqusDomain = config.disqus.domain;
238+
237239
if (!/\.jade$/.test(templatePath)) {
238240
templatePath += '.jade';
239241
}

handlers/tutorial/controller/article.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ exports.get = function *get(next) {
3535
if (renderedArticle.isFolder) {
3636

3737
sections.push({
38-
title: t('Смежные разделы'),
38+
title: t('Sibling chapters'),
3939
links: renderedArticle.siblings
4040
});
4141

4242
} else {
4343

4444
sections.push({
45-
title: t('Раздел'),
45+
title: t('Chapter'),
4646
links: [renderedArticle.breadcrumbs[renderedArticle.breadcrumbs.length-1]]
4747
});
4848

@@ -59,7 +59,7 @@ exports.get = function *get(next) {
5959

6060
if (headerLinks.length) {
6161
sections.push({
62-
title: t('Навигация по уроку'),
62+
title: t('Lesson navigation'),
6363
links: headerLinks
6464
});
6565
}
@@ -75,13 +75,13 @@ exports.get = function *get(next) {
7575

7676
if (renderedArticle.tasks.length) {
7777
section2.links.push({
78-
title: 'Задачи (' + renderedArticle.tasks.length + ')',
78+
title: t('Tasks') +' (' + renderedArticle.tasks.length + ')',
7979
url: '#tasks'
8080
});
8181
}
8282

8383
section2.links.push({
84-
title: 'Комментарии',
84+
title: t('Comments'),
8585
url: '#comments'
8686
});
8787

handlers/tutorial/templates/article.jade

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ block content
2525

2626
+b.tasks
2727
+e('h2').title#tasks
28-
+e('a').title-anchor.main__anchor.main__anchor_noicon(href="#tasks") Задачи
28+
+e('a').title-anchor.main__anchor.main__anchor_noicon(href="#tasks")= t('Tasks')
2929

3030
each task, i in tasks
3131
+b.task.__task
@@ -37,8 +37,8 @@ block content
3737

3838
+e.header-note
3939
if task.importance
40-
+e('span').importance(title="Насколько эта задача важна для освоения материала, от 1 до 5") важность: #{task.importance}
41-
+e('button').solution(type="button") решение
40+
+e('span').importance(title=t("How important is the task, from 1 to 5")) #{t('importance')}: #{task.importance}
41+
+e('button').solution(type="button")= t('solution')
4242

4343
include _task_content
4444

handlers/tutorial/templates/sidebar.jade

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ each section in sidebar.sections
99
+e('a').link(href=link.url)= link.title
1010

1111
+e.section
12-
+e.section-title Поделиться
12+
+e.section-title= t('Share')
1313
+b('a').share._tw.sidebar__share(href="https://twitter.com/share?url="+encodeURIComponent(url.href))
1414
//- [] encoded as %5B %5D to make validator happy
1515
+b('a').share._fb.sidebar__share(href="https://www.facebook.com/sharer/sharer.php?s=100&p%5Burl%5D="+encodeURIComponent(url.href))
1616
+b('a').share._gp.sidebar__share(href="https://plus.google.com/share?url="+encodeURIComponent(url.href))
17-
+b('a').share._vk.sidebar__share(href="https://vkontakte.ru/share.php?url="+encodeURIComponent(url.href))
17+
if env.NODE_LANG=='ru'
18+
+b('a').share._vk.sidebar__share(href="https://vkontakte.ru/share.php?url="+encodeURIComponent(url.href))
1819

1920
+e.section
20-
+e('a').link(href="https://github.com/iliakan/javascript-tutorial") Редактировать на github
21+
+e('a').link(href="https://github.com/iliakan/javascript-tutorial/tree/" + env.NODE_LANG)= t('Edit on github')
2122

locales/ru/translation.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,27 @@
66
"firstname": "Илья",
77
"lastname": "Кантор"
88
},
9+
"Sibling chapters": "Смежные разделы",
10+
"Lesson navigation": "Навигация по уроку",
11+
"Tasks": "Задачи",
12+
"Comments": "Комментарии",
13+
"Share": "Поделиться",
14+
"read me before writing…": "перед тем как писать…",
15+
"You're welcome to post additions, questions to the articles and answers to them.": "Приветствуются комментарии, содержащие дополнения и вопросы по статье, и ответы на них.",
16+
"To insert a few words of code, use the <code>&lt;code&gt;</code> tag, for several lines – use <code>&lt;pre&gt;</code>, for more than 10 lines – use a sandbox (<a href='http://plnkr.co/edit/?p=preview'>plnkr</a>, <a href='http://jsbin.com'>JSBin</a>, <a href='http://codepen.io'>codepen</a>…)": "Для одной строки кода используйте тег <code>&lt;code&gt;</code>, для нескольких строк кода&nbsp;&mdash; тег <code>&lt;pre&gt;</code>, если больше 10 строк&nbsp;&mdash; ссылку на песочницу (<a href='http://plnkr.co/edit/?p=preview'>plnkr</a>, <a href='http://jsbin.com'>JSBin</a>, <a href='http://codepen.io'>codepen</a>…)",
17+
"If you can't understand something in the article – please elaborate.": "Если что-то непонятно в статье&nbsp;&mdash; пишите, что именно и с какого места.",
918
"Previous lesson": "Предыдущий урок",
19+
"Chapter": "Раздел",
20+
"Edit on github": "Редактировать на github",
21+
"How important is the task, from 1 to 5": "Насколько эта задача важна для освоения материала, от 1 до 5",
22+
"importance": "важность",
23+
"solution": "решение",
1024
"Next lesson": "Следующий урок",
25+
"Demo in the new window": "Демо в новом окне",
26+
"Run the demo": "Запустить демо",
27+
"Please note:": "На заметку:",
28+
"Important:" : "Важно:",
29+
"How do you think?": "Вопрос:",
1130
"sitetoolbar__logo_svg": "sitetoolbar__logo.svg",
1231
"sitetoolbar__logo_width": "171",
1332
"Sorry, the IE<10 is not supported, please use a newer browser.": "Извините, IE<10 не поддерживается, пожалуйста используйте более новый браузер."

modules/config/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
// production domain, for tutorial imports, descriptions, etc
2121
// for the places where in-dev we must use a real domain
2222
domain: {
23-
main: env.NODE_LANG == 'en' ? 'javascript.info' : 'learn.javascript.ru',
23+
main: env.NODE_LANG == 'en' ? 'learn.javascript.info' : 'learn.javascript.ru',
2424
static: env.NODE_LANG == 'en' ? 'en.js.cx' : 'js.cx'
2525
},
2626

@@ -89,6 +89,11 @@ module.exports = {
8989

9090
certDir: path.join(secret.dir, 'cert'),
9191

92+
disqus: {
93+
domain: process.env.NODE_LANG == 'en' ? 'javascriptinfo' : 'learnjavascriptru'
94+
},
95+
96+
9297
openexchangerates: {
9398
appId: secret.openexchangerates.appId
9499
},

modules/simpledownParser/consts.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ function arrToObj(arr) {
77
return result;
88
}
99

10+
1011
// Теги, которые допускаются НЕ в trusted-режиме
1112
var SAFE_TAGS = "a abbr acronym address em i b strong u strike cite blockquote code kbd tt ul ol li dl dt dd br hr pre img figure h1 h2 h3 h4 h5 h6 hgroup p div span sub sup table th td caption tr tbody thead tfoot".split(' ');
1213
var SAFE_TAGS_SET = arrToObj(SAFE_TAGS);
1314

15+
1416
// Теги, которые не нужно оборачивать в <p>
1517
var NO_WRAP_TAGS = "h1 h2 h3 h4 h5 h6 hgroup ol ul li dl dd dt p div footer header blockquote pre br hr canvas table td tr th tbody thead tfoot caption figure audio canvas embed iframe form fieldset script style object".split(" ");
1618
var NO_WRAP_TAGS_SET = arrToObj(NO_WRAP_TAGS);
@@ -39,9 +41,9 @@ var BBTAGS_SELF_CLOSE_SET = arrToObj(BBTAGS_SELF_CLOSE);
3941
var BBTAGS_ALL = BBTAGS_NEED_CLOSE.concat(BBTAGS_SELF_CLOSE);
4042

4143
var BBTAG_BLOCK_DEFAULT_TITLE = {
42-
smart: 'На заметку:',
43-
ponder: 'Вопрос:',
44-
warn: 'Важно:'
44+
smart: "Please note:",
45+
ponder: "How do you think?",
46+
warn: "Important:"
4547
};
4648

4749
var HREF_PROTOCOL_REG = /^([^\/#]*?)(?:\:|&#0*58|&#x0*3a)/;

modules/simpledownParser/parser/bbtagParser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = BbtagParser;
22

3+
var t = require('i18next').t;
34
var StringSet = require('../util/stringSet');
45
var Parser = require('./parser');
56
var BodyParser = require('./bodyParser');
@@ -180,7 +181,7 @@ BbtagParser.prototype.parseBlock = function() {
180181
content.push.apply(content, headerContent);
181182
content.push('</div>');
182183
} else {
183-
content.push('<span class="important__type">', consts.BBTAG_BLOCK_DEFAULT_TITLE[this.name], '</span>');
184+
content.push('<span class="important__type">', t(consts.BBTAG_BLOCK_DEFAULT_TITLE[this.name]), '</span>');
184185
}
185186

186187
content.push('</div>'); // ../important__header

0 commit comments

Comments
 (0)