i18.js 312 B

1234567891011121314151617
  1. import messages from '@/locale/index'
  2. function $t(title){
  3. let locale = uni.getLocale()
  4. let mes = messages[locale];
  5. let common = mes.common;
  6. if(!common){
  7. return title;
  8. }
  9. if(common[title]){
  10. return common[title]
  11. }else{
  12. return title;
  13. }
  14. }
  15. export default $t;