summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2016-08-19 11:49:24 +0800
committerWu Cheng-Han2016-08-19 11:49:24 +0800
commitb9c59c454d68e35708f64703a423930b99075cab (patch)
tree35afc40b67c86c17d291b482cd52ae2417c82fb3
parent87f4d05e8e8f36ac276cd85601cabc1fbb7efc2c (diff)
Add support of i18n with related patches and support "en" and "zh" locales for now
-rw-r--r--app.js11
-rw-r--r--locales/en.json104
-rw-r--r--locales/zh.json104
-rw-r--r--package.json1
-rw-r--r--public/css/cover.css4
-rw-r--r--public/js/cover.js2
-rw-r--r--public/js/locale.js24
-rw-r--r--public/views/body.ejs60
-rw-r--r--public/views/header.ejs52
-rw-r--r--public/views/help-modal.ejs76
-rw-r--r--public/views/index.ejs69
-rw-r--r--public/views/refresh-modal.ejs18
-rw-r--r--public/views/revision-modal.ejs8
-rw-r--r--public/views/signin-modal.ejs14
14 files changed, 400 insertions, 147 deletions
diff --git a/app.js b/app.js
index c0985761..04172b80 100644
--- a/app.js
+++ b/app.js
@@ -16,6 +16,7 @@ var formidable = require('formidable');
var morgan = require('morgan');
var passportSocketIo = require("passport.socketio");
var helmet = require('helmet');
+var i18n = require('i18n');
//core
var config = require("./lib/config.js");
@@ -92,6 +93,16 @@ app.use(helmet.hsts({
preload: true
}));
+i18n.configure({
+ locales: ['en', 'zh'],
+ cookie: 'locale',
+ directory: __dirname + '/locales'
+});
+
+app.use(cookieParser());
+
+app.use(i18n.init);
+
// routes without sessions
// static files
app.use('/', express.static(__dirname + '/public', { maxAge: config.staticcachetime }));
diff --git a/locales/en.json b/locales/en.json
new file mode 100644
index 00000000..f1f0d140
--- /dev/null
+++ b/locales/en.json
@@ -0,0 +1,104 @@
+{
+ "Collaborative markdown notes": "Collaborative markdown notes",
+ "Realtime collaborative markdown notes on all platforms.": "Realtime collaborative markdown notes on all platforms.",
+ "Best way to write and share your knowledge in markdown.": "Best way to write and share your knowledge in markdown.",
+ "Intro": "Intro",
+ "History": "History",
+ "New guest note": "New guest note",
+ "Collaborate with URL": "Collaborate with URL",
+ "Support charts and MathJax": "Support charts and MathJax",
+ "Support slide mode": "Support slide mode",
+ "Sign In": "Sign In",
+ "Below is the history from browser": "Below is the history from browser",
+ "Welcome!": "Welcome!",
+ "New note": "New note",
+ "or": "or",
+ "Sign Out": "Sign Out",
+ "Explore all features": "Explore all features",
+ "Select tags...": "Select tags...",
+ "Search keyword...": "Search keyword...",
+ "Sort by title": "Sort by title",
+ "Title": "Title",
+ "Sort by time": "Sort by time",
+ "Time": "Time",
+ "Export history": "Export history",
+ "Import history": "Import history",
+ "Clear history": "Clear history",
+ "Refresh history": "Refresh history",
+ "No history": "No history",
+ "Import from browser": "Import from browser",
+ "Releases": "Releases",
+ "Are you sure?": "Are you sure?",
+ "Cancel": "Cancel",
+ "Yes, do it!": "Yes, do it!",
+ "Choose method": "Choose method",
+ "Sign in via %s": "Sign in via %s",
+ "New": "New",
+ "Publish": "Publish",
+ "Extra": "Extra",
+ "Revision": "Revision",
+ "Slide Mode": "Slide Mode",
+ "Export": "Export",
+ "Import": "Import",
+ "Clipboard": "Clipboard",
+ "Download": "Download",
+ "Raw HTML": "Raw HTML",
+ "Edit": "Edit",
+ "View": "View",
+ "Both": "Both",
+ "Help": "Help",
+ "Upload Image": "Upload Image",
+ "Menu": "Menu",
+ "This page need refresh": "This page need refresh",
+ "You have an incompatible client version.": "You have an incompatible client version.",
+ "Refresh to update.": "Refresh to update.",
+ "New version available!": "New version available!",
+ "See releases notes here": "See releases notes here",
+ "Refresh to enjoy new features.": "Refresh to enjoy new features.",
+ "Your user state has changed.": "Your user state has changed.",
+ "Refresh to load new user state.": "Refresh to load new user state.",
+ "Refresh": "Refresh",
+ "Contacts": "Contacts",
+ "Report an issue": "Report an issue",
+ "Send us email": "Send us email",
+ "Documents": "Documents",
+ "Features": "Features",
+ "YAML Metadata": "YAML Metadata",
+ "Slide Example": "Slide Example",
+ "Cheatsheet": "Cheatsheet",
+ "Example": "Example",
+ "Syntax": "Syntax",
+ "Header": "Header",
+ "Unordered List": "Unordered List",
+ "Ordered List": "Ordered List",
+ "Todo List": "Todo List",
+ "Blockquote": "Blockquote",
+ "Bold font": "Bold font",
+ "Italics font": "Italics font",
+ "Strikethrough": "Strikethrough",
+ "Inserted text": "Inserted text",
+ "Marked text": "Marked text",
+ "Link": "Link",
+ "Image": "Image",
+ "Code": "Code",
+ "Externals": "Externals",
+ "This is a alert area.": "This is a alert area.",
+ "Revert": "Revert",
+ "Import from clipboard": "Import from clipboard",
+ "Paste your markdown or webpage here...": "Paste your markdown or webpage here...",
+ "Clear": "Clear",
+ "This note is locked": "This note is locked",
+ "Sorry, only owner can edit this note.": "Sorry, only owner can edit this note.",
+ "OK": "OK",
+ "Reach the limit": "Reach the limit",
+ "Sorry, you've reached the max length this note can be.": "Sorry, you've reached the max length this note can be.",
+ "Please reduce the content or divide it to more notes, thank you!": "Please reduce the content or divide it to more notes, thank you!",
+ "Import from Gist": "Import from Gist",
+ "Paste your gist url here...": "Paste your gist url here...",
+ "Import from Snippet": "Import from Snippet",
+ "Select From Available Projects": "Select From Available Projects",
+ "Select From Available Snippets": "Select From Available Snippets",
+ "OR": "OR",
+ "Export to Snippet": "Export to Snippet",
+ "Select Visibility Level": "Select Visibility Level"
+} \ No newline at end of file
diff --git a/locales/zh.json b/locales/zh.json
new file mode 100644
index 00000000..a3bb7774
--- /dev/null
+++ b/locales/zh.json
@@ -0,0 +1,104 @@
+{
+ "Collaborative markdown notes": "Markdown 協作筆記",
+ "Realtime collaborative markdown notes on all platforms.": "使用 Markdown 的跨平台即時協作筆記",
+ "Best way to write and share your knowledge in markdown.": "您使用 Markdown 寫作與分享知識的最佳方式",
+ "Intro": "簡介",
+ "History": "紀錄",
+ "New guest note": "建立訪客筆記",
+ "Collaborate with URL": "使用網址協作",
+ "Support charts and MathJax": "支援圖表與 MathJax",
+ "Support slide mode": "支援簡報模式",
+ "Sign In": "登入",
+ "Below is the history from browser": "以下為來自瀏覽器的紀錄",
+ "Welcome!": "歡迎!",
+ "New note": "建立筆記",
+ "or": "或",
+ "Sign Out": "登出",
+ "Explore all features": "探索所有功能",
+ "Select tags...": "選擇標籤...",
+ "Search keyword...": "搜尋關鍵字...",
+ "Sort by title": "用標題排序",
+ "Title": "標題",
+ "Sort by time": "用時間排序",
+ "Time": "時間",
+ "Export history": "匯出紀錄",
+ "Import history": "匯入紀錄",
+ "Clear history": "清空紀錄",
+ "Refresh history": "更新紀錄",
+ "No history": "沒有紀錄",
+ "Import from browser": "從瀏覽器匯入",
+ "Releases": "版本",
+ "Are you sure?": "你確定嗎?",
+ "Cancel": "取消",
+ "Yes, do it!": "沒錯,就這樣辦!",
+ "Choose method": "選擇方式",
+ "Sign in via %s": "透過 %s 登入",
+ "New": "新增",
+ "Publish": "發表",
+ "Extra": "增益",
+ "Revision": "修訂版本",
+ "Slide Mode": "簡報模式",
+ "Export": "匯出",
+ "Import": "匯入",
+ "Clipboard": "剪貼簿",
+ "Download": "下載",
+ "Raw HTML": "純 HTML",
+ "Edit": "編輯",
+ "View": "檢視",
+ "Both": "雙欄",
+ "Help": "協助",
+ "Upload Image": "上傳圖片",
+ "Menu": "選單",
+ "This page need refresh": "此頁面需要重新整理",
+ "You have an incompatible client version.": "您使用的是不相容的客戶端",
+ "Refresh to update.": "請重新整理來更新",
+ "New version available!": "新版本來了!",
+ "See releases notes here": "請由此查閱更新紀錄",
+ "Refresh to enjoy new features.": "請重新整理來享受最新功能",
+ "Your user state has changed.": "您的使用者狀態已變更",
+ "Refresh to load new user state.": "請重新整理來載入新的使用者狀態",
+ "Refresh": "重新整理",
+ "Contacts": "聯絡方式",
+ "Report an issue": "回報問題",
+ "Send us email": "寄信給我們",
+ "Documents": "文件",
+ "Features": "功能簡介",
+ "YAML Metadata": "YAML Metadata",
+ "Slide Example": "簡報範例",
+ "Cheatsheet": "快速簡表",
+ "Example": "範例",
+ "Syntax": "語法",
+ "Header": "標題",
+ "Unordered List": "無序清單",
+ "Ordered List": "有序清單",
+ "Todo List": "待辦事項",
+ "Blockquote": "引用",
+ "Bold font": "粗體",
+ "Italics font": "斜體",
+ "Strikethrough": "刪除線",
+ "Inserted text": "插入文字",
+ "Marked text": "標記文字",
+ "Link": "連結",
+ "Image": "圖片",
+ "Code": "程式碼",
+ "Externals": "外部",
+ "This is a alert area.": "這是警告區塊",
+ "Revert": "還原",
+ "Import from clipboard": "從剪貼簿匯入",
+ "Paste your markdown or webpage here...": "在這裡貼上 Markdown 或是網頁內容...",
+ "Clear": "清除",
+ "This note is locked": "此份筆記已被鎖定",
+ "Sorry, only owner can edit this note.": "抱歉,只有擁有者可以編輯此筆記",
+ "OK": "好的",
+ "Reach the limit": "到達上限",
+ "Sorry, you've reached the max length this note can be.": "抱歉,您已使用到此份筆記可用的最大長度",
+ "Please reduce the content or divide it to more notes, thank you!": "請減少內容或是將內容切成更多筆記,謝謝!",
+ "Import from Gist": "從 Gist 匯入",
+ "Paste your gist url here...": "在這裡貼上 gist 網址...",
+ "Import from Snippet": "從 Snippet 匯入",
+ "Select From Available Projects": "從可用的專案中選擇",
+ "Select From Available Snippets": "從可用的 Snippets 中選擇",
+ "OR": "或是",
+ "Export to Snippet": "匯出到 Snippet",
+ "Select Visibility Level": "選擇可見層級"
+} \ No newline at end of file
diff --git a/package.json b/package.json
index 80042412..94b08eac 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,7 @@
"formidable": "^1.0.17",
"helmet": "^2.1.2",
"highlight.js": "^9.5.0",
+ "i18n": "^0.8.3",
"imgur": "git+https://github.com/hackmdio/node-imgur.git",
"jsdom-nogyp": "^0.8.3",
"lz-string": "1.4.4",
diff --git a/public/css/cover.css b/public/css/cover.css
index bde3ec7c..ca0c6027 100644
--- a/public/css/cover.css
+++ b/public/css/cover.css
@@ -329,6 +329,10 @@ input {
vertical-align: middle !important;
}
+select {
+ color: black;
+}
+
@media (max-width: 768px) {
span.ui-or {
display: block;
diff --git a/public/js/cover.js b/public/js/cover.js
index c97bd256..f3533826 100644
--- a/public/js/cover.js
+++ b/public/js/cover.js
@@ -291,7 +291,7 @@ $(".ui-logout").click(function () {
var filtertags = [];
$(".ui-use-tags").select2({
- placeholder: 'Select tags...',
+ placeholder: $(".ui-use-tags").attr('placeholder'),
multiple: true,
data: function () {
return {
diff --git a/public/js/locale.js b/public/js/locale.js
new file mode 100644
index 00000000..6fe7fdb6
--- /dev/null
+++ b/public/js/locale.js
@@ -0,0 +1,24 @@
+var lang = "en";
+var userLang = navigator.language || navigator.userLanguage;
+var userLangCode = userLang.split('-')[0];
+var userCountryCode = userLang.split('-')[1];
+var locale = $('.ui-locale');
+var supportLangs = [];
+$(".ui-locale option").each(function() {
+ supportLangs.push($(this).val());
+});
+if (Cookies.get('locale')) {
+ lang = Cookies.get('locale');
+} else if (supportLangs.indexOf(userLang) !== -1) {
+ lang = supportLangs[supportLangs.indexOf(userLang)];
+} else if (supportLangs.indexOf(userLangCode) !== -1) {
+ lang = supportLangs[supportLangs.indexOf(userLangCode)];
+}
+
+locale.val(lang);
+locale.change(function() {
+ Cookies.set('locale', $(this).val(), {
+ expires: 365
+ });
+ window.location.reload();
+}); \ No newline at end of file
diff --git a/public/views/body.ejs b/public/views/body.ejs
index acf929ad..28680e49 100644
--- a/public/views/body.ejs
+++ b/public/views/body.ejs
@@ -43,15 +43,15 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="myModalLabel">Import from clipboard</h4>
+ <h4 class="modal-title" id="myModalLabel"><%= __('Import from clipboard') %></h4>
</div>
<div class="modal-body">
- <div contenteditable data-ph="Paste your markdown or webpage here..." id="clipboardModalContent" style="overflow:auto;max-height:50vh"></div>
+ <div contenteditable data-ph="<%= __('Paste your markdown or webpage here...') %>" id="clipboardModalContent" style="overflow:auto;max-height:50vh"></div>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-danger" id="clipboardModalClear">Clear</button>
- <button type="button" class="btn btn-primary" id="clipboardModalConfirm">Import</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
+ <button type="button" class="btn btn-danger" id="clipboardModalClear"><%= __('Clear') %></button>
+ <button type="button" class="btn btn-primary" id="clipboardModalConfirm"><%= __('Import') %></button>
</div>
</div>
</div>
@@ -63,13 +63,13 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="myModalLabel"><i class="fa fa-lock"></i> This note is locked</h4>
+ <h4 class="modal-title" id="myModalLabel"><i class="fa fa-lock"></i> <%= __('This note is locked') %></h4>
</div>
<div class="modal-body" style="color:black;">
- <h5>Sorry, only owner can edit this note.</h5>
+ <h5><%= __('Sorry, only owner can edit this note.') %></h5>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-danger" data-dismiss="modal">OK</button>
+ <button type="button" class="btn btn-danger" data-dismiss="modal"><%= __('OK') %></button>
</div>
</div>
</div>
@@ -81,14 +81,14 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="myModalLabel"><i class="fa fa-exclamation-triangle"></i> Reach the limit</h4>
+ <h4 class="modal-title" id="myModalLabel"><i class="fa fa-exclamation-triangle"></i> <%= __('Reach the limit') %></h4>
</div>
<div class="modal-body" style="color:black;">
- <h5>Sorry, you've reached the max length this note can be.</h5>
- <strong>Please reduce the content or divide it to more notes, thank you!</strong>
+ <h5><%= __("Sorry, you've reached the max length this note can be.") %></h5>
+ <strong><%= __('Please reduce the content or divide it to more notes, thank you!') %></strong>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-warning" data-dismiss="modal">OK</button>
+ <button type="button" class="btn btn-warning" data-dismiss="modal"><%= __('OK') %></button>
</div>
</div>
</div>
@@ -107,7 +107,7 @@
<a target="_blank" style="word-break: break-all;"></a>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('OK') %></button>
</div>
</div>
</div>
@@ -119,15 +119,15 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="myModalLabel">Import from Gist</h4>
+ <h4 class="modal-title" id="myModalLabel"><%= __('Import from Gist') %></h4>
</div>
<div class="modal-body">
- <input type="url" class="form-control" placeholder="Paste your gist url here... (like: https://gist.github.com/username/gistid)" id="gistImportModalContent">
+ <input type="url" class="form-control" placeholder="<%= __('Paste your gist url here...') %> (like: https://gist.github.com/username/gistid)" id="gistImportModalContent">
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-danger" id="gistImportModalClear">Clear</button>
- <button type="button" class="btn btn-primary" id="gistImportModalConfirm">Import</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
+ <button type="button" class="btn btn-danger" id="gistImportModalClear"><%= __('Clear') %></button>
+ <button type="button" class="btn btn-primary" id="gistImportModalConfirm"><%= __('Import') %></button>
</div>
</div>
</div>
@@ -139,7 +139,7 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="myModalLabel">Import from Snippet</h4>
+ <h4 class="modal-title" id="myModalLabel"><%= __('Import from Snippet') %></h4>
</div>
<div class="modal-body">
<input type="hidden" id="snippetImportModalAccessToken" />
@@ -148,24 +148,24 @@
<div style="display:table-row;margin-bottom:5px;">
<label style="display:table-cell;">Project:</label>
<select class="form-control" id="snippetImportModalProjects" style="display:table-cell;" disabled="disabled">
- <option value="init" selected="selected" disabled="disabled">Select From Available Projects</option>
+ <option value="init" selected="selected" disabled="disabled"><%= __('Select From Available Projects') %></option>
</select>
</div>
<div style="display:table-row;">
<label style="display:table-cell;">Snippet</label>
<select class="form-control" id="snippetImportModalSnippets" style="display:table-cell;" disabled="disabled">
- <option value="init" selected="selected" disabled="disabled">Select From Available Snippets</option>
+ <option value="init" selected="selected" disabled="disabled"><%= __('Select From Available Snippets') %></option>
</select>
</div>
</div>
- <p class="snippet-import-or">OR</p>
+ <p class="snippet-import-or"><%= __('OR') %></p>
<input type="url" class="form-control" placeholder="/projects/:id/snippets/:snippet_id" id="snippetImportModalContent" disabled="disabled">
</div>
<div class="modal-footer">
<span id="snippetImportModalLoading"><i class="fa fa-refresh fa-spin fa-fw"></i></span>
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-danger" id="snippetImportModalClear">Clear</button>
- <button type="button" class="btn btn-primary" id="snippetImportModalConfirm" disabled="disabled">Import</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
+ <button type="button" class="btn btn-danger" id="snippetImportModalClear"><%= __('Clear') %></button>
+ <button type="button" class="btn btn-primary" id="snippetImportModalConfirm" disabled="disabled"><%= __('Import') %></button>
</div>
</div>
</div>
@@ -177,7 +177,7 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="myModalLabel">Export to Snippet</h4>
+ <h4 class="modal-title" id="myModalLabel"><%= __('Export to Snippet') %></h4>
</div>
<div class="modal-body">
<input type="hidden" id="snippetExportModalAccessToken" />
@@ -194,13 +194,13 @@
<div style="display:table-row;margin-bottom:5px;">
<label style="display:table-cell;">Project:</label>
<select class="form-control" id="snippetExportModalProjects" style="display:table-cell;">
- <option value="init" selected="selected" disabled="disabled">Select From Available Projects</option>
+ <option value="init" selected="selected" disabled="disabled"><%= __('Select From Available Projects') %></option>
</select>
</div>
<div style="display:table-row;margin-bottom:5px;">
<label style="display:table-cell;">Visibility:</label>
<select class="form-control" id="snippetExportModalVisibility" style="display:table-cell;">
- <option value="" selected="selected" disabled="disabled">Select Visibility Level</option>
+ <option value="" selected="selected" disabled="disabled"><%= __('Select Visibility Level') %></option>
<option value="0">Private</option>
<option value="10">Internal</option>
</select>
@@ -209,8 +209,8 @@
</div>
<div class="modal-footer">
<span id="snippetExportModalLoading"><i class="fa fa-refresh fa-spin fa-fw"></i></span>
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-primary" id="snippetExportModalConfirm">Export</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
+ <button type="button" class="btn btn-primary" id="snippetExportModalConfirm"><%= __('Export') %></button>
</div>
</div>
</div>
diff --git a/public/views/header.ejs b/public/views/header.ejs
index 67760665..d2b1ec1e 100644
--- a/public/views/header.ejs
+++ b/public/views/header.ejs
@@ -22,18 +22,18 @@
<i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu list" role="menu" aria-labelledby="menu">
- <li role="presentation"><a role="menuitem" class="ui-new" tabindex="-1" href="<%- url %>/new" target="_blank"><i class="fa fa-plus fa-fw"></i> New</a>
+ <li role="presentation"><a role="menuitem" class="ui-new" tabindex="-1" href="<%- url %>/new" target="_blank"><i class="fa fa-plus fa-fw"></i> <%= __('New') %></a>
</li>
- <li role="presentation"><a role="menuitem" class="ui-publish" tabindex="-1" href="#" target="_blank"><i class="fa fa-print fa-fw"></i> Publish</a>
+ <li role="presentation"><a role="menuitem" class="ui-publish" tabindex="-1" href="#" target="_blank"><i class="fa fa-print fa-fw"></i> <%= __('Publish') %></a>
</li>
<li class="divider"></li>
- <li class="dropdown-header">Extra</li>
- <li role="presentation"><a role="menuitem" class="ui-extra-revision" tabindex="-1" data-toggle="modal" data-target="#revisionModal"><i class="fa fa-history fa-fw"></i> Revision</a>
+ <li class="dropdown-header"><%= __('Extra') %></li>
+ <li role="presentation"><a role="menuitem" class="ui-extra-revision" tabindex="-1" data-toggle="modal" data-target="#revisionModal"><i class="fa fa-history fa-fw"></i> <%= __('Revision') %></a>
</li>
- <li role="presentation"><a role="menuitem" class="ui-extra-slide" tabindex="-1" href="#" target="_blank"><i class="fa fa-tv fa-fw"></i> Slide Mode</a>
+ <li role="presentation"><a role="menuitem" class="ui-extra-slide" tabindex="-1" href="#" target="_blank"><i class="fa fa-tv fa-fw"></i> <%= __('Slide Mode') %></a>
</li>
<li class="divider"></li>
- <li class="dropdown-header">Export</li>
+ <li class="dropdown-header"><%= __('Export') %></li>
<li role="presentation"><a role="menuitem" class="ui-save-dropbox" tabindex="-1" href="#" target="_self"><i class="fa fa-dropbox fa-fw"></i> Dropbox</a>
</li>
<li role="presentation"><a role="menuitem" class="ui-save-google-drive" tabindex="-1" href="#" target="_self"><i class="fa fa-cloud-upload fa-fw"></i> Google Drive</a>
@@ -47,7 +47,7 @@
</li>
<% } %>
<li class="divider"></li>
- <li class="dropdown-header">Import</li>
+ <li class="dropdown-header"><%= __('Import') %></li>
<li role="presentation"><a role="menuitem" class="ui-import-dropbox" tabindex="-1" href="#" target="_self"><i class="fa fa-dropbox fa-fw"></i> Dropbox</a>
</li>
<li role="presentation"><a role="menuitem" class="ui-import-google-drive" tabindex="-1" href="#" target="_self"><i class="fa fa-cloud-download fa-fw"></i> Google Drive</a>
@@ -58,15 +58,15 @@
<li role="presentation"><a role="menuitem" class="ui-import-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a>
</li>
<% } %>
- <li role="presentation"><a role="menuitem" class="ui-import-clipboard" href="#" data-toggle="modal" data-target="#clipboardModal"><i class="fa fa-clipboard fa-fw"></i> Clipboard</a>
+ <li role="presentation"><a role="menuitem" class="ui-import-clipboard" href="#" data-toggle="modal" data-target="#clipboardModal"><i class="fa fa-clipboard fa-fw"></i> <%= __('Clipboard') %></a>
</li>
<li class="divider"></li>
- <li class="dropdown-header">Download</li>
+ <li class="dropdown-header"><%= __('Download') %></li>
<li role="presentation"><a role="menuitem" class="ui-download-markdown" tabindex="-1" href="#" target="_self"><i class="fa fa-file-text fa-fw"></i> Markdown</a>
</li>
<li role="presentation"><a role="menuitem" class="ui-download-html" tabindex="-1" href="#" target="_self"><i class="fa fa-file-code-o fa-fw"></i> HTML</a>
</li>
- <li role="presentation"><a role="menuitem" class="ui-download-raw-html" tabindex="-1" href="#" target="_self"><i class="fa fa-file-code-o fa-fw"></i> Raw HTML</a>
+ <li role="presentation"><a role="menuitem" class="ui-download-raw-html" tabindex="-1" href="#" target="_self"><i class="fa fa-file-code-o fa-fw"></i> <%= __('Raw HTML') %></a>
</li>
<li role="presentation"><a role="menuitem" class="ui-download-pdf-beta" tabindex="-1" href="#" target="_self"><i class="fa fa-file-pdf-o fa-fw"></i> PDF (Beta)</a>
</li>
@@ -82,20 +82,20 @@
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-form navbar-left" style="padding:0;">
<div class="btn-group" data-toggle="buttons">
- <label class="btn btn-default ui-edit" title="Edit">
+ <label class="btn btn-default ui-edit" title="<%= __('Edit') %>">
<input type="radio" name="mode" autocomplete="off"><i class="fa fa-edit"></i>
</label>
- <label class="btn btn-default ui-view" title="View">
+ <label class="btn btn-default ui-view" title="<%= __('View') %>">
<input type="radio" name="mode" autocomplete="off"><i class="fa fa-eye"></i>
</label>
- <label class="btn btn-default ui-both" title="Both">
+ <label class="btn btn-default ui-both" title="<%= __('Both') %>">
<input type="radio" name="mode" autocomplete="off"><i class="fa fa-columns"></i>
</label>
</div>
- <span class="btn btn-link btn-file ui-help" title="Help" data-toggle="modal" data-target=".help-modal">
+ <span class="btn btn-link btn-file ui-help" title="<%= __('Help') %>" data-toggle="modal" data-target=".help-modal">
<i class="fa fa-question-circle"></i>
</span>
- <span class="btn btn-link btn-file ui-upload-image" title="Upload Image" style="display:none;">
+ <span class="btn btn-link btn-file ui-upload-image" title="<%= __('Upload Image') %>" style="display:none;">
<i class="fa fa-camera"></i><input type="file" accept="image/*" name="upload" multiple>
</span>
</ul>
@@ -111,26 +111,26 @@
<ul class="nav navbar-nav navbar-right" style="padding:0;">
<li>
<a href="<%- url %>/new" target="_blank" class="ui-new">
- <i class="fa fa-plus"></i> New
+ <i class="fa fa-plus"></i> <%= __('New') %>
</a>
</li>
<li>
<a href="#" target="_blank" class="ui-publish">
- <i class="fa fa-print"></i> Publish
+ <i class="fa fa-print"></i> <%= __('Publish') %>
</a>
</li>
<li>
<a data-toggle="dropdown">
- Menu <i class="fa fa-caret-down"></i>
+ <%= __('Menu') %> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu list" role="menu" aria-labelledby="menu">
- <li class="dropdown-header">Extra</li>
- <li role="presentation"><a role="menuitem" class="ui-extra-revision" tabindex="-1" data-toggle="modal" data-target="#revisionModal"><i class="fa fa-history fa-fw"></i> Revision</a>
+ <li class="dropdown-header"><%= __('Extra') %></li>
+ <li role="presentation"><a role="menuitem" class="ui-extra-revision" tabindex="-1" data-toggle="modal" data-target="#revisionModal"><i class="fa fa-history fa-fw"></i> <%= __('Revision') %></a>
</li>
- <li role="presentation"><a role="menuitem" class="ui-extra-slide" tabindex="-1" href="#" target="_blank"><i class="fa fa-tv fa-fw"></i> Slide Mode</a>
+ <li role="presentation"><a role="menuitem" class="ui-extra-slide" tabindex="-1" href="#" target="_blank"><i class="fa fa-tv fa-fw"></i> <%= __('Slide Mode') %></a>
</li>
<li class="divider"></li>
- <li class="dropdown-header">Export</li>
+ <li class="dropdown-header"><%= __('Export') %></li>
<li role="presentation"><a role="menuitem" class="ui-save-dropbox" tabindex="-1" href="#" target="_self"><i class="fa fa-dropbox fa-fw"></i> Dropbox</a>
</li>
<li role="presentation"><a role="menuitem" class="ui-save-google-drive" tabindex="-1" href="#" target="_self"><i class="fa fa-cloud-upload fa-fw"></i> Google Drive</a>
@@ -144,7 +144,7 @@
</li>
<% } %>
<li class="divider"></li>
- <li class="dropdown-header">Import</li>
+ <li class="dropdown-header"><%= __('Import') %></li>
<li role="presentation"><a role="menuitem" class="ui-import-dropbox" tabindex="-1" href="#" target="_self"><i class="fa fa-dropbox fa-fw"></i> Dropbox</a>
</li>
<li role="presentation"><a role="menuitem" class="ui-import-google-drive" tabindex="-1" href="#" target="_self"><i class="fa fa-cloud-download fa-fw"></i> Google Drive</a>
@@ -155,15 +155,15 @@
<li role="presentation"><a role="menuitem" class="ui-import-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a>
</li>
<% } %>
- <li role="presentation"><a role="menuitem" class="ui-import-clipboard" href="#" data-toggle="modal" data-target="#clipboardModal"><i class="fa fa-clipboard fa-fw"></i> Clipboard</a>
+ <li role="presentation"><a role="menuitem" class="ui-import-clipboard" href="#" data-toggle="modal" data-target="#clipboardModal"><i class="fa fa-clipboard fa-fw"></i> <%= __('Clipboard') %></a>
</li>
<li class="divider"></li>
- <li class="dropdown-header">Download</li>
+ <li class="dropdown-header"><%= __('Download') %></li>
<li role="presentation"><a role="menuitem" class="ui-download-markdown" tabindex="-1" href="#" target="_self"><i class="fa fa-file-text fa-fw"></i> Markdown</a>
</li>
<li role="presentation"><a role="menuitem" class="ui-download-html" tabindex="-1" href="#" target="_self"><i class="fa fa-file-code-o fa-fw"></i> HTML</a>
</li>
- <li role="presentation"><a role="menuitem" class="ui-download-raw-html" tabindex="-1" href="#" target="_self"><i class="fa fa-file-code-o fa-fw"></i> Raw HTML</a>
+ <li role="presentation"><a role="menuitem" class="ui-download-raw-html" tabindex="-1" href="#" target="_self"><i class="fa fa-file-code-o fa-fw"></i> <%= __('Raw HTML') %></a>
</li>
<li role="presentation"><a role="menuitem" class="ui-download-pdf-beta" tabindex="-1" href="#" target="_self"><i class="fa fa-file-pdf-o fa-fw"></i> PDF (Beta)</a>
</li>
diff --git a/public/views/help-modal.ejs b/public/views/help-modal.ejs
index 3a4fe22b..3d119e8b 100644
--- a/public/views/help-modal.ejs
+++ b/public/views/help-modal.ejs
@@ -5,79 +5,79 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="mySmallModalLabel"><i class="fa fa-question-circle"></i> Help</h4>
+ <h4 class="modal-title" id="mySmallModalLabel"><i class="fa fa-question-circle"></i> <%= __('Help') %></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">
- <h3 class="panel-title">Contacts</h3>
+ <h3 class="panel-title"><%= __('Contacts') %></h3>
</div>
<div class="panel-body">
- <a href="https://github.com/hackmdio/hackmd/issues" title="Report an issue" target="_blank"><i class="fa fa-tag fa-fw"></i> Report an issue</a>
+ <a href="https://github.com/hackmdio/hackmd/issues" target="_blank"><i class="fa fa-tag fa-fw"></i> <%= __('Report an issue') %></a>
<br>
- <a href="mailto:hackmdio@gmail.com" title="Send us email"><i class="fa fa-envelope fa-fw"></i> Send us email</a>
+ <a href="mailto:hackmdio@gmail.com"><i class="fa fa-envelope fa-fw"></i> <%= __('Send us email') %></a>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
- <h3 class="panel-title">Documents</h3>
+ <h3 class="panel-title"><%= __('Documents') %></h3>
</div>
<div class="panel-body">
- <a href="./features" title="Features" target="_blank"><i class="fa fa-dot-circle-o fa-fw"></i> Features</a>
+ <a href="./features" title="Features" target="_blank"><i class="fa fa-dot-circle-o fa-fw"></i> <%= __('Features') %></a>
<br>
- <a href="./yaml-metadata" title="YAML Metadata" target="_blank"><i class="fa fa-dot-circle-o fa-fw"></i> YAML Metadata</a>
+ <a href="./yaml-metadata" title="YAML Metadata" target="_blank"><i class="fa fa-dot-circle-o fa-fw"></i> <%= __('YAML Metadata') %></a>
<br>
- <a href="./slide-example" title="Slide Example" target="_blank"><i class="fa fa-dot-circle-o fa-fw"></i> Slide Example</a>
+ <a href="./slide-example" title="Slide Example" target="_blank"><i class="fa fa-dot-circle-o fa-fw"></i> <%= __('Slide Example') %></a>
</div>
</div>
</div>
<div class="col-lg-9">
<div class="panel panel-default">
<div class="panel-heading">
- <h3 class="panel-title">Cheatsheet</h3>
+ <h3 class="panel-title"><%= __('Cheatsheet') %></h3>
</div>
<div class="panel-body" style="height: calc(100vh - 215px); overflow: auto;">
<table class="table table-condensed">
<thead>
<tr>
- <th>Example</th>
- <th>Syntax</th>
+ <th><%= __('Example') %></th>
+ <th><%= __('Syntax') %></th>
</tr>
</thead>
<tbody class="markdown-body" style="font-family: inherit; font-size: 14px; padding: 0; max-width: inherit;">
<tr>
- <td>Header</td>
- <td># Header</td>
+ <td><%= __('Header') %></td>
+ <td># <%= __('Header') %></td>
</tr>
<tr>
- <td><ul><li>Unordered List</li></ul></td>
- <td>- Unordered List</td>
+ <td><ul><li><%= __('Unordered List') %></li></ul></td>
+ <td>- <%= __('Unordered List') %></td>
</tr>
<tr>
- <td><ol><li>Ordered List</li></ol></td>
- <td>1. Ordered List</td>
+ <td><ol><li><%= __('Ordered List') %></li></ol></td>
+ <td>1. <%= __('Ordered List') %></td>
</tr>
<tr>
- <td><ul><li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled><label></label>Todo List</li></ul></td>
- <td>- [ ] Todo List</td>
+ <td><ul><li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled><label></label><%= __('Todo List') %></li></ul></td>
+ <td>- [ ] <%= __('Todo List') %></td>
</tr>
<tr>
- <td><blockquote> Blockquote</blockquote></td>
- <td>> Blockquote</td>
+ <td><blockquote> <%= __('Blockquote') %></blockquote></td>
+ <td>> <%= __('Blockquote') %></td>
</tr>
<tr>
- <td><strong>Bold font</strong></td>
- <td>**Bold font**</td>
+ <td><strong><%= __('Bold font') %></strong></td>
+ <td>**<%= __('Bold font') %>**</td>
</tr>
<tr>
- <td><i>Italics font</i></td>
- <td>*Italics font*</td>
+ <td><i><%= __('Italics font') %></i></td>
+ <td>*<%= __('Italics font') %>*</td>
</tr>
<tr>
- <td><s>Strikethrough</s></td>
- <td>~~strikethrough~~</td>
+ <td><s><%= __('Strikethrough') %></s></td>
+ <td>~~<%= __('Strikethrough') %>~~</td>
</tr>
<tr>
<td>19<sup>th</sup></td>
@@ -88,24 +88,24 @@
<td>H~2~O</td>
</tr>
<tr>
- <td><ins>Inserted text</ins></td>
- <td>++Inserted text++</td>
+ <td><ins><%= __('Inserted text') %></ins></td>
+ <td>++<%= __('Inserted text') %>++</td>
</tr>
<tr>
- <td><mark>Marked text</mark></td>
- <td>==Marked text==</td>
+ <td><mark><%= __('Marked text') %></mark></td>
+ <td>==<%= __('Marked text') %>==</td>
</tr>
<tr>
- <td><a>Link</a></td>
+ <td><a><%= __('Link') %></a></td>
<td>[link text](https:// "title")</td>
</tr>
<tr>
- <td>Image</td>
+ <td><%= __('Image') %></td>
<td>![image alt](https:// "title")</td>
</tr>
<tr>
- <td><code>Code</code></td>
- <td>`code`</td>
+ <td><code><%= __('Code') %></code></td>
+ <td>`<%= __('Code') %>`</td>
</tr>
<tr>
<td><pre style="border:none !important;"><code class="javascript hljs"><div class="wrapper"><div class="gutter linenumber"><span data-linenumber="1"></span></div><div class="code"><span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>;
@@ -117,7 +117,7 @@
<td>:smile:</td>
</tr>
<tr>
- <td>Externals</td>
+ <td><%= __('Externals') %></td>
<td>{%youtube youtube_id %}</td>
</tr>
<tr>
@@ -125,8 +125,8 @@
<td>$L^aT_eX$</td>
</tr>
<tr>
- <td><div class="alert alert-info"><p>This is a alert area.</p></div></td>
- <td>:::info<br>This is a alert area.<br>:::</td>
+ <td><div class="alert alert-info"><p><%= __('This is a alert area.') %></p></div></td>
+ <td>:::info<br><%= __('This is a alert area.') %><br>:::</td>
</tr>
</tbody>
</table>
diff --git a/public/views/index.ejs b/public/views/index.ejs
index daf123b1..8c4cf101 100644
--- a/public/views/index.ejs
+++ b/public/views/index.ejs
@@ -8,9 +8,9 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
- <meta name="description" content="Best way to write and share your knowledge in markdown.">
+ <meta name="description" content="<%= __('Best way to write and share your knowledge in markdown.') %>">
<meta name="keywords" content="Collaborative, Markdown, Notes">
- <title>HackMD - Collaborative markdown notes</title>
+ <title>HackMD - <%= __('Collaborative markdown notes') %></title>
<link rel="icon" type="image/png" href="<%- url %>/favicon.png">
<link rel="apple-touch-icon" href="<%- url %>/apple-touch-icon.png">
@@ -41,9 +41,9 @@
<h3 class="masthead-brand"></h3>
<nav>
<ul class="nav masthead-nav">
- <li class="ui-home<% if(!signin) { %> active<% } %>"><a href="#">Intro</a>
+ <li class="ui-home<% if(!signin) { %> active<% } %>"><a href="#"><%= __('Intro') %></a>
</li>
- <li class="ui-history<% if(signin) { %> active<% } %>"><a href="#">History</a>
+ <li class="ui-history<% if(signin) { %> active<% } %>"><a href="#"><%= __('History') %></a>
</li>
</ul>
</nav>
@@ -54,17 +54,17 @@
<div class="inner cover">
<h1 class="cover-heading"><i class="fa fa-file-text"></i> HackMD</h1>
<p class="lead">
- Best way to write and share your knowledge in markdown.
+ <%= __('Best way to write and share your knowledge in markdown.') %>
</p>
<% if(facebook || twitter || github || gitlab || dropbox || google) { %>
<span class="ui-signin">
<br>
- <a type="button" class="btn btn-lg btn-success ui-signin" data-toggle="modal" data-target=".signin-modal" style="width: 170px;">Sign In</a>
+ <a type="button" class="btn btn-lg btn-success ui-signin" data-toggle="modal" data-target=".signin-modal" style="width: 170px;"><%= __('Sign In') %></a>
</span>
- <span class="ui-or">or</span>
+ <span class="ui-or"><%= __('or') %></span>
<% }%>
<span class="ui-signin">
- <a href="<%- url %>/new" class="btn btn-lg btn-default" style="width: 170px;">New guest note</a>
+ <a href="<%- url %>/new" class="btn btn-lg btn-default" style="width: 170px;"><%= __('New guest note') %></a>
<br>
<br>
</span>
@@ -72,19 +72,19 @@
<div class="col-md-4 inner">
<a href="<%- url %>/features#share-note">
<i class="fa fa-bolt fa-3x"></i>
- <h4>Collaborate with URL</h4>
+ <h4><%= __('Collaborate with URL') %></h4>
</a>
</div>
<div class="col-md-4 inner">
<a href="<%- url %>/features#mathjax">
<i class="fa fa-bar-chart fa-3x"></i>
- <h4>Support charts and MathJax</h4>
+ <h4><%= __('Support charts and MathJax') %></h4>
</a>
</div>
<div class="col-md-4 inner">
<a href="<%- url %>/features#slide-mode">
<i class="fa fa-tv fa-3x"></i>
- <h4>Support slide mode</h4>
+ <h4><%= __('Support slide mode') %></h4>
</a>
</div>
</div>
@@ -94,45 +94,45 @@
<div id="history" class="section"<% if(!signin) { %> style="display:none;"<% } %>>
<% if(facebook || twitter || github || gitlab || dropbox || google) { %>
<div class="ui-signin">
- <p>Below is the history from browser</p>
+ <p><%= __('Below is the history from browser') %></p>
</div>
<div class="ui-signout" style="display:none;">
<img class="ui-avatar">
- <h4 class="ui-welcome">Welcome! <span class="ui-name"></span></h4>
- <a href="<%- url %>/new" class="btn btn-md btn-default">New note</a> or
- <a href="#" class="btn btn-danger ui-logout">Sign Out</a>
+ <h4 class="ui-welcome"><%= __('Welcome!') %> <span class="ui-name"></span></h4>
+ <a href="<%- url %>/new" class="btn btn-md btn-default"><%= __('New note') %></a> <%= __('or') %>
+ <a href="#" class="btn btn-danger ui-logout"><%= __('Sign Out') %></a>
</div>
<% }%>
<h4>
- <a type="button" href="<%- url %>/features" class="btn btn-primary">Explore all features</a>
+ <a type="button" href="<%- url %>/features" class="btn btn-primary"><%= __('Explore all features') %></a>
</h4>
<hr>
<form class="form-inline">
<div class="form-group" style="vertical-align: bottom;">
- <input class="form-control ui-use-tags" />
+ <input class="form-control ui-use-tags" placeholder="<%= __('Select tags...') %>" />
</div>
<div class="form-group">
- <input class="search form-control" placeholder="Search keyword..." />
+ <input class="search form-control" placeholder="<%= __('Search keyword...') %>" />
</div>
- <a href="#" class="sort btn btn-default" data-sort="text" title="Sort by title">
- Title
+ <a href="#" class="sort btn btn-default" data-sort="text" title="<%= __('Sort by title') %>">
+ <%= __('Title') %>
</a>
- <a href="#" class="sort btn btn-default" data-sort="timestamp" title="Sort by time">
- Time
+ <a href="#" class="sort btn btn-default" data-sort="timestamp" title="<%= __('Sort by time') %>">
+ <%= __('Time') %>
</a>
<span class="hidden-xs hidden-sm">
- <a href="#" class="btn btn-default ui-save-history" title="Export history"><i class="fa fa-save"></i></a>
- <span class="btn btn-default btn-file ui-open-history" title="Import history">
+ <a href="#" class="btn btn-default ui-save-history" title="<%= __('Export history') %>"><i class="fa fa-save"></i></a>
+ <span class="btn btn-default btn-file ui-open-history" title="<%= __('Import history') %>">
<i class="fa fa-folder-open-o"></i><input type="file" />
</span>
- <a href="#" class="btn btn-default ui-clear-history" title="Clear history" data-toggle="modal" data-target=".delete-modal"><i class="fa fa-trash-o"></i></a>
+ <a href="#" class="btn btn-default ui-clear-history" title="<%= __('Clear history') %>" data-toggle="modal" data-target=".delete-modal"><i class="fa fa-trash-o"></i></a>
</span>
- <a href="#" class="btn btn-default ui-refresh-history" title="Refresh history"><i class="fa fa-refresh"></i></a>
+ <a href="#" class="btn btn-default ui-refresh-history" title="<%= __('Refresh history') %>"><i class="fa fa-refresh"></i></a>
</form>
<h4 class="ui-nohistory" style="display:none;">
- No history
+ <%= __('No history') %>
</h4>
- <a href="#" class="btn btn-primary ui-import-from-browser" style="display:none;">Import from browser</a>
+ <a href="#" class="btn btn-primary ui-import-from-browser" style="display:none;"><%= __('Import from browser') %></a>
<ul id="history-list" class="list">
</ul>
</div>
@@ -143,8 +143,12 @@
<iframe src="//ghbtns.com/github-btn.html?user=hackmdio&repo=hackmd&type=star&count=true" frameborder="0" scrolling="0" width="90px" height="20px"></iframe>
</h6>
<p>
- &copy; 2016 <a href="https://www.facebook.com/TakeHackMD" target="_blank"><i class="fa fa-facebook-square"></i> HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank">Releases</a>
+ &copy; 2016 <a href="https://www.facebook.com/TakeHackMD" target="_blank"><i class="fa fa-facebook-square"></i> HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a>
</p>
+ <select class="ui-locale">
+ <option value="en">English</option>
+ <option value="zh">中文</option>
+ </select>
</div>
</div>
</div>
@@ -157,15 +161,15 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="myModalLabel">Are you sure?</h4>
+ <h4 class="modal-title" id="myModalLabel"><%= __('Are you sure?') %></h4>
</div>
<div class="modal-body" style="color:black;">
<h5 class="ui-delete-modal-msg"></h5>
<strong class="ui-delete-modal-item"></strong>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-danger ui-delete-modal-confirm">Yes, do it!</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
+ <button type="button" class="btn btn-danger ui-delete-modal-confirm"><%= __('Yes, do it!') %></button>
</div>
</div>
</div>
@@ -198,6 +202,7 @@
<script src="<%- url %>/js/common.js" defer></script>
<script src="<%- url %>/js/history.js" defer></script>
<script src="<%- url %>/js/cover.js" defer></script>
+ <script src="<%- url %>/js/locale.js" defer></script>
</body>
</html>
diff --git a/public/views/refresh-modal.ejs b/public/views/refresh-modal.ejs
index 07e3ecab..5be41b2a 100644
--- a/public/views/refresh-modal.ejs
+++ b/public/views/refresh-modal.ejs
@@ -5,26 +5,26 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="myModalLabel">This page need refresh</h4>
+ <h4 class="modal-title" id="myModalLabel"><%= __('This page need refresh') %></h4>
</div>
<div class="modal-body">
<div class="incompatible-version">
- <h5>You have an incompatible client version.</h5>
- <strong>Refresh to update.</strong>
+ <h5><%= __('You have an incompatible client version.') %></h5>
+ <strong><%= __('Refresh to update.') %></strong>
</div>
<div class="new-version" style="display:none;">
- <h5>New version available!</h5>
- <a href="<%- url %>/s/release-notes" target="_blank">See releases notes here</a>
+ <h5><%= __('New version available!') %></h5>
+ <a href="<%- url %>/s/release-notes" target="_blank"><%= __('See releases notes here') %></a>
<br>
- <strong>Refresh to enjoy new features.</strong>
+ <strong><%= __('Refresh to enjoy new features.') %></strong>
</div>
<div class="user-state-changed" style="display:none;">
- <h5>Your user state has changed.</h5>
- <strong>Refresh to load new user state.</strong>
+ <h5><%= __('Your user state has changed.') %></h5>
+ <strong><%= __('Refresh to load new user state.') %></strong>
</div>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-primary" id="refreshModalRefresh">Refresh</button>
+ <button type="button" class="btn btn-primary" id="refreshModalRefresh"><%= __('Refresh') %></button>
</div>
</div>
</div>
diff --git a/public/views/revision-modal.ejs b/public/views/revision-modal.ejs
index 008e62ac..f824cf06 100644
--- a/public/views/revision-modal.ejs
+++ b/public/views/revision-modal.ejs
@@ -5,7 +5,7 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="mySmallModalLabel"><i class="fa fa-history"></i> Revision</h4>
+ <h4 class="modal-title" id="mySmallModalLabel"><i class="fa fa-history"></i> <%= __('Revision') %></h4>
</div>
<div class="modal-body">
<div class="row">
@@ -18,9 +18,9 @@
</div>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="button" class="btn btn-primary" id="revisionModalDownload">Download</button>
- <button type="button" class="btn btn-danger" id="revisionModalRevert">Revert</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
+ <button type="button" class="btn btn-primary" id="revisionModalDownload"><%= __('Download') %></button>
+ <button type="button" class="btn btn-danger" id="revisionModalRevert"><%= __('Revert') %></button>
</div>
</div>
</div>
diff --git a/public/views/signin-modal.ejs b/public/views/signin-modal.ejs
index 293480b9..a3ca63f8 100644
--- a/public/views/signin-modal.ejs
+++ b/public/views/signin-modal.ejs
@@ -5,37 +5,37 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
- <h4 class="modal-title" id="mySmallModalLabel">Choose method</h4>
+ <h4 class="modal-title" id="mySmallModalLabel"><%= __('Choose method') %></h4>
</div>
<div class="modal-body">
<% if(facebook) { %>
<a href="<%- url %>/auth/facebook" class="btn btn-lg btn-block btn-social btn-facebook">
- <i class="fa fa-facebook"></i> Sign in via Facebook
+ <i class="fa fa-facebook"></i> <%= __('Sign in via %s', 'Facebook') %>
</a>
<% } %>
<% if(twitter) { %>
<a href="<%- url %>/auth/twitter" class="btn btn-lg btn-block btn-social btn-twitter">
- <i class="fa fa-twitter"></i> Sign in via Twitter
+ <i class="fa fa-twitter"></i> <%= __('Sign in via %s', 'Twitter') %>
</a>
<% } %>
<% if(github) { %>
<a href="<%- url %>/auth/github" class="btn btn-lg btn-block btn-social btn-github">
- <i class="fa fa-github"></i> Sign in via GitHub
+ <i class="fa fa-github"></i> <%= __('Sign in via %s', 'GitHub') %>
</a>
<% } %>
<% if(gitlab) { %>
<a href="<%- url %>/auth/gitlab" class="btn btn-lg btn-block btn-social btn-soundcloud">
- <i class="fa fa-gitlab"></i> Sign in via GitLab
+ <i class="fa fa-gitlab"></i> <%= __('Sign in via %s', 'GitLab') %>
</a>
<% } %>
<% if(dropbox) { %>
<a href="<%- url %>/auth/dropbox" class="btn btn-lg btn-block btn-social btn-dropbox">
- <i class="fa fa-dropbox"></i> Sign in via Dropbox
+ <i class="fa fa-dropbox"></i> <%= __('Sign in via %s', 'Dropbox') %>
</a>
<% } %>
<% if(google) { %>
<a href="<%- url %>/auth/google" class="btn btn-lg btn-block btn-social btn-google">
- <i class="fa fa-google"></i> Sign in via Google
+ <i class="fa fa-google"></i> <%= __('Sign in via %s', 'Google') %>
</a>
<% } %>
</div>