Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"start:cn": "yarn setup:links && yarn --cwd sites/zh-CN start --port 3001",
"start:ja": "yarn setup:links && yarn --cwd sites/ja start --port 3002",
"start:es": "yarn setup:links && yarn --cwd sites/es start --port 3003",
"start:pt": "yarn setup:links && yarn --cwd sites/pt-BR start --port 3004",
"start:en+cn": "concurrently -n en,cn -c blue,green \"yarn start:en\" \"yarn start:cn\"",
"start:all": "concurrently -n en,cn,ja,es -c blue,green,yellow,magenta \"yarn start:en\" \"yarn start:cn\" \"yarn start:ja\" \"yarn start:es\"",
"start:all": "concurrently -n en,cn,ja,es,pt -c blue,green,yellow,magenta,cyan \"yarn start:en\" \"yarn start:cn\" \"yarn start:ja\" \"yarn start:es\" \"yarn start:pt\"",
"build": "yarn build:all",
"build:en": "yarn --cwd sites/en build -- --out-dir ../../build",
"build:cn": "yarn --cwd sites/zh-CN build -- --out-dir ../../build/cn",
"build:ja": "yarn --cwd sites/ja build -- --out-dir ../../build/ja",
"build:es": "yarn --cwd sites/es build -- --out-dir ../../build/es",
"build:all": "yarn build:en && yarn build:cn && yarn build:ja && yarn build:es",
"build:pt": "yarn --cwd sites/pt-BR build -- --out-dir ../../build/pt",
"build:all": "yarn build:en && yarn build:cn && yarn build:ja && yarn build:es && yarn build:pt",
"serve": "docusaurus serve",
"swizzle": "docusaurus swizzle",
"deploy": "yarn build && gh-pages -d build -b gh-pages -r https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git",
Expand Down
6 changes: 4 additions & 2 deletions scripts/generate-jetson-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ const APP_DIRS = {
en: 'sites/en/docs/Edge/NVIDIA_Jetson/Application',
zh: 'sites/zh-CN/docs/Edge/NVIDIA_Jetson/Application',
ja: 'sites/ja/docs/Edge/NVIDIA_Jetson/Application',
es: 'sites/es/docs/Edge/NVIDIA_Jetson/Application'
es: 'sites/es/docs/Edge/NVIDIA_Jetson/Application',
pt: 'sites/pt-BR/docs/Edge/NVIDIA_Jetson/Application'
};

// 站点语言前缀
const LANG_URL_PREFIX = {
en: '',
zh: '/cn',
ja: '/ja',
es: '/es'
es: '/es',
pt: '/pt-br'
};

// 定义分类映射(目录名 -> 配置变量名)
Expand Down
22 changes: 14 additions & 8 deletions scripts/generate-language-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ const config = {
en: 'sites/en/docs',
cn: 'sites/zh-CN/docs',
ja: 'sites/ja/docs',
es: 'sites/es/docs'
es: 'sites/es/docs',
pt: 'sites/pt-BR/docs'
},

languagePrefixes: {
en: '',
cn: '/cn',
ja: '/ja',
es: '/es'
es: '/es',
pt: '/pt-br'
},

