推广小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.0 KiB

  1. ---
  2. description:
  3. globs:
  4. alwaysApply: true
  5. ---
  6. ## 当前项目是uniapp开发微信小程序
  7. 在你修改locale下的json文件需要根据文件路径进行国际化配置
  8. 例如:
  9. 文件路径
  10. /components/active/active-item
  11. /pages/index/index
  12. /pages/index/center
  13. /pages_login/wxLogin
  14. en.json
  15. {
  16. "components" : {
  17. "active" : {
  18. "active_item" : {
  19. ...
  20. }
  21. }
  22. },
  23. "pages" : {
  24. "index" : {
  25. ...
  26. },
  27. "center" : {
  28. ...
  29. },
  30. },
  31. "pages_login" : {
  32. "wxLogin" : {
  33. ...
  34. },
  35. },
  36. }
  37. 并且在国际化替换内容的位置需要留有中文版的注释内容
  38. 国际化对象需要在objectLangMap.json中配置,将后端对象多个不同语言的字段进行关联,而不是国际化成中文
  39. 例如:
  40. {
  41. //国际化活动
  42. "active" : {
  43. "title" : {
  44. "zh-Hans" : "title",
  45. "en" : "enTitle",
  46. },
  47. ...
  48. }
  49. }
  50. 使用方式
  51. <view>$ot(item, 'active', 'title')</view>