-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from TankNee/rebuild/fix
2.1.4 Add translation and fix bugs
- Loading branch information
Showing
46 changed files
with
507 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import I18n from './lib' | ||
import Store from 'electron-store' | ||
import messages from './src' | ||
|
||
const ClientFileStorage = new Store({ | ||
name: 'ClientFileStorage' | ||
}) | ||
const locale = ClientFileStorage.get('language') | ||
const i18n = new I18n({ | ||
locale: locale, | ||
messages, | ||
availableLocales: ['en-us', 'zh-cn'] | ||
}) | ||
|
||
export default i18n | ||
// export { i18n } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export default class I18n { | ||
constructor (options = {}) { | ||
const { | ||
locale, | ||
availableLocales, | ||
messages | ||
} = options | ||
this._locale = locale | ||
this._availableLocales = availableLocales | ||
this._messages = messages | ||
} | ||
|
||
/** | ||
* translation | ||
* @param {string} key | ||
*/ | ||
t (key) { | ||
if (this._messages[this._locale] && this._messages[this._locale][key]) { | ||
return this._messages[this._locale][key] | ||
} | ||
return key | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
importImage: 'Import Image', | ||
picgoServerNoteFound: 'PicGo Server Not Found' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import menu from './menu' | ||
import api from './api' | ||
export default { | ||
...menu, | ||
...api | ||
} |
Oops, something went wrong.