Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #57 from Echowxsy/feat/zh-cn
Browse files Browse the repository at this point in the history
Feat/zh cn
  • Loading branch information
ZeroX-DG authored Feb 17, 2020
2 parents bb1fec3 + 925759a commit 131478b
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ export default class SnippetDetailMultiFile extends React.Component {
<TagItem config={config} tag={tag} key={index} />
))
) : (
'No tag'
i18n.__('No tag')
)}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export default class SnippetDetail extends React.Component {
<TagItem config={config} tag={tag} key={index} />
))
) : (
'No tag'
i18n.__('No tag')
)}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export default class SnippetItemMultiFiles extends React.Component {
<TagItem config={config} tag={tag} key={index} />
))
) : (
'No tag'
i18n.__('No tag')
)}
</div>
)
Expand Down Expand Up @@ -395,7 +395,7 @@ export default class SnippetItemMultiFiles extends React.Component {
type="text"
ref="newFile"
onFocus={this.handleNewFileFocus.bind(this)}
placeholder="New file"
placeholder={i18n.__('New file')}
/>
</li>
)}
Expand Down
2 changes: 1 addition & 1 deletion browser/render/layouts/original/snippet-item/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export default class SnippetItem extends React.Component {
<TagItem config={config} tag={tag} key={index} />
))
) : (
'No tag'
i18n.__('No tag')
)}
</div>
)
Expand Down
5 changes: 4 additions & 1 deletion browser/render/lib/languages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const languages = [
{ name: 'English', code: 'en' },
{ name: 'Tiếng Việt', code: 'vi' }
{ name: 'Tiếng Việt', code: 'vi' },
// thanks @zbahadir for Turkish translation
{ name: 'Turkish', code: 'tr' },
{ name: '简体中文', code: 'zh-cn' }
]

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion browser/render/modals/create-multi-files-snippet/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default class CreateMultiFilesSnippetModal extends React.Component {
type="text"
ref="newFile"
onFocus={this.handleNewFileFocus.bind(this)}
placeholder="New file"
placeholder={i18n.__('New file')}
/>
</li>
}
Expand Down
3 changes: 2 additions & 1 deletion browser/render/modals/modal-skeleton.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import FAIcon from '@fortawesome/react-fontawesome'
import eventEmitter from 'lib/event-emitter'
import i18n from 'render/lib/i18n'
import './modal'

