Allow nested translations
This commit is contained in:
		| @ -6,11 +6,15 @@ import utils from './utils'; | ||||
|  | ||||
| const i18n = { | ||||
|     get(key = '', config = {}) { | ||||
|         if (utils.is.empty(key) || utils.is.empty(config) || !Object.keys(config.i18n).includes(key)) { | ||||
|         if (utils.is.empty(key) || utils.is.empty(config)) { | ||||
|             return ''; | ||||
|         } | ||||
|  | ||||
|         let string = config.i18n[key]; | ||||
|         let string = key.split('.').reduce((o,i) => o[i] || {}, config.i18n); | ||||
|  | ||||
|         if (utils.is.empty(string)) { | ||||
|             return ''; | ||||
|         } | ||||
|  | ||||
|         const replace = { | ||||
|             '{seektime}': config.seekTime, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user