outputFile: 'static/js/language-switcher.js',
Expand Down Expand Up @@ -189,11 +191,11 @@ function generateJavaScriptFile() {
const { languageMapping, allSlugs } = generateLanguageMapping();

// ✅ 首页多语言映射(仅追加,不影响 docs 的自动映射)
const HOMEPAGE_LOCALES = ['en', 'cn', 'ja', 'es'];
const HOMEPAGE_LOCALES = ['en', 'cn', 'ja', 'es', 'pt'];
languageMapping['/'] = HOMEPAGE_LOCALES;
languageMapping[''] = HOMEPAGE_LOCALES; // 兼容 basePath = '' 的情况

const SPECIAL_ROUTE_LOCALES = ['en', 'cn', 'ja', 'es'];
const SPECIAL_ROUTE_LOCALES = ['en', 'cn', 'ja', 'es', 'pt'];
['/knowledgebase/', '/knowledgebase'].forEach((slug) => {
languageMapping[slug] = SPECIAL_ROUTE_LOCALES;
});
Expand Down Expand Up @@ -235,7 +237,8 @@ function generateJavaScriptFile() {
en: { label: 'English', flag: '🇺🇸', prefix: '' },
cn: { label: '简体中文', flag: '🇨🇳', prefix: '/cn' },
ja: { label: '日本語', flag: '🇯🇵', prefix: '/ja' },
es: { label: 'Español', flag: '🇪🇸', prefix: '/es' }
es: { label: 'Español', flag: '🇪🇸', prefix: '/es' },
pt: { label: 'Português (Brasil)', flag: '🇧🇷', prefix: '/pt-br' }
};

// 内嵌的语言映射数据
Expand Down Expand Up @@ -264,6 +267,9 @@ function generateJavaScriptFile() {
} else if (currentPath.startsWith('/es/')) {
detectedLanguage = 'es';
basePath = currentPath.replace('/es', '') || '/';
} else if (currentPath.startsWith('/pt-br/')) {
detectedLanguage = 'pt';
basePath = currentPath.replace('/pt-br', '') || '/';
}

if (!basePath.startsWith('/')) {
Expand Down Expand Up @@ -298,7 +304,7 @@ function generateJavaScriptFile() {
}

const currentLangConfig = languages[currentLanguage];
const priority = { en: 0, cn: 1, ja: 2, es: 3 };
const priority = { en: 0, cn: 1, ja: 2, es: 3, pt: 4 };
const sortedLanguages = [...availableLanguages].sort((a, b) => {
if (a === currentLanguage) return -1;
if (b === currentLanguage) return 1;
Expand Down Expand Up @@ -432,7 +438,7 @@ function generateJavaScriptFile() {
if (availableLanguages.length <= 1) return null;

const currentLangConfig = languages[currentLanguage];
const priority = { en: 0, cn: 1, ja: 2, es: 3 };
const priority = { en: 0, cn: 1, ja: 2, es: 3, pt: 4 };
const sortedLanguages = [...availableLanguages].sort((a, b) => {
if (a === currentLanguage) return -1;
if (b === currentLanguage) return 1;
Expand Down Expand Up @@ -549,7 +555,7 @@ function generateJavaScriptFile() {
if (availableLanguages.length <= 1) return null;

const currentLangConfig = languages[currentLanguage];
const priority = { en: 0, cn: 1, ja: 2, es: 3 };
const priority = { en: 0, cn: 1, ja: 2, es: 3, pt: 4 };
const sorted = [...availableLanguages].sort((a, b) => {
if (a === currentLanguage) return -1;
if (b === currentLanguage) return 1;
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');

const sites = ['en', 'zh-CN', 'ja', 'es'];
const sites = ['en', 'zh-CN', 'ja', 'es', 'pt-BR'];
const links = ['src', 'static'];

function rmForce(p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Parts list
| [Grove - Temp&Humi Sensor](https://www.seeedstudio.com/Grove-I2C-High-Accuracy-Temp-Humi-Sensor-SHT35.html?queryID=ea8d1729f76e80d6b1b53c492c74fcdb&objectID=35&indexName=bazaar_retailer_products) | 1PC |
| [Grove - Digital Light Sensor](https://www.seeedstudio.com/Grove-Digital-Light-Sensor-TSL2561.html?queryID=c7822737fbcac80a47232a5fb1ac1e1d&objectID=1594&indexName=bazaar_retailer_products) | 1PC |
| Grove - WS2812 Waterproof LED Strip - 30 LEDs 1 meter | 1PC |
| [Grove - 3-Axis Digital Accelerometer(±1.5g)](//Grove-3-Axis_Digital_Accelerometer-1.5g/) | 1PC |
| [Grove - 3-Axis Digital Accelerometer(±1.5g)](/Grove-3-Axis_Digital_Accelerometer-1.5g/) | 1PC |
| [Wio Link](/Wio_Link/) | 1PC |
| [Micro USB Cable - 48cm](https://www.seeedstudio.com/Micro-USB-Cable-48cm-p-1475.html?queryID=a8b80828fdcd52ad1ae49daa5ed97191&objectID=1405&indexName=bazaar_retailer_products) | 1PC |

Expand Down
1 change: 1 addition & 0 deletions sites/en/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ module.exports = (async () => {
'zh-CN/**',
'ja/**',
'es/**',
'pt-br/**',
],
},
}),
Expand Down
34 changes: 33 additions & 1 deletion sites/en/src/components/home/BazaarAffiliate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const I18N_HEADER_TABS = {
cn: { header: '加入我们', tabs: { contributor: '贡献者', ranger: '社区大使', affiliate: '创作者与推广' } },
ja: { header: '参加しよう', tabs: { contributor: 'コントリビューター', ranger: 'コミュニティアンバサダー', affiliate: 'クリエイター&アフィリエイト' } },
es: { header: 'Participa', tabs: { contributor: 'Colaboradores', ranger: 'Embajador/a de la comunidad', affiliate: 'Creadores y afiliados' } },
'pt-br': { header: 'Participe', tabs: { contributor: 'Contribuidores', ranger: 'Embaixadores da comunidade', affiliate: 'Criadores e afiliados' } },
} as const;

// 统一主题色
Expand Down Expand Up @@ -167,6 +168,37 @@ No lo dudes: empieza a promocionar y gana grandes recompensas.`,
buttons: [{ text: 'Ver detalles del programa' }],
},
},
'pt-br': {
contributor: {
title: 'Junte-se à nossa comunidade de contribuidores',
subtitle: 'Torne-se um contribuidor do Wiki e compartilhe seu conhecimento!',
description: `Temos o prazer de convidar makers, desenvolvedores e engenheiros apaixonados para se juntarem à Seeed Studio e colaborarem conosco na construção e no suporte de soluções de hardware inovadoras em todo o mundo.`,
contact: 'Explore tarefas e colabore no GitHub: ',
contactLinkText: 'Quadro de projetos no GitHub',
buttons: [{ text: 'Saiba mais' }],
},
ranger: {
title: 'Torne-se um Seeed Ranger',
subtitle: 'Junte-se à nossa comunidade exclusiva de desenvolvedores!',
description: `O programa Seeed Studio Ranger reúne desenvolvedores experientes que compartilham conhecimento, constroem comunidades e impulsionam a inovação.

Junte-se a nós para criar conexões globais, fortalecer parcerias locais e obter insights valiosos a partir do feedback da comunidade.

Aproveite um recrutamento flexível e oportunidades para explorar experiências diversas com recompensas significativas.`,
contact: 'Tem interesse em se tornar um Ranger? Inscreva-se aqui: ',
contactLinkText: 'Formulário de inscrição para Ranger',
buttons: [{ text: 'Conheça o programa Ranger' }],
},
affiliate: {
title: 'Participe do programa de criadores e afiliados',
subtitle: 'A Seeed está procurando criadores de tecnologia e promotores de comunidade!',
description: `Participe e desbloqueie 10% de comissão na campanha de hardware compatível com Home Assistant. Os produtos favoritos dos desenvolvedores estão cheios de potencial para projetos.

Não hesite, comece a divulgar e ganhe ótimas recompensas.`,
contact: 'Tem dúvidas? Envie um e-mail para saber mais: ',
buttons: [{ text: 'Ver detalhes do programa' }],
},
},
} as const;

type LocaleKey = keyof typeof I18N_HEADER_TABS;
Expand Down Expand Up @@ -330,4 +362,4 @@ const BazaarAffiliate: React.FC = () => {
);
};

export default BazaarAffiliate;
export default BazaarAffiliate;
Loading
Loading