Skip to content

Commit d8ab7cc

Browse files
authored
Growth: localized five-language catalog discovery without changing store attribution (#114)
* growth: localize 92-app catalog discovery UI for 5 regions, retain accessible English content * test: cover 5-language catalog selector, safe URL handling and analytics * docs: catalog international UX rollout validation and source-vs-live gates * test: provide real location.search in catalog VM browser mock
1 parent 499ff5a commit d8ab7cc

3 files changed

Lines changed: 337 additions & 6 deletions

File tree

‎README.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,29 @@ python3 scripts/diagnose_growth_deploy.py --root . --output growth-deploy-diagno
6767
```
6868

6969
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.
70+
71+
72+
## Five-language catalog discovery UI (2026-11-13)
73+
74+
The /apps page has browser-language-aware interface labels in English, Japanese,
75+
Spanish, Brazilian Portuguese and Indonesian, plus an explicit language selector.
76+
Category labels, five featured-app descriptions, finder status, empty state, and
77+
selected search synonyms are localized. App card names and descriptions remain
78+
English. No SEO hreflang pages are claimed and canonical stays /apps.
79+
The allowlisted ?lang=es etc. query is UI preference, not an indexed translation.
80+
The ?goal=... filter is preserved during manual language changes.
81+
82+
Search text is never sent to analytics; existing coarse search events remain.
83+
The only new event is catalog_language_selected, carrying the selected locale
84+
and placement without search text or sensitive identifiers.
85+
86+
Run checks:
87+
node --test scripts/test_catalog_search_events.cjs
88+
node --test scripts/test_catalog_locale.cjs
89+
python3 scripts/check_growth_live.py > growth-live-smoke.json
90+
91+
Before claiming a live release, verify the hosting provider deployed SHA and open
92+
/apps?goal=quick-games&lang=es and /apps?lang=ja in a real browser. Confirm 92
93+
cards, filters, language switching, console errors, real store destinations,
94+
and exactly one catalog_language_selected per manual choice in GA4 DebugView.
95+
Record source-vs-live evidence in GitHub issue #51. A merge is not deployment.

‎apps.html‎

Lines changed: 216 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
.store-badge { display:inline-block; margin-top:.4rem; font-size:.78rem; font-weight:600; color:var(--accent); }
3030
footer { text-align:center; color:var(--sub); font-size:.85rem; padding:2rem; }
3131
footer a { color:var(--accent); }
32+
.catalog-locale{margin:1rem auto 0;display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:center}
33+
.catalog-locale label{font-weight:700;font-size:.85rem}
34+
.catalog-locale select{font:inherit;background:var(--card);color:var(--ink);padding:.5rem;border:1px solid var(--line);border-radius:8px}
35+
.catalog-locale select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
36+
.catalog-locale p{flex-basis:100%;font-size:.78rem;color:var(--sub);max-width:38rem}
3237
/* Browse purpose or search without hiding cards from non-JS crawlers. */
3338
.finder{margin:0 0 1.5rem;padding:1.1rem;background:var(--card);border:1px solid var(--line);border-radius:14px}
3439
.finder label{display:block;font-weight:700;margin-bottom:.5rem}
@@ -634,8 +639,17 @@
634639
<body>
635640
<header>
636641
<a class="home" href="/">&larr; SK APPS Home</a>
637-
<h1>All Apps</h1>
638-
<p>Explore our mobile app catalog — productivity, education, health, games and more.</p>
642+
<h1 id="catalog-main-title">All Apps</h1>
643+
<p id="catalog-intro">Explore our mobile app catalog — productivity, education, health, games and more.</p>
644+
<div class="catalog-locale">
645+
<label for="catalog-language">Language / 言語</label>
646+
<select id="catalog-language" aria-label="Catalog language">
647+
<option value="en">English</option><option value="ja">日本語</option>
648+
<option value="es">Español</option><option value="pt-BR">Português (Brasil)</option>
649+
<option value="id">Bahasa Indonesia</option>
650+
</select>
651+
<p id="catalog-locale-notice">App names and descriptions remain in English; search also recognizes selected translated keywords.</p>
652+
</div>
639653
</header>
640654
<main>
641655
<section class="finder" aria-labelledby="finder-title">
@@ -659,7 +673,7 @@ <h1>All Apps</h1>
659673
</section>
660674
<section class="finder" aria-labelledby="app-spotlight-title">
661675
<h2 id="app-spotlight-title" style="font-size:1.1rem;margin-bottom:.4rem">Explore app details before installing</h2>
662-
<p style="color:var(--sub);font-size:.9rem;margin-bottom:.6rem">See features, FAQs and privacy information before opening Google Play.</p>
676+
<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>
663677
<nav class="finder-guides" aria-label="App details">
664678
<a href="/support/debate-me/" data-detail-app="debate-me">Debate Me · AI debate practice</a>
665679
<a href="/support/tappitsu-battle/" data-detail-app="tappitsu-battle">Tappitsu Battle · Calligraphy practice</a>
@@ -668,7 +682,7 @@ <h2 id="app-spotlight-title" style="font-size:1.1rem;margin-bottom:.4rem">Explor
668682
<a href="/support/instant-judge/" data-detail-app="instant-judge">Instant Judge · Community voting</a>
669683
</nav>
670684
</section>
671-
<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>
685+
<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>
672686
<div class="grid">
673687
<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">
674688
<img src="icons/apps/face-symmetry.png" alt="HangTrue - Level Checker icon" loading="lazy" width="64" height="64">
@@ -1455,13 +1469,13 @@ <h3>Chaos - Stranger Missions</h3>
14551469
let shown = 0;
14561470
cards.forEach(card => {
14571471
// Include the stable catalog slug so former/internal app names stay findable.
1458-
const app = slug(card), content = clean((card.textContent || '') + ' ' + app + ' ' + app.replace(/-/g, ' '));
1472+
const app = slug(card), content = clean((card.textContent || '') + ' ' + app + ' ' + app.replace(/-/g, ' ') + ' ' + ((window.catalogSearchAliases || {})[app] || ''));
14591473
const inGoal = goal === 'all' || (groups[goal] || []).includes(app);
14601474
const visible = inGoal && terms.every(term => content.includes(term));
14611475
card.hidden = !visible;
14621476
if (visible) shown++;
14631477
});
1464-
count.textContent = shown + ' apps shown';
1478+
count.textContent = window.catalogLocaleCount ? window.catalogLocaleCount(shown) : shown + ' apps shown';
14651479
empty.hidden = shown !== 0;
14661480
return shown;
14671481
}
@@ -1542,5 +1556,201 @@ <h3>Chaos - Stranger Missions</h3>
15421556
}
15431557
})();
15441558
</script>
1559+
<!-- CATALOG_LOCALE_START: browser-only UI labels, no SEO hreflang claim -->
1560+
<script>
1561+
(() => {
1562+
'use strict';
1563+
const translations = {
1564+
"en": {
1565+
"title": "All Apps",
1566+
"intro": "Explore our mobile app catalog — productivity, education, health, games and more.",
1567+
"label": "Find an app for what you want to do",
1568+
"placeholder": "Try: photo quiz, sleep, journal, debate, food",
1569+
"goals": [
1570+
"All apps",
1571+
"Quick games",
1572+
"Daily habits",
1573+
"Decision helpers",
1574+
"AI tools"
1575+
],
1576+
"count": "apps shown",
1577+
"empty": "No matches.",
1578+
"reset": "Clear search and filters",
1579+
"spotlight": "Explore app details before installing",
1580+
"detail": "See features, FAQs and privacy information before opening Google Play.",
1581+
"notice": "App names and descriptions remain in English; search also recognizes selected translated keywords.",
1582+
"focus": [
1583+
"AI debate practice",
1584+
"Calligraphy practice",
1585+
"Reflection",
1586+
"This-or-that polls",
1587+
"Community voting"
1588+
]
1589+
},
1590+
"ja": {
1591+
"title": "アプリ一覧",
1592+
"intro": "ゲーム・学習・暮らしに役立つアプリを探せます。",
1593+
"label": "目的に合ったアプリを検索",
1594+
"placeholder": "例:写真、睡眠、日記、ディベート、食事",
1595+
"goals": [
1596+
"すべて",
1597+
"手軽なゲーム",
1598+
"毎日の習慣",
1599+
"決断のサポート",
1600+
"AIツール"
1601+
],
1602+
"count": "件のアプリを表示",
1603+
"empty": "該当するアプリはありません。",
1604+
"reset": "検索と絞り込みを解除",
1605+
"spotlight": "インストール前にアプリの詳細を見る",
1606+
"detail": "機能・FAQ・プライバシー情報を確認してからGoogle Playへ進めます。",
1607+
"notice": "アプリ名と詳細説明は英語です。一部の日本語キーワードでも検索できます。",
1608+
"focus": [
1609+
"AIディベート練習",
1610+
"書道の練習",
1611+
"未来を振り返る",
1612+
"二択投票",
1613+
"みんなの投票"
1614+
]
1615+
},
1616+
"es": {
1617+
"title": "Todas las apps",
1618+
"intro": "Explora apps de productividad, aprendizaje, juegos y herramientas para el día a día.",
1619+
"label": "Busca una app según lo que quieras hacer",
1620+
"placeholder": "Prueba: foto, sueño, diario, debate, comida",
1621+
"goals": [
1622+
"Todas",
1623+
"Juegos rápidos",
1624+
"Hábitos diarios",
1625+
"Ayuda para decidir",
1626+
"Herramientas de IA"
1627+
],
1628+
"count": "apps mostradas",
1629+
"empty": "No hay resultados.",
1630+
"reset": "Borrar búsqueda y filtros",
1631+
"spotlight": "Conoce las apps antes de instalarlas",
1632+
"detail": "Consulta funciones, preguntas frecuentes y privacidad antes de abrir Google Play.",
1633+
"notice": "Los nombres y las descripciones de las apps siguen en inglés; puedes buscar algunas palabras en español.",
1634+
"focus": [
1635+
"Debate con IA",
1636+
"Práctica de caligrafía",
1637+
"Reflexión",
1638+
"Encuestas A o B",
1639+
"Votación comunitaria"
1640+
]
1641+
},
1642+
"pt-BR": {
1643+
"title": "Todos os apps",
1644+
"intro": "Explore apps de produtividade, aprendizado, jogos e ferramentas para o dia a dia.",
1645+
"label": "Encontre um app para o que você precisa",
1646+
"placeholder": "Tente: foto, sono, diário, debate, comida",
1647+
"goals": [
1648+
"Todos",
1649+
"Jogos rápidos",
1650+
"Hábitos diários",
1651+
"Ajuda para decidir",
1652+
"Ferramentas de IA"
1653+
],
1654+
"count": "apps exibidos",
1655+
"empty": "Nenhum resultado.",
1656+
"reset": "Limpar pesquisa e filtros",
1657+
"spotlight": "Conheça os apps antes de instalar",
1658+
"detail": "Veja recursos, dúvidas frequentes e privacidade antes de abrir o Google Play.",
1659+
"notice": "Os nomes e as descrições continuam em inglês; algumas palavras em português também funcionam na busca.",
1660+
"focus": [
1661+
"Debate com IA",
1662+
"Prática de caligrafia",
1663+
"Reflexão",
1664+
"Enquetes A ou B",
1665+
"Votação da comunidade"
1666+
]
1667+
},
1668+
"id": {
1669+
"title": "Semua aplikasi",
1670+
"intro": "Jelajahi aplikasi produktivitas, pembelajaran, permainan, dan alat sehari-hari.",
1671+
"label": "Cari aplikasi sesuai kebutuhanmu",
1672+
"placeholder": "Coba: foto, tidur, jurnal, debat, makanan",
1673+
"goals": [
1674+
"Semua",
1675+
"Game cepat",
1676+
"Kebiasaan harian",
1677+
"Bantu memilih",
1678+
"Alat AI"
1679+
],
1680+
"count": "aplikasi ditampilkan",
1681+
"empty": "Tidak ada hasil.",
1682+
"reset": "Hapus pencarian dan filter",
1683+
"spotlight": "Lihat detail sebelum memasang",
1684+
"detail": "Periksa fitur, FAQ, dan privasi sebelum membuka Google Play.",
1685+
"notice": "Nama dan deskripsi aplikasi masih berbahasa Inggris; beberapa kata dalam bahasa Indonesia juga bisa dicari.",
1686+
"focus": [
1687+
"Latihan debat AI",
1688+
"Latihan kaligrafi",
1689+
"Refleksi",
1690+
"Polling A atau B",
1691+
"Voting komunitas"
1692+
]
1693+
}
1694+
};
1695+
const languageSelect = document.getElementById('catalog-language');
1696+
if (!languageSelect) return;
1697+
const locales = Object.keys(translations);
1698+
const fromBrowser = String((navigator.languages && navigator.languages[0]) || navigator.language || 'en').toLowerCase();
1699+
const query = new URLSearchParams(window.location.search).get('lang');
1700+
const browserLocale = fromBrowser.startsWith('pt') ? 'pt-BR' : fromBrowser.slice(0, 2);
1701+
const initial = locales.includes(query) ? query : (locales.includes(browserLocale) ? browserLocale : 'en');
1702+
const ids = {
1703+
title: 'catalog-main-title', intro: 'catalog-intro', label: 'finder-title',
1704+
empty: 'finder-empty-label', reset: 'finder-reset',
1705+
spotlight: 'app-spotlight-title', detail: 'catalog-spotlight-description',
1706+
notice: 'catalog-locale-notice'
1707+
};
1708+
const aliases = {
1709+
blur: 'foto borrosa imagen borrosa foto desfocada adivinhar imagem 写真 ぼかし 写真当て tebak gambar buram',
1710+
twotaku: 'encuesta dos opciones voto enquete votação escolha 二択 投票 pilihan polling',
1711+
'instant-judge': 'dilemas votación comunidade 判定 投票 dilema komunitas',
1712+
'debate-me': 'argumentos argumentação 討論 ディベート debat argumen',
1713+
'future-me': 'futuro futuro reflexões 未来 将来 masa depan prediksi'
1714+
};
1715+
const renderLocale = (locale, userSelected) => {
1716+
const key = locales.includes(locale) ? locale : 'en';
1717+
const t = translations[key];
1718+
document.documentElement.lang = key;
1719+
languageSelect.value = key;
1720+
Object.entries(ids).forEach(([field, id]) => {
1721+
const element = document.getElementById(id);
1722+
if (element) element.textContent = t[field];
1723+
});
1724+
const search = document.getElementById('find-app');
1725+
if (search) search.setAttribute('placeholder', t.placeholder);
1726+
const filters = document.querySelectorAll('.finder-filters button');
1727+
filters.forEach((button, index) => {
1728+
if (t.goals[index]) button.textContent = t.goals[index];
1729+
});
1730+
const detailLinks = document.querySelectorAll('[data-detail-app]');
1731+
detailLinks.forEach((link, index) => {
1732+
if (t.focus[index]) {
1733+
const appName = link.textContent.split(' · ')[0];
1734+
link.textContent = appName + ' · ' + t.focus[index];
1735+
}
1736+
});
1737+
window.catalogLocaleCount = count => String(count) + ' ' + t.count;
1738+
window.catalogSearchAliases = aliases;
1739+
if (search) search.dispatchEvent(new Event('input'));
1740+
if (userSelected) {
1741+
const url = new URL(window.location.href);
1742+
if (key === 'en') url.searchParams.delete('lang');
1743+
else url.searchParams.set('lang', key);
1744+
window.history.replaceState(window.history.state, '', url.pathname + url.search + url.hash);
1745+
if (typeof window.gtag === 'function') {
1746+
window.gtag('event', 'catalog_language_selected', {locale:key, placement:'catalog_selector'});
1747+
}
1748+
}
1749+
};
1750+
languageSelect.addEventListener('change', () => renderLocale(languageSelect.value, true));
1751+
renderLocale(initial, false);
1752+
})();
1753+
</script>
1754+
<!-- CATALOG_LOCALE_END -->
15451755
</body>
15461756
</html>

‎scripts/test_catalog_locale.cjs‎

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
'use strict';
2+
// Offline exercise of the actual catalog localization IIFE (no network/DOM library).
3+
// Run: node --test scripts/test_catalog_locale.cjs
4+
const test = require('node:test');
5+
const assert = require('node:assert/strict');
6+
const fs = require('node:fs');
7+
const path = require('node:path');
8+
const vm = require('node:vm');
9+
10+
const html = fs.readFileSync(path.join(__dirname, '..', 'apps.html'), 'utf8');
11+
const match = html.match(/<!-- CATALOG_LOCALE_START[^]*?<script>([^]*?)<\/script>\s*<!-- CATALOG_LOCALE_END -->/);
12+
assert.ok(match && match[1], 'catalog locale controller should be embedded exactly once');
13+
const code = match[1];
14+
15+
function boot(url, browserLanguage) {
16+
const nodes = new Map();
17+
const createNode = (textContent = '') => ({
18+
value: '', textContent, listeners: {}, attributes: {},
19+
addEventListener(name, callback) { this.listeners[name] = callback; },
20+
dispatchEvent(event) { if (this.listeners[event.type]) this.listeners[event.type](event); },
21+
setAttribute(name, value) { this.attributes[name] = value; },
22+
});
23+
for (const id of ['catalog-language', 'catalog-main-title', 'catalog-intro', 'finder-title',
24+
'finder-empty-label', 'finder-reset', 'app-spotlight-title',
25+
'catalog-spotlight-description', 'catalog-locale-notice', 'find-app']) {
26+
nodes.set(id, createNode());
27+
}
28+
const filters = Array.from({ length: 5 }, () => createNode());
29+
const links = ['Debate Me','Tappitsu Battle','FutureMe','Dotchi','Instant Judge']
30+
.map(name => createNode(name + ' · Original English'));
31+
const events = [];
32+
const window = {
33+
location: { href: url, search: new URL(url).search }, history: {
34+
state: {}, replaceState(state, title, route) {
35+
window.location.href = new URL(route, window.location.href).href;
36+
window.location.search = new URL(window.location.href).search;
37+
}
38+
},
39+
gtag(...args) { events.push(args); },
40+
};
41+
const document = {
42+
documentElement: { lang: 'en' },
43+
getElementById: id => nodes.get(id),
44+
querySelectorAll: selector => {
45+
if (selector === '.finder-filters button') return filters;
46+
if (selector === '[data-detail-app]') return links;
47+
throw Error('unexpected selector: ' + selector);
48+
},
49+
};
50+
vm.runInNewContext(code, {
51+
document, window, navigator: { languages: [browserLanguage] }, URL,
52+
URLSearchParams, Event: class { constructor(type) { this.type = type; } },
53+
});
54+
return { nodes, filters, links, events, window, document };
55+
}
56+
57+
test('five-language finder preserves 92 catalog cards and original analytics', () => {
58+
assert.equal((html.match(/class="app-card"/g) || []).length, 92);
59+
for (const name of ['catalog_search_used', 'catalog_filter_used', 'download_click', 'catalog_store_click']) {
60+
assert.ok(html.includes(name), name + ' must remain present');
61+
}
62+
});
63+
64+
test('explicit locale overrides browser language without analytics event', () => {
65+
const ui = boot('https://appdevelopsk.com/apps?goal=ai&lang=es', 'ja-JP');
66+
assert.equal(ui.document.documentElement.lang, 'es');
67+
assert.equal(ui.filters[1].textContent, 'Juegos rápidos');
68+
assert.equal(ui.window.catalogLocaleCount(7), '7 apps mostradas');
69+
assert.equal(ui.events.length, 0);
70+
assert.ok(ui.window.location.href.includes('goal=ai'));
71+
assert.ok(ui.window.catalogSearchAliases.twotaku.includes('encuesta'));
72+
});
73+
74+
test('language change retains goal, tracks selected locale only', () => {
75+
const ui = boot('https://appdevelopsk.com/apps?goal=habits&lang=es', 'en-US');
76+
const picker = ui.nodes.get('catalog-language');
77+
picker.value = 'id';
78+
picker.listeners.change();
79+
assert.equal(ui.document.documentElement.lang, 'id');
80+
assert.equal(ui.window.catalogLocaleCount(2), '2 aplikasi ditampilkan');
81+
assert.equal(ui.events.length, 1);
82+
assert.equal(ui.events[0][1], 'catalog_language_selected');
83+
assert.deepEqual(Object.keys(ui.events[0][2]).sort(), ['locale','placement']);
84+
assert.equal(ui.events[0][2].locale, 'id');
85+
const updated = new URL(ui.window.location.href);
86+
assert.equal(updated.searchParams.get('goal'), 'habits');
87+
assert.equal(updated.searchParams.get('lang'), 'id');
88+
});
89+
90+
test('invalid query locale falls back safely to browser locale', () => {
91+
const ui = boot('https://appdevelopsk.com/apps?lang=%3Cscript%3E', 'ja-JP');
92+
assert.equal(ui.document.documentElement.lang, 'ja');
93+
assert.equal(ui.nodes.get('catalog-main-title').textContent, 'アプリ一覧');
94+
assert.equal(ui.events.length, 0);
95+
});

0 commit comments

Comments
 (0)