Skip to content

Commit 020d3cd

Browse files
Merge pull request #2 from ohernandezdev/feat/i18n-fr-it
feat(i18n): add French and Italian, fix untranslated mode badge
2 parents 0afc552 + 2c14230 commit 020d3cd

8 files changed

Lines changed: 268 additions & 14 deletions

File tree

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ <h2 data-i18n="settingsTitle"></h2>
210210
<select id="sel-lang">
211211
<option value="es">Español</option>
212212
<option value="en">English</option>
213+
<option value="fr">Français</option>
214+
<option value="it">Italiano</option>
213215
</select>
214216
</div>
215217
<div class="set-row">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "afkode",
33
"private": true,
4-
"version": "0.8.4",
4+
"version": "0.8.5",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "afkode"
3-
version = "0.8.4"
3+
version = "0.8.5"
44
description = "In-game overlay to supervise AI coding agents while you play"
55
authors = ["Omar Hernandez"]
66
license = "MIT"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "AFKode",
4-
"version": "0.8.4",
4+
"version": "0.8.5",
55
"identifier": "app.afkode.overlay",
66
"build": {
77
"beforeDevCommand": "npm run dev",

src/hud.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ const altX = navigator.platform.toUpperCase().includes("MAC") ? "⌥X" : "Alt+X"
6565
function localizeTooltip() {
6666
try {
6767
const lang = JSON.parse(localStorage.getItem("settings") ?? "{}").lang;
68-
openBtn.title = lang === "es" ? `Abrir overlay (${altX})` : `Open overlay (${altX})`;
68+
const open: Record<string, string> = {
69+
es: `Abrir overlay (${altX})`,
70+
en: `Open overlay (${altX})`,
71+
fr: `Ouvrir l'overlay (${altX})`,
72+
it: `Apri l'overlay (${altX})`,
73+
};
74+
openBtn.title = open[lang] ?? open.en;
6975
replyBtn.title = altX.replace("X", "P");
7076
} catch {
7177
/* keep default */

src/main.ts

Lines changed: 245 additions & 3 deletions
Large diffs are not rendered by default.

src/palette.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,22 @@ let sugs: Suggestion[] = [];
4949
let sel = -1;
5050
let debounceTimer = 0;
5151

52-
function isEs(): boolean {
52+
function uiLang(): string {
5353
try {
54-
return JSON.parse(localStorage.getItem("settings") ?? "{}").lang === "es";
54+
return JSON.parse(localStorage.getItem("settings") ?? "{}").lang ?? "en";
5555
} catch {
56-
return false;
56+
return "en";
5757
}
5858
}
5959

6060
function placeholder(): string {
61-
return isEs()
62-
? "Escribe un prompt… ( / comandos · @ archivos · Tab completa )"
63-
: "Type a prompt… ( / commands · @ files · Tab completes )";
61+
const map: Record<string, string> = {
62+
es: "Escribe un prompt… ( / comandos · @ archivos · Tab completa )",
63+
en: "Type a prompt… ( / commands · @ files · Tab completes )",
64+
fr: "Écrivez un prompt… ( / commandes · @ fichiers · Tab complète )",
65+
it: "Scrivi un prompt… ( / comandi · @ file · Tab completa )",
66+
};
67+
return map[uiLang()] ?? map.en;
6468
}
6569

6670
function resize() {

0 commit comments

Comments
 (0)