export default class ModalSkeleton extends React.Component {
Expand All @@ -16,7 +17,7 @@ export default class ModalSkeleton extends React.Component {
{closeBtn !== false && (
<div className="close-btn" onClick={this.closeModal.bind(this)}>
<FAIcon icon="times" />
<span className="text">ESC</span>
<span className="text">{i18n.__('ESC')}</span>
</div>
)}
{this.props.children}
Expand Down
2 changes: 1 addition & 1 deletion browser/render/modals/setting/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class SettingModal extends React.Component {
onClick={() => this.switchTab('language')}
className={tab === 'language' ? 'active' : ''}
>
<div className="tab">{i18n.__('Language')}</div>
<div className="tab">{i18n.__('Programming Language')}</div>
</li>
</ul>
)
Expand Down
16 changes: 10 additions & 6 deletions browser/render/modals/setting/tabs/about.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ export default class About extends React.Component {
</p>
</div>
</div>
<h2 className="m-t-50">Author</h2>
<h2 className="m-t-50">{i18n.__('Author')}</h2>
<p>
Nguyen Viet Hung (<a href="https://github.com/ZeroX-DG">
@ZeroX-DG
</a>)
</p>
<p>Email: [email protected]</p>
<h2 className="m-t-50">Donate</h2>
<h2 className="m-t-50">{i18n.__('Donate')}</h2>
<p>
{i18n.__(
`If this app help you with your work and you wish to say thanks to me, you can donate me through Buy Me A Coffee. Your donation will be a huge motivation for me to continue to add more features and bugfixes in the future.`
Expand All @@ -57,21 +57,25 @@ export default class About extends React.Component {
<img src={donateButton} alt="Buy Me A Coffee" />
</a>
</p>
<h2 className="m-t-50">Analytics</h2>
<h2 className="m-t-50">{i18n.__('Analytics')}</h2>
<p>
{i18n.__(
'SnippetStore collects anonymous data for only 1 reason' +
'-improve user experience. We will never collects your private ' +
'information such as your code snippets. If you wish to know ' +
'how it work, here is its source code:'
)}&nbsp;
<a href="https://github.com/ZeroX-DG/SnippetStore">github</a>
)}
&nbsp;
<a href="https://github.com/ZeroX-DG/SnippetStore">Github</a>
</p>
<p>
<Switch
onChange={checked => this.onAnalyticsChange(checked)}
defaultValue={config.allowAnalytics}
/>Enable analytics to help improve SnippetStore
/>
{i18n.__(
'Enable analytics to help improve SnippetStore'
)}
</p>
</div>
</div>
Expand Down
85 changes: 85 additions & 0 deletions languages/zh-cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"LANGUAGES": "编程语言",
"Create at": "创建时间",
"Last update": "最后更新时间",
"Copy": "复制次数",
"No snippet found!": "没有找到代码片段!",
"Create new snippet using ": "创建新的代码片段:",
"Create": "创建",
"SORT": "排序",
"Sort by create time (newest)": "创建时间降序(最新)",
"Sort by create time (oldest)": "创建时间升序(最早)",
"Sort by update time (newest)": "更新时间降序(最新)",
"Sort by update time (oldest)": "更新时间升序(最早)",
"Sort by copy count (ascending)": "使用次数升序(最少)",
"Sort by copy count (descending)": "使用次数降序(最多)",
"Snippet name": "代码片段名称",
"Snippet language": "编程语言",
"Snippet content": "代码片段内容",
"About": "关于",
"SnippetStore is a snippet management app developers": "SnippetStore 是一个代码片段管理软件",
"Show line number": "行号",
"Theme": "主题",
"Editor font family": "字体",
"Editor font size": "字体大小",
"Editor indent style": "缩进",
"Editor tab size": "Tab 大小",
"Editor setting saved": "编辑器设置已保存",
"Save": "保存",
"HotKeys": "快捷键",
"Create snippet": "创建代码片段",
"Open setting": "打开设置",
"Hotkeys setting saved": "快捷键设置已保存",
"Language": "界面语言",
"Show notification when copy": "复制提示",
"Show confirm dialog when delete": "删除确认提示",
"Show snippet create time": "展示创建时间",
"Show snippet update time": "展示更新时间",
"Show snippet copy count": "展示复制次数",
"Date format": "日期格式",
"Interface setting saved": "界面设置已保存",
"Interface": "界面",
"Editor": "编辑器",
"Hotkeys": "快捷键",
"Dark": "黑暗 Dark",
"Light": "明亮 Light",
"Toggle small sidebar": "收起侧边栏",
"copy": "复制",
"save changes": "保存修改",
"edit": "编辑",
"delete snippet": "删除",
"times": "",
"Are you sure to delete this snippet?": "你确定要删除这个代码片段吗?",
"Copied to clipboard": "已复制到剪贴板",
"TAGS": "标签",
"Snippet description": "代码片段介绍",
"Create new snippet": "创建代码片段",
"Single-file snippet": "单文件代码片段",
"Multi-file snippet": "多文件代码片段",
"This is the type of snippet where you will only store 1 piece of code. This type of snippet is suitable for storing small functions": "这是只有一种文件类型的代码片段,例如一个简单的函数",
"This type of snippet can groups multiple files into 1 snippet and suitable for storing simple code snippet with more than 1 file": "这是包含多种文件类型的代码片段,这种代码片段包含多个类型的文件",
"The snippet must have at least 1 file": "这种代码片段至少包含一个文件",
"discard changes": "撤销修改",
"Are you sure to delete this file?": "你确定要删除这个文件吗?",
"Pick a snippet from list": "选择一个代码片段",
"Snippet list layout": "列表样式",
"Highlight current line": "高亮光标所在行",
"Export JSON": "导出 JSON",
"SnippetStore collects anonymous data for only 1 reason-improve user experience. We will never collects your private information such as your code snippets. If you wish to know how it work, here is its source code:": "SnippetStore 只为一个目的收集匿名信息——提高用户体验。我们从来不会收集您你的私人信息 例如您的代码片段。如果您想知道这是如何工作的,这里是源代码:",
"If this app help you with your work and you wish to say thanks to me, you can donate me through Buy Me A Coffee. Your donation will be a huge motivation for me to continue to add more features and bugfixes in the future.": "如果这个软件有帮助到您,或是您想表示您的感谢,您可以赞助我,请我喝一杯咖啡。您的赞助是我修改 Bug 和增加新的功能的巨大的动力。",
"Storage": "存储",
"Snippet storage path:": "保存位置:",
"Browse": "浏览",
"Use default": "使用默认位置",
"Tag color": "标签颜色",
"Programming Language": "编程语言",
"Enable analytics to help improve SnippetStore": "允许收集程序匿名信息用于提高 SnippetStore 的体验",
"Donate": "赞助",
"Author": "作者",
"ESC": "关闭",
"Analytics": "分析",
"Search...": "搜索……",
"Tags": "标签",
"New file": "添加文件",
"No tag" : "无标签"
}
18 changes: 2 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,10 @@
"LICENSE",
"THIRD-PARTY-LICENSES.txt"
],
"dmg": {
"contents": [
{
"x": 438,
"y": 275,
"type": "link",
"path": "/Applications"
},
{
"x": 192,
"y": 275,
"type": "file"
}
]
},
"mac": {
"category": "public.app-category.developer-tools",
"icon": "resources/icon/icon512.png"
"icon": "resources/icon/icon512.png",
"target":"pkg"
},
"linux": {
"category": "Development",
Expand Down

0 comments on commit 131478b

Please sign in to comment.