| 12345678910111213141516171819202122232425262728293031323334353637 |
- // build-pages.js
- const fs = require('fs')
- const locales = {
- zh: require('./zh-Hans.json'),
- en: require('./en.json')
- }
-
- function generatePagesJson(lang) {
- const template = {
- "pages": [
- {
- "path": "pages/device/index",
- "style": {
- "navigationBarTitleText": locales[lang].pages.device,
- "navigationStyle": "custom"
- }
- },
- // Add all other pages with localized titles...
- ],
- "tabBar": {
- "list": [
- {
- "pagePath": "pages/device/index",
- "text": locales[lang].tabBar.device,
- "iconPath": "static/tabbar/device.png",
- "selectedIconPath": "static/tabbar/device-active.png"
- },
- // Other tab bar items...
- ]
- }
- }
-
- fs.writeFileSync(`pages.${lang}.json`, JSON.stringify(template, null, 2))
- }
-
- generatePagesJson('zh')
- generatePagesJson('en')
|