mirror of https://github.com/artf/grapesjs.git
2 changed files with 49 additions and 23 deletions
@ -1,23 +0,0 @@ |
|||||
import en from './locale/en'; |
|
||||
|
|
||||
export default { |
|
||||
// Locale value
|
|
||||
locale: 'en', |
|
||||
|
|
||||
// Fallback locale
|
|
||||
localeFallback: 'en', |
|
||||
|
|
||||
// Detect locale by checking browser language
|
|
||||
detectLocale: true, |
|
||||
|
|
||||
// Show warnings when some of the i18n resources are missing
|
|
||||
debug: false, |
|
||||
|
|
||||
// Messages to translate
|
|
||||
messages: { |
|
||||
en, |
|
||||
}, |
|
||||
|
|
||||
// Additional messages. This allows extending the default `messages` set directly from the configuration.
|
|
||||
messagesAdd: null, |
|
||||
}; |
|
||||
@ -0,0 +1,49 @@ |
|||||
|
import en from './locale/en'; |
||||
|
|
||||
|
export interface I18nConfig { |
||||
|
/** |
||||
|
* Locale value. |
||||
|
* @default 'en' |
||||
|
*/ |
||||
|
locale?: string; |
||||
|
|
||||
|
/** |
||||
|
* Fallback locale. |
||||
|
* @default 'en' |
||||
|
*/ |
||||
|
localeFallback?: string; |
||||
|
|
||||
|
/** |
||||
|
* Detect locale by checking browser language. |
||||
|
* @default true |
||||
|
*/ |
||||
|
detectLocale?: boolean; |
||||
|
|
||||
|
/** |
||||
|
* Show warnings when some of the i18n resources are missing. |
||||
|
* @default false |
||||
|
*/ |
||||
|
debug?: boolean; |
||||
|
|
||||
|
/** |
||||
|
* Messages to translate. |
||||
|
* @default { en: {...} } |
||||
|
*/ |
||||
|
messages?: Record<string, any>; |
||||
|
|
||||
|
/** |
||||
|
* Additional messages. This allows extending the default `messages` set directly from the configuration. |
||||
|
*/ |
||||
|
messagesAdd?: Record<string, any>; |
||||
|
} |
||||
|
|
||||
|
const config: I18nConfig = { |
||||
|
locale: 'en', |
||||
|
localeFallback: 'en', |
||||
|
detectLocale: true, |
||||
|
debug: false, |
||||
|
messages: { en }, |
||||
|
messagesAdd: undefined, |
||||
|
}; |
||||
|
|
||||
|
export default config; |
||||
Loading…
Reference in new issue