Browse Source
Merge pull request #1055 from luncheon/customize_locales
feat: allow library users to add locales
master
mengshukeji
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
2 deletions
-
src/core.js
-
src/locale/locale.js
|
|
@ -2,6 +2,7 @@ |
|
|
|
import defaultSetting from './config.js'; |
|
|
|
import { common_extend } from './utils/util'; |
|
|
|
import Store from './store'; |
|
|
|
import { locales } from './locale/locale'; |
|
|
|
import server from './controllers/server'; |
|
|
|
import luckysheetConfigsetting from './controllers/luckysheetConfigsetting'; |
|
|
|
import sheetmanage from './controllers/sheetmanage'; |
|
|
@ -253,6 +254,8 @@ luckysheet.showLoadingProgress = showloading; |
|
|
|
luckysheet.hideLoadingProgress = hideloading; |
|
|
|
luckysheet.luckysheetextendData = luckysheetextendData; |
|
|
|
|
|
|
|
luckysheet.locales = locales; |
|
|
|
|
|
|
|
export { |
|
|
|
luckysheet |
|
|
|
} |
|
|
|
|
|
@ -4,10 +4,10 @@ import es from './es' |
|
|
|
import zh_tw from './zh_tw' |
|
|
|
import Store from '../store'; |
|
|
|
|
|
|
|
const localeObj = {en,zh,es,zh_tw} |
|
|
|
export const locales = {en,zh,es,zh_tw} |
|
|
|
|
|
|
|
function locale(){ |
|
|
|
return localeObj[Store.lang]; |
|
|
|
return locales[Store.lang]; |
|
|
|
} |
|
|
|
|
|
|
|
export default locale; |