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
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,29 @@ python3 scripts/diagnose_growth_deploy.py --root . --output growth-deploy-diagno
```

The deployment comparison includes all five press pages (12 pages in total). Confirm the hosting provider's actual production source/ref/commit, inspect public HTTP 200, redirects, canonical/hreflang and all five Play links, and verify `press_app_click` in GA4 DebugView. A source merge or static test is **not** a live deployment check. Record results in issue #51. Only promote the published URL after these checks pass; otherwise use verified live app support/store pages.


## Five-language catalog discovery UI (2026-11-13)

The /apps page has browser-language-aware interface labels in English, Japanese,
Spanish, Brazilian Portuguese and Indonesian, plus an explicit language selector.
Category labels, five featured-app descriptions, finder status, empty state, and
selected search synonyms are localized. App card names and descriptions remain
English. No SEO hreflang pages are claimed and canonical stays /apps.
The allowlisted ?lang=es etc. query is UI preference, not an indexed translation.
The ?goal=... filter is preserved during manual language changes.

Search text is never sent to analytics; existing coarse search events remain.
The only new event is catalog_language_selected, carrying the selected locale
and placement without search text or sensitive identifiers.

Run checks:
node --test scripts/test_catalog_search_events.cjs
node --test scripts/test_catalog_locale.cjs
python3 scripts/check_growth_live.py > growth-live-smoke.json

Before claiming a live release, verify the hosting provider deployed SHA and open
/apps?goal=quick-games&lang=es and /apps?lang=ja in a real browser. Confirm 92
cards, filters, language switching, console errors, real store destinations,
and exactly one catalog_language_selected per manual choice in GA4 DebugView.
Record source-vs-live evidence in GitHub issue #51. A merge is not deployment.
222 changes: 216 additions & 6 deletions apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
.store-badge { display:inline-block; margin-top:.4rem; font-size:.78rem; font-weight:600; color:var(--accent); }
footer { text-align:center; color:var(--sub); font-size:.85rem; padding:2rem; }
footer a { color:var(--accent); }
.catalog-locale{margin:1rem auto 0;display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:center}
.catalog-locale label{font-weight:700;font-size:.85rem}
.catalog-locale select{font:inherit;background:var(--card);color:var(--ink);padding:.5rem;border:1px solid var(--line);border-radius:8px}
.catalog-locale select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.catalog-locale p{flex-basis:100%;font-size:.78rem;color:var(--sub);max-width:38rem}
/* Browse purpose or search without hiding cards from non-JS crawlers. */
.finder{margin:0 0 1.5rem;padding:1.1rem;background:var(--card);border:1px solid var(--line);border-radius:14px}
.finder label{display:block;font-weight:700;margin-bottom:.5rem}
Expand Down Expand Up @@ -634,8 +639,17 @@
<body>
<header>
<a class="home" href="/">&larr; SK APPS Home</a>
<h1>All Apps</h1>
<p>Explore our mobile app catalog — productivity, education, health, games and more.</p>
<h1 id="catalog-main-title">All Apps</h1>
<p id="catalog-intro">Explore our mobile app catalog — productivity, education, health, games and more.</p>
<div class="catalog-locale">
<label for="catalog-language">Language / 言語</label>
<select id="catalog-language" aria-label="Catalog language">
<option value="en">English</option><option value="ja">日本語</option>
<option value="es">Español</option><option value="pt-BR">Português (Brasil)</option>
<option value="id">Bahasa Indonesia</option>
</select>
<p id="catalog-locale-notice">App names and descriptions remain in English; search also recognizes selected translated keywords.</p>
</div>
</header>
<main>
<section class="finder" aria-labelledby="finder-title">
Expand All @@ -659,7 +673,7 @@ <h1>All Apps</h1>
</section>
<section class="finder" aria-labelledby="app-spotlight-title">
<h2 id="app-spotlight-title" style="font-size:1.1rem;margin-bottom:.4rem">Explore app details before installing</h2>
<p style="color:var(--sub);font-size:.9rem;margin-bottom:.6rem">See features, FAQs and privacy information before opening Google Play.</p>
<p id="catalog-spotlight-description" style="color:var(--sub);font-size:.9rem;margin-bottom:.6rem">See features, FAQs and privacy information before opening Google Play.</p>
<nav class="finder-guides" aria-label="App details">
<a href="/support/debate-me/" data-detail-app="debate-me">Debate Me · AI debate practice</a>
<a href="/support/tappitsu-battle/" data-detail-app="tappitsu-battle">Tappitsu Battle · Calligraphy practice</a>
Expand All @@ -668,7 +682,7 @@ <h2 id="app-spotlight-title" style="font-size:1.1rem;margin-bottom:.4rem">Explor
<a href="/support/instant-judge/" data-detail-app="instant-judge">Instant Judge · Community voting</a>
</nav>
</section>
<p id="finder-empty" class="finder-meta" hidden>No matches. <button type="button" id="finder-reset" aria-label="Clear search and show all apps" style="cursor:pointer;color:var(--accent);background:none;border:0;text-decoration:underline;font:inherit;font-weight:600">Clear search and filters</button></p>
<p id="finder-empty" class="finder-meta" hidden><span id="finder-empty-label">No matches.</span> <button type="button" id="finder-reset" aria-label="Clear search and show all apps" style="cursor:pointer;color:var(--accent);background:none;border:0;text-decoration:underline;font:inherit;font-weight:600">Clear search and filters</button></p>
<div class="grid">
<a class="app-card" href="https://play.google.com/store/apps/details?id=jp.appdevelopsk.facesymmetry&amp;utm_source=appdevelopsk&amp;utm_medium=web&amp;utm_campaign=apps_catalog&amp;referrer=utm_source%3Dappdevelopsk%26utm_medium%3Dweb%26utm_campaign%3Dapps_catalog" target="_blank" rel="noopener">
<img src="icons/apps/face-symmetry.png" alt="HangTrue - Level Checker icon" loading="lazy" width="64" height="64">
Expand Down Expand Up @@ -1455,13 +1469,13 @@ <h3>Chaos - Stranger Missions</h3>
let shown = 0;
cards.forEach(card => {
// Include the stable catalog slug so former/internal app names stay findable.
const app = slug(card), content = clean((card.textContent || '') + ' ' + app + ' ' + app.replace(/-/g, ' '));
const app = slug(card), content = clean((card.textContent || '') + ' ' + app + ' ' + app.replace(/-/g, ' ') + ' ' + ((window.catalogSearchAliases || {})[app] || ''));
const inGoal = goal === 'all' || (groups[goal] || []).includes(app);
const visible = inGoal && terms.every(term => content.includes(term));
card.hidden = !visible;
if (visible) shown++;
});
count.textContent = shown + ' apps shown';
count.textContent = window.catalogLocaleCount ? window.catalogLocaleCount(shown) : shown + ' apps shown';
empty.hidden = shown !== 0;
return shown;
}
Expand Down Expand Up @@ -1542,5 +1556,201 @@ <h3>Chaos - Stranger Missions</h3>
}
})();
</script>
<!-- CATALOG_LOCALE_START: browser-only UI labels, no SEO hreflang claim -->
<script>
(() => {
'use strict';
const translations = {
"en": {
"title": "All Apps",
"intro": "Explore our mobile app catalog — productivity, education, health, games and more.",
"label": "Find an app for what you want to do",
"placeholder": "Try: photo quiz, sleep, journal, debate, food",
"goals": [
"All apps",
"Quick games",
"Daily habits",
"Decision helpers",
"AI tools"
],
"count": "apps shown",
"empty": "No matches.",
"reset": "Clear search and filters",
"spotlight": "Explore app details before installing",
"detail": "See features, FAQs and privacy information before opening Google Play.",
"notice": "App names and descriptions remain in English; search also recognizes selected translated keywords.",
"focus": [
"AI debate practice",
"Calligraphy practice",
"Reflection",
"This-or-that polls",
"Community voting"
]
},
"ja": {
"title": "アプリ一覧",
"intro": "ゲーム・学習・暮らしに役立つアプリを探せます。",
"label": "目的に合ったアプリを検索",
"placeholder": "例:写真、睡眠、日記、ディベート、食事",
"goals": [
"すべて",
"手軽なゲーム",
"毎日の習慣",
"決断のサポート",
"AIツール"
],
"count": "件のアプリを表示",
"empty": "該当するアプリはありません。",
"reset": "検索と絞り込みを解除",
"spotlight": "インストール前にアプリの詳細を見る",
"detail": "機能・FAQ・プライバシー情報を確認してからGoogle Playへ進めます。",
"notice": "アプリ名と詳細説明は英語です。一部の日本語キーワードでも検索できます。",
"focus": [
"AIディベート練習",
"書道の練習",
"未来を振り返る",
"二択投票",
"みんなの投票"
]
},
"es": {
"title": "Todas las apps",
"intro": "Explora apps de productividad, aprendizaje, juegos y herramientas para el día a día.",
"label": "Busca una app según lo que quieras hacer",
"placeholder": "Prueba: foto, sueño, diario, debate, comida",
"goals": [
"Todas",
"Juegos rápidos",
"Hábitos diarios",
"Ayuda para decidir",
"Herramientas de IA"
],
"count": "apps mostradas",
"empty": "No hay resultados.",
"reset": "Borrar búsqueda y filtros",
"spotlight": "Conoce las apps antes de instalarlas",
"detail": "Consulta funciones, preguntas frecuentes y privacidad antes de abrir Google Play.",
"notice": "Los nombres y las descripciones de las apps siguen en inglés; puedes buscar algunas palabras en español.",
"focus": [
"Debate con IA",
"Práctica de caligrafía",
"Reflexión",
"Encuestas A o B",
"Votación comunitaria"
]
},
"pt-BR": {
"title": "Todos os apps",
"intro": "Explore apps de produtividade, aprendizado, jogos e ferramentas para o dia a dia.",
"label": "Encontre um app para o que você precisa",
"placeholder": "Tente: foto, sono, diário, debate, comida",
"goals": [
"Todos",
"Jogos rápidos",
"Hábitos diários",
"Ajuda para decidir",
"Ferramentas de IA"
],
"count": "apps exibidos",
"empty": "Nenhum resultado.",
"reset": "Limpar pesquisa e filtros",
"spotlight": "Conheça os apps antes de instalar",
"detail": "Veja recursos, dúvidas frequentes e privacidade antes de abrir o Google Play.",
"notice": "Os nomes e as descrições continuam em inglês; algumas palavras em português também funcionam na busca.",
"focus": [
"Debate com IA",
"Prática de caligrafia",
"Reflexão",
"Enquetes A ou B",
"Votação da comunidade"
]
},
"id": {
"title": "Semua aplikasi",
"intro": "Jelajahi aplikasi produktivitas, pembelajaran, permainan, dan alat sehari-hari.",
"label": "Cari aplikasi sesuai kebutuhanmu",
"placeholder": "Coba: foto, tidur, jurnal, debat, makanan",
"goals": [
"Semua",
"Game cepat",
"Kebiasaan harian",
"Bantu memilih",
"Alat AI"
],
"count": "aplikasi ditampilkan",
"empty": "Tidak ada hasil.",
"reset": "Hapus pencarian dan filter",
"spotlight": "Lihat detail sebelum memasang",
"detail": "Periksa fitur, FAQ, dan privasi sebelum membuka Google Play.",
"notice": "Nama dan deskripsi aplikasi masih berbahasa Inggris; beberapa kata dalam bahasa Indonesia juga bisa dicari.",
"focus": [
"Latihan debat AI",
"Latihan kaligrafi",
"Refleksi",
"Polling A atau B",
"Voting komunitas"
]
}
};
const languageSelect = document.getElementById('catalog-language');
if (!languageSelect) return;
const locales = Object.keys(translations);
const fromBrowser = String((navigator.languages && navigator.languages[0]) || navigator.language || 'en').toLowerCase();
const query = new URLSearchParams(window.location.search).get('lang');
const browserLocale = fromBrowser.startsWith('pt') ? 'pt-BR' : fromBrowser.slice(0, 2);
const initial = locales.includes(query) ? query : (locales.includes(browserLocale) ? browserLocale : 'en');
const ids = {
title: 'catalog-main-title', intro: 'catalog-intro', label: 'finder-title',
empty: 'finder-empty-label', reset: 'finder-reset',
spotlight: 'app-spotlight-title', detail: 'catalog-spotlight-description',
notice: 'catalog-locale-notice'
};
const aliases = {
blur: 'foto borrosa imagen borrosa foto desfocada adivinhar imagem 写真 ぼかし 写真当て tebak gambar buram',
twotaku: 'encuesta dos opciones voto enquete votação escolha 二択 投票 pilihan polling',
'instant-judge': 'dilemas votación comunidade 判定 投票 dilema komunitas',
'debate-me': 'argumentos argumentação 討論 ディベート debat argumen',
'future-me': 'futuro futuro reflexões 未来 将来 masa depan prediksi'
};
const renderLocale = (locale, userSelected) => {
const key = locales.includes(locale) ? locale : 'en';
const t = translations[key];
document.documentElement.lang = key;
languageSelect.value = key;
Object.entries(ids).forEach(([field, id]) => {
const element = document.getElementById(id);
if (element) element.textContent = t[field];
});
const search = document.getElementById('find-app');
if (search) search.setAttribute('placeholder', t.placeholder);
const filters = document.querySelectorAll('.finder-filters button');
filters.forEach((button, index) => {
if (t.goals[index]) button.textContent = t.goals[index];
});
const detailLinks = document.querySelectorAll('[data-detail-app]');
detailLinks.forEach((link, index) => {
if (t.focus[index]) {
const appName = link.textContent.split(' · ')[0];
link.textContent = appName + ' · ' + t.focus[index];
}
});
window.catalogLocaleCount = count => String(count) + ' ' + t.count;
window.catalogSearchAliases = aliases;
if (search) search.dispatchEvent(new Event('input'));
if (userSelected) {
const url = new URL(window.location.href);
if (key === 'en') url.searchParams.delete('lang');
else url.searchParams.set('lang', key);
window.history.replaceState(window.history.state, '', url.pathname + url.search + url.hash);
if (typeof window.gtag === 'function') {
window.gtag('event', 'catalog_language_selected', {locale:key, placement:'catalog_selector'});
}
}
};
languageSelect.addEventListener('change', () => renderLocale(languageSelect.value, true));
renderLocale(initial, false);
})();
</script>
<!-- CATALOG_LOCALE_END -->
</body>
</html>
95 changes: 95 additions & 0 deletions scripts/test_catalog_locale.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
'use strict';
// Offline exercise of the actual catalog localization IIFE (no network/DOM library).
// Run: node --test scripts/test_catalog_locale.cjs
const test = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const vm = require('node:vm');

const html = fs.readFileSync(path.join(__dirname, '..', 'apps.html'), 'utf8');
const match = html.match(/<!-- CATALOG_LOCALE_START[^]*?<script>([^]*?)<\/script>\s*<!-- CATALOG_LOCALE_END -->/);
assert.ok(match && match[1], 'catalog locale controller should be embedded exactly once');
const code = match[1];

function boot(url, browserLanguage) {
const nodes = new Map();
const createNode = (textContent = '') => ({
value: '', textContent, listeners: {}, attributes: {},
addEventListener(name, callback) { this.listeners[name] = callback; },
dispatchEvent(event) { if (this.listeners[event.type]) this.listeners[event.type](event); },
setAttribute(name, value) { this.attributes[name] = value; },
});
for (const id of ['catalog-language', 'catalog-main-title', 'catalog-intro', 'finder-title',
'finder-empty-label', 'finder-reset', 'app-spotlight-title',
'catalog-spotlight-description', 'catalog-locale-notice', 'find-app']) {
nodes.set(id, createNode());
}
const filters = Array.from({ length: 5 }, () => createNode());
const links = ['Debate Me','Tappitsu Battle','FutureMe','Dotchi','Instant Judge']
.map(name => createNode(name + ' · Original English'));
const events = [];
const window = {
location: { href: url, search: new URL(url).search }, history: {
state: {}, replaceState(state, title, route) {
window.location.href = new URL(route, window.location.href).href;
window.location.search = new URL(window.location.href).search;
}
},
gtag(...args) { events.push(args); },
};
const document = {
documentElement: { lang: 'en' },
getElementById: id => nodes.get(id),
querySelectorAll: selector => {
if (selector === '.finder-filters button') return filters;
if (selector === '[data-detail-app]') return links;
throw Error('unexpected selector: ' + selector);
},
};
vm.runInNewContext(code, {
document, window, navigator: { languages: [browserLanguage] }, URL,
URLSearchParams, Event: class { constructor(type) { this.type = type; } },
});
return { nodes, filters, links, events, window, document };
}

test('five-language finder preserves 92 catalog cards and original analytics', () => {
assert.equal((html.match(/class="app-card"/g) || []).length, 92);
for (const name of ['catalog_search_used', 'catalog_filter_used', 'download_click', 'catalog_store_click']) {
assert.ok(html.includes(name), name + ' must remain present');
}
});

test('explicit locale overrides browser language without analytics event', () => {
const ui = boot('https://appdevelopsk.com/apps?goal=ai&lang=es', 'ja-JP');
assert.equal(ui.document.documentElement.lang, 'es');
assert.equal(ui.filters[1].textContent, 'Juegos rápidos');
assert.equal(ui.window.catalogLocaleCount(7), '7 apps mostradas');
assert.equal(ui.events.length, 0);
assert.ok(ui.window.location.href.includes('goal=ai'));
assert.ok(ui.window.catalogSearchAliases.twotaku.includes('encuesta'));
});

test('language change retains goal, tracks selected locale only', () => {
const ui = boot('https://appdevelopsk.com/apps?goal=habits&lang=es', 'en-US');
const picker = ui.nodes.get('catalog-language');
picker.value = 'id';
picker.listeners.change();
assert.equal(ui.document.documentElement.lang, 'id');
assert.equal(ui.window.catalogLocaleCount(2), '2 aplikasi ditampilkan');
assert.equal(ui.events.length, 1);
assert.equal(ui.events[0][1], 'catalog_language_selected');
assert.deepEqual(Object.keys(ui.events[0][2]).sort(), ['locale','placement']);
assert.equal(ui.events[0][2].locale, 'id');
const updated = new URL(ui.window.location.href);
assert.equal(updated.searchParams.get('goal'), 'habits');
assert.equal(updated.searchParams.get('lang'), 'id');
});

test('invalid query locale falls back safely to browser locale', () => {
const ui = boot('https://appdevelopsk.com/apps?lang=%3Cscript%3E', 'ja-JP');
assert.equal(ui.document.documentElement.lang, 'ja');
assert.equal(ui.nodes.get('catalog-main-title').textContent, 'アプリ一覧');
assert.equal(ui.events.length, 0);
});
Loading