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
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ <h2 data-i18n="settingsTitle"></h2>
<select id="sel-lang">
<option value="es">Español</option>
<option value="en">English</option>
<option value="fr">Français</option>
<option value="it">Italiano</option>
</select>
</div>
<div class="set-row">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "afkode",
"private": true,
"version": "0.8.4",
"version": "0.8.5",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "afkode"
version = "0.8.4"
version = "0.8.5"
description = "In-game overlay to supervise AI coding agents while you play"
authors = ["Omar Hernandez"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "AFKode",
"version": "0.8.4",
"version": "0.8.5",
"identifier": "app.afkode.overlay",
"build": {
"beforeDevCommand": "npm run dev",
Expand Down
8 changes: 7 additions & 1 deletion src/hud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ const altX = navigator.platform.toUpperCase().includes("MAC") ? "⌥X" : "Alt+X"
function localizeTooltip() {
try {
const lang = JSON.parse(localStorage.getItem("settings") ?? "{}").lang;
openBtn.title = lang === "es" ? `Abrir overlay (${altX})` : `Open overlay (${altX})`;
const open: Record<string, string> = {
es: `Abrir overlay (${altX})`,
en: `Open overlay (${altX})`,
fr: `Ouvrir l'overlay (${altX})`,
it: `Apri l'overlay (${altX})`,
};
openBtn.title = open[lang] ?? open.en;
replyBtn.title = altX.replace("X", "P");
} catch {
/* keep default */
Expand Down
248 changes: 245 additions & 3 deletions src/main.ts

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions src/palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,22 @@ let sugs: Suggestion[] = [];
let sel = -1;
let debounceTimer = 0;

function isEs(): boolean {
function uiLang(): string {
try {
return JSON.parse(localStorage.getItem("settings") ?? "{}").lang === "es";
return JSON.parse(localStorage.getItem("settings") ?? "{}").lang ?? "en";
} catch {
return false;
return "en";
}
}

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

function resize() {
Expand Down
Loading