parent
							
								
									1ab1f1b224
								
							
						
					
					
						commit
						d58dafeda9
					
				
				 3 changed files with 30 additions and 0 deletions
			
			
		@ -0,0 +1,21 @@ | 
				
			|||||||
 | 
					const VueI18nPlugin = { | 
				
			||||||
 | 
					  install: function (Vue) { | 
				
			||||||
 | 
					    Vue.mixin({ | 
				
			||||||
 | 
					      methods: { | 
				
			||||||
 | 
					        $ta(syntaxKey) { | 
				
			||||||
 | 
					          let keys = syntaxKey.split('|') | 
				
			||||||
 | 
					          let message = '' | 
				
			||||||
 | 
					          let _this = this | 
				
			||||||
 | 
					          keys.forEach(key => { | 
				
			||||||
 | 
					            message += _this.$t(key) | 
				
			||||||
 | 
					          }) | 
				
			||||||
 | 
					          if (keys.length > 0) { | 
				
			||||||
 | 
					            message = message.charAt(0).toUpperCase() + message.toLowerCase().substring(1) | 
				
			||||||
 | 
					          } | 
				
			||||||
 | 
					          return message | 
				
			||||||
 | 
					        } | 
				
			||||||
 | 
					      } | 
				
			||||||
 | 
					    }) | 
				
			||||||
 | 
					  } | 
				
			||||||
 | 
					} | 
				
			||||||
 | 
					export default VueI18nPlugin | 
				
			||||||
@ -0,0 +1,7 @@ | 
				
			|||||||
 | 
					import VueI18nPlugin from '@/plugins/i18n-extend'; | 
				
			||||||
 | 
					const Plugins = { | 
				
			||||||
 | 
					  install: function (Vue) { | 
				
			||||||
 | 
					    Vue.use(VueI18nPlugin) | 
				
			||||||
 | 
					  } | 
				
			||||||
 | 
					} | 
				
			||||||
 | 
					export default Plugins | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue