Skip to content

Commit

Permalink
translations
Browse files Browse the repository at this point in the history
  • Loading branch information
twd2 committed Jul 26, 2017
1 parent 06336eb commit 0afecea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions vj4/locale/zh_CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -642,3 +642,6 @@ She: 她
(unsafe): (不安全)
Bulletin: 公告
You cannot visit this domain.: 您不能访问此域。
Menu: 菜单
'Copy failed :(': '复制失败 :('
Code copied to clipboard!: 代码已复制到剪贴板!
5 changes: 3 additions & 2 deletions vj4/ui/components/highlighter/prismjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import 'prismjs/plugins/line-numbers/prism-line-numbers';

import Clipboard from 'clipboard';
import Notification from 'vj/components/notification';
import i18n from 'vj/utils/i18n';

import languageMeta from './meta';

Expand All @@ -51,10 +52,10 @@ Prism.plugins.toolbar.registerButton('copy-to-clipboard', (env) => {
linkCopy.textContent = 'Copy';
const clip = new Clipboard(linkCopy, { text: () => env.code });
clip.on('success', () => {
Notification.success('Code copied to clipboard!', 1000);
Notification.success(i18n('Code copied to clipboard!'), 1000);
});
clip.on('error', () => {
Notification.error('Copy failed :(');
Notification.error(i18n('Copy failed :('));
});
return linkCopy;
});
Expand Down

0 comments on commit 0afecea

Please sign in to comment.