Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/ar/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@
.download-section {
text-align: center;
}
.download-companion { margin-top: 14px; font-size: 14px; }
.download-companion { margin-top: 24px; font-size: 14px; }
.download-companion a { color: var(--accent2); text-decoration: underline; text-underline-offset: 4px; }
.download-companion a:hover { color: var(--text); }
.download-companion a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
Expand Down Expand Up @@ -4462,7 +4462,6 @@ <h2 class="section-title">الأسئلة الأكثر شيوعًا</h2>
<div class="section-label">ابدأ الآن</div>
<h2 class="section-title">ثبّت WebBrain</h2>
<p class="section-subtitle">متاح لـ Chrome و Edge و Firefox. مجاني، مفتوح المصدر، ولا يحتاج حسابًا.</p>
<p class="download-companion"><a href="https://www.webbrain.one/companion/">WebBrain Companion <span aria-hidden="true">→</span></a></p>

<div class="download-cards" data-download-cards>
<div class="download-row download-row-current" data-download-current>
Expand Down Expand Up @@ -4513,6 +4512,7 @@ <h3>Microsoft Edge</h3>
</div>
</div>
</div>
<p class="download-companion"><a href="https://www.webbrain.one/companion/">WebBrain Companion <span aria-hidden="true">→</span></a></p>
</section>

<!-- 9. FOR DEVELOPERS (MCP & Frameworks) -->
Expand Down
4 changes: 2 additions & 2 deletions web/bn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@
.download-section {
text-align: center;
}
.download-companion { margin-top: 14px; font-size: 14px; }
.download-companion { margin-top: 24px; font-size: 14px; }
.download-companion a { color: var(--accent2); text-decoration: underline; text-underline-offset: 4px; }
.download-companion a:hover { color: var(--text); }
.download-companion a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
Expand Down Expand Up @@ -4462,7 +4462,6 @@ <h2 class="section-title">প্রায়শই জিজ্ঞাসিত
<div class="section-label">শুরু করুন</div>
<h2 class="section-title">WebBrain ইনস্টল করুন</h2>
<p class="section-subtitle">Chrome, Edge, এবং Firefox এর জন্য উপলব্ধ। বিনামূল্যে, ওপেন সোর্স, কোনো অ্যাকাউন্টের প্রয়োজন নেই।</p>
<p class="download-companion"><a href="https://www.webbrain.one/companion/">WebBrain Companion <span aria-hidden="true">→</span></a></p>

<div class="download-cards" data-download-cards>
<div class="download-row download-row-current" data-download-current>
Expand Down Expand Up @@ -4513,6 +4512,7 @@ <h3>মাইক্রোসফট Edge</h3>
</div>
</div>
</div>
<p class="download-companion"><a href="https://www.webbrain.one/companion/">WebBrain Companion <span aria-hidden="true">→</span></a></p>
</section>

<!-- 9. FOR DEVELOPERS (MCP & Frameworks) -->
Expand Down
30 changes: 3 additions & 27 deletions web/build/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,7 @@ const LOGO_IMAGE_URL = `${SITE_ORIGIN}/logo-github.png`;

// Locale config. The default locale (en) renders to web/index.html;
// the others render to web/<code>/index.html.
const LOCALES = [
{ code: 'en', bcp47: 'en-US', label: 'English', dir: 'ltr', isDefault: true },
{ code: 'es', bcp47: 'es-ES', label: 'Español', dir: 'ltr', isDefault: false },
{ code: 'fr', bcp47: 'fr-FR', label: 'Français', dir: 'ltr', isDefault: false },
{ code: 'tr', bcp47: 'tr-TR', label: 'Türkçe', dir: 'ltr', isDefault: false },
{ code: 'zh', bcp47: 'zh-CN', label: '中文', dir: 'ltr', isDefault: false },
{ code: 'ru', bcp47: 'ru-RU', label: 'Русский', dir: 'ltr', isDefault: false },
{ code: 'uk', bcp47: 'uk-UA', label: 'Українська', dir: 'ltr', isDefault: false },
{ code: 'ar', bcp47: 'ar', label: 'العربية', dir: 'rtl', isDefault: false },
{ code: 'ja', bcp47: 'ja-JP', label: '日本語', dir: 'ltr', isDefault: false },
{ code: 'ko', bcp47: 'ko-KR', label: '한국어', dir: 'ltr', isDefault: false },
{ code: 'id', bcp47: 'id-ID', label: 'Bahasa Indonesia', dir: 'ltr', isDefault: false },
{ code: 'th', bcp47: 'th-TH', label: 'ไทย', dir: 'ltr', isDefault: false },
{ code: 'ms', bcp47: 'ms-MY', label: 'Bahasa Melayu', dir: 'ltr', isDefault: false },
{ code: 'tl', bcp47: 'fil-PH', label: 'Filipino', dir: 'ltr', isDefault: false },
{ code: 'he', bcp47: 'he-IL', label: 'עברית', dir: 'rtl', isDefault: false },
{ code: 'hi', bcp47: 'hi-IN', label: 'हिन्दी', dir: 'ltr', isDefault: false },
{ code: 'pt', bcp47: 'pt-BR', label: 'Português', dir: 'ltr', isDefault: false },
{ code: 'vi', bcp47: 'vi-VN', label: 'Tiếng Việt', dir: 'ltr', isDefault: false },
{ code: 'bn', bcp47: 'bn-BD', label: 'বাংলা', dir: 'ltr', isDefault: false },
{ code: 'fa', bcp47: 'fa-IR', label: 'فارسی', dir: 'rtl', isDefault: false },
{ code: 'nl', bcp47: 'nl-NL', label: 'Nederlands', dir: 'ltr', isDefault: false },
{ code: 'de', bcp47: 'de-DE', label: 'Deutsch', dir: 'ltr', isDefault: false },
];
const LOCALES = JSON.parse(await readFile(new URL('./languages.json', import.meta.url), 'utf8'));

// Keep the website on the same bundled 4:3 flag artwork as the extension
// language picker. The web build copies only the flags used by web locales.
Expand Down Expand Up @@ -570,7 +547,7 @@ async function main() {
await cp(path.join(ROOT, '..', 'webbrain-systray', 'web'), path.join(ROOT, 'companion'), {
recursive: true,
force: true,
filter: (source) => !['build.py', 'README.md', 'tools'].includes(path.basename(source)),
filter: (source) => !['build.py', 'README.md', 'tools', 'locales', '__pycache__'].includes(path.basename(source)),
});

// Load English first so others can fall back for missing keys.
Expand Down Expand Up @@ -645,8 +622,7 @@ async function main() {
{ loc: `${SITE_ORIGIN}/docs/settings/` },
{ loc: `${SITE_ORIGIN}/docs/captcha/` },
{ loc: `${SITE_ORIGIN}/docs/providers/` },
{ loc: `${SITE_ORIGIN}/companion/` },
{ loc: `${SITE_ORIGIN}/companion/tr/` },
...LOCALES.map((locale) => ({ loc: `${SITE_ORIGIN}/companion/${locale.isDefault ? '' : `${locale.code}/`}` })),
{ loc: `${SITE_ORIGIN}/docs/easy-cli-proxy/`, alternates: 'easy-cli-proxy' },
{ loc: `${SITE_ORIGIN}/docs/safety/` },
{ loc: `${SITE_ORIGIN}/docs/apocalypse-mode/` },
Expand Down
3 changes: 2 additions & 1 deletion web/build/build.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ before(async () => {
sandbox = await mkdtemp(path.join(os.tmpdir(), 'webbrain-build-import-'));
await copyFile(new URL('./build.mjs', import.meta.url), path.join(sandbox, 'build.mjs'));
await copyFile(new URL('./plausible.mjs', import.meta.url), path.join(sandbox, 'plausible.mjs'));
await copyFile(new URL('./languages.json', import.meta.url), path.join(sandbox, 'languages.json'));
const script = 'const module = await import(' +
JSON.stringify(pathToFileURL(path.join(sandbox, 'build.mjs')).href) +
'); process.stdout.write(JSON.stringify(Object.keys(module).sort()));';
Expand All @@ -37,7 +38,7 @@ before(async () => {
assert.equal(result.stderr, '');
isolatedExports = JSON.parse(result.stdout);
assert.deepEqual(isolatedExports, exportNames);
assert.deepEqual((await readdir(sandbox)).sort(), ['build.mjs', 'plausible.mjs']);
assert.deepEqual((await readdir(sandbox)).sort(), ['build.mjs', 'languages.json', 'plausible.mjs']);
builder = await import('./build.mjs');
});

Expand Down
156 changes: 156 additions & 0 deletions web/build/languages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
[
{
"code": "en",
"bcp47": "en-US",
"label": "English",
"dir": "ltr",
"isDefault": true
},
{
"code": "es",
"bcp47": "es-ES",
"label": "Español",
"dir": "ltr",
"isDefault": false
},
{
"code": "fr",
"bcp47": "fr-FR",
"label": "Français",
"dir": "ltr",
"isDefault": false
},
{
"code": "tr",
"bcp47": "tr-TR",
"label": "Türkçe",
"dir": "ltr",
"isDefault": false
},
{
"code": "zh",
"bcp47": "zh-CN",
"label": "中文",
"dir": "ltr",
"isDefault": false
},
{
"code": "ru",
"bcp47": "ru-RU",
"label": "Русский",
"dir": "ltr",
"isDefault": false
},
{
"code": "uk",
"bcp47": "uk-UA",
"label": "Українська",
"dir": "ltr",
"isDefault": false
},
{
"code": "ar",
"bcp47": "ar",
"label": "العربية",
"dir": "rtl",
"isDefault": false
},
{
"code": "ja",
"bcp47": "ja-JP",
"label": "日本語",
"dir": "ltr",
"isDefault": false
},
{
"code": "ko",
"bcp47": "ko-KR",
"label": "한국어",
"dir": "ltr",
"isDefault": false
},
{
"code": "id",
"bcp47": "id-ID",
"label": "Bahasa Indonesia",
"dir": "ltr",
"isDefault": false
},
{
"code": "th",
"bcp47": "th-TH",
"label": "ไทย",
"dir": "ltr",
"isDefault": false
},
{
"code": "ms",
"bcp47": "ms-MY",
"label": "Bahasa Melayu",
"dir": "ltr",
"isDefault": false
},
{
"code": "tl",
"bcp47": "fil-PH",
"label": "Filipino",
"dir": "ltr",
"isDefault": false
},
{
"code": "he",
"bcp47": "he-IL",
"label": "עברית",
"dir": "rtl",
"isDefault": false
},
{
"code": "hi",
"bcp47": "hi-IN",
"label": "हिन्दी",
"dir": "ltr",
"isDefault": false
},
{
"code": "pt",
"bcp47": "pt-BR",
"label": "Português",
"dir": "ltr",
"isDefault": false
},
{
"code": "vi",
"bcp47": "vi-VN",
"label": "Tiếng Việt",
"dir": "ltr",
"isDefault": false
},
{
"code": "bn",
"bcp47": "bn-BD",
"label": "বাংলা",
"dir": "ltr",
"isDefault": false
},
{
"code": "fa",
"bcp47": "fa-IR",
"label": "فارسی",
"dir": "rtl",
"isDefault": false
},
{
"code": "nl",
"bcp47": "nl-NL",
"label": "Nederlands",
"dir": "ltr",
"isDefault": false
},
{
"code": "de",
"bcp47": "de-DE",
"label": "Deutsch",
"dir": "ltr",
"isDefault": false
}
]
4 changes: 2 additions & 2 deletions web/build/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2628,7 +2628,7 @@
.download-section {
text-align: center;
}
.download-companion { margin-top: 14px; font-size: 14px; }
.download-companion { margin-top: 24px; font-size: 14px; }
.download-companion a { color: var(--accent2); text-decoration: underline; text-underline-offset: 4px; }
.download-companion a:hover { color: var(--text); }
.download-companion a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
Expand Down Expand Up @@ -4138,7 +4138,6 @@ <h2 class="section-title">{{t:faq.title}}</h2>
<div class="section-label">{{t:download.label}}</div>
<h2 class="section-title">{{t:download.title}}</h2>
<p class="section-subtitle">{{t:download.subtitle}}</p>
<p class="download-companion"><a href="https://www.webbrain.one/companion/">WebBrain Companion <span aria-hidden="true">→</span></a></p>

<div class="download-cards" data-download-cards>
<div class="download-row download-row-current" data-download-current>
Expand Down Expand Up @@ -4189,6 +4188,7 @@ <h3>{{t:download.edge.name}}</h3>
</div>
</div>
</div>
<p class="download-companion"><a href="https://www.webbrain.one/companion/">WebBrain Companion <span aria-hidden="true">→</span></a></p>
</section>

<!-- 9. FOR DEVELOPERS (MCP & Frameworks) -->
Expand Down
Loading
Loading