Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
bb5b79a
Fix:duplicate import removed
tiaL-ops Jul 2, 2026
7a8f758
Removed another duplicated import
tiaL-ops Jul 2, 2026
73b980a
Updated schema of chat with tagged language
tiaL-ops Jul 2, 2026
f4524be
Added a function to translate using markeup and LLMtranslation
tiaL-ops Jul 2, 2026
e3e2719
Added a uitext to translate
tiaL-ops Jul 6, 2026
5339ea5
Run local fix to add translation to UI
tiaL-ops Jul 6, 2026
c3f7be4
Improved performance on translate message by grouping by translation
tiaL-ops Jul 6, 2026
883a795
Improved the display : removed the above/below
tiaL-ops Jul 6, 2026
6a10b82
Fetch used translation feature
tiaL-ops Jul 13, 2026
5789aa1
Added a catch to any problem with translation
tiaL-ops Jul 13, 2026
943097c
Fixed merged conflict
tiaL-ops Jul 20, 2026
cd791c5
Reruned npm run local to fix the npm test failure
tiaL-ops Jul 21, 2026
57c553b
Merge with the main
tiaL-ops Jul 27, 2026
3491870
Revert and rerun the npx prettier, test
tiaL-ops Jul 27, 2026
4e6a61e
Fix the removing translation uncorrectness
tiaL-ops Aug 4, 2026
7020694
Taking in account the translation trimming
tiaL-ops Aug 4, 2026
bfa6858
Removed the functions import
tiaL-ops Aug 4, 2026
6989672
Reuse function in translate Markup text
tiaL-ops Aug 4, 2026
5adde5b
Optimized the language chat selection for both reader and sender
tiaL-ops Aug 4, 2026
999124f
Region Friendly deduplication
tiaL-ops Aug 4, 2026
e6e226e
added code search in the chat language
tiaL-ops Aug 4, 2026
3b82129
only had v3
tiaL-ops Aug 4, 2026
e9a0cef
added test on language tag , cache and deletion
tiaL-ops Aug 4, 2026
ca5c3b3
Use one global live region instead of multiple local one
tiaL-ops Aug 4, 2026
3ef44e4
Cleaned the visible label
tiaL-ops Aug 4, 2026
cb49d25
Fixed string issues
tiaL-ops Aug 4, 2026
f0f0140
Move field to translate
tiaL-ops Aug 4, 2026
61a5725
fixed the language inconsiency in json file
tiaL-ops Aug 4, 2026
8854367
Remerge and regenerate locale text
tiaL-ops Aug 5, 2026
6216291
Up to date
tiaL-ops Aug 5, 2026
15f585f
Added to announcer
tiaL-ops Aug 5, 2026
462f541
Rereun without prettier to analyze diif
tiaL-ops Aug 5, 2026
08116fa
Cleaned up changes on json file
tiaL-ops Aug 5, 2026
833d546
Prettier on locales json
tiaL-ops Aug 5, 2026
4c7fa50
Update schema
tiaL-ops Aug 5, 2026
7139465
Merge remote-tracking branch 'upstream/main'
tiaL-ops Aug 9, 2026
9bdc7a0
Removed undefined on report,modify and delete
tiaL-ops Aug 10, 2026
c1e61ad
Fixed cached entries sequence
tiaL-ops Aug 10, 2026
3287b52
All message need to be tagged, preexisting untagged
tiaL-ops Aug 10, 2026
6a662f4
Stale translation
tiaL-ops Aug 10, 2026
771c3fb
New message get translated
tiaL-ops Aug 10, 2026
0a5cef9
added untagged schemas
tiaL-ops Aug 10, 2026
322182c
Separate cached chat and translation
tiaL-ops Aug 10, 2026
52a38b3
Chat trimmed to stay bounded
tiaL-ops Aug 10, 2026
6f5eb5d
Added a limiter on translation
tiaL-ops Aug 10, 2026
6cce31a
Report do not wipe translation cache and added policy
tiaL-ops Aug 10, 2026
666f815
Merge to be up todate
tiaL-ops Aug 10, 2026
aa65776
Local text fix from merge and announcer fix
tiaL-ops Aug 10, 2026
01df954
Remove announcer and fix dedupe on error message by counting
tiaL-ops Aug 10, 2026
655f204
Fix option list rendering
tiaL-ops Aug 10, 2026
6f82620
Fixed accessible nae for placeholder and decription
tiaL-ops Aug 10, 2026
d7afbd3
Fix the untraslated
tiaL-ops Aug 10, 2026
bd9a75a
reaaded dropdown
tiaL-ops Aug 10, 2026
d87617b
Reverted json local
tiaL-ops Aug 10, 2026
a272553
Fix unconsistency
tiaL-ops Aug 10, 2026
5fd2de2
Added tests
tiaL-ops Aug 10, 2026
603e37d
Fixed the chatbased test
tiaL-ops Aug 10, 2026
81861d9
Prettier on chatviewsvelte
tiaL-ops Aug 10, 2026
8dc0a32
Check to revert Locale Schema
tiaL-ops Aug 10, 2026
880cda9
Revert Locale schema
tiaL-ops Aug 10, 2026
1e02cf5
Accidently pushed a delocalizetest
tiaL-ops Aug 10, 2026
ff7721e
Merge branch 'main' into main
tiaL-ops Aug 10, 2026
b32c4b1
Remove the unique local language
tiaL-ops Aug 10, 2026
820f32d
Remove the dedup loop
tiaL-ops Aug 10, 2026
d816fdb
Reverted the uniqueLanguage
tiaL-ops Aug 10, 2026
f01d115
Added await ot tranlaable test
tiaL-ops Aug 10, 2026
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: 1 addition & 1 deletion package-lock.json

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

418 changes: 410 additions & 8 deletions src/components/app/chat/ChatView.svelte

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion src/components/settings/LocaleChooser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,12 @@
.concretize((l) => l.ui.dialog.locale.subheader.supported)
.toText()}</h2
>
<LocaleSearch id="locale-available-search" bind:query />
<LocaleSearch
id="locale-available-search"
placeholder={(l) => l.ui.dialog.locale.search.placeholder}
description={(l) => l.ui.dialog.locale.search.description}
bind:query
/>
</div>
<div class="supported">
{#each availableLocales as supported (supported)}
Expand Down
127 changes: 127 additions & 0 deletions src/components/settings/LocaleCombobox.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<script lang="ts">
/**
* A native <select> dropdown for choosing a locale. All candidates are
* always visible — no typing required. The browser handles keyboard
* navigation, search-by-letter, and announcing the selection to screen
* readers natively. A decorative chevron is layered on top to match the
* intended look; it never intercepts interaction.
*/
import { locales } from '@db/Database';
import { Languages } from '@locale/LanguageCode';
import type { LocaleTextAccessor } from '@locale/Locales';
import { localeToString, type Locale } from '@locale/Locale';
import { getLocaleLanguages } from '@locale/LocaleText';

interface Props {
/** A unique id wired to the underlying <select>. */
id: string;
/** The full candidate list shown as options. */
candidates: Locale[];
/** The currently chosen locale, as a locale string, if any. */
selected: string | undefined;
/** Accessible label for the dropdown. */
label: LocaleTextAccessor;
/** Called with the chosen locale string when the selection changes. */
choose: (localeString: string) => void;
}

let { id, candidates, selected, label, choose }: Props = $props();

let ariaLabel = $derived($locales.getPrimaryPlainText(label));

/** Plain-text name for a locale — mirrors what LocaleName renders. */
function optionText(locale: Locale): string {
const names = getLocaleLanguages(locale)
.map((code) => Languages[code]?.name ?? code)
.join(' + ');
return locale.regions.length > 0
? `${names} (${locale.regions.join('/')})`
: names;
}
</script>

<!--
A plain <select> is the most accessible, searchable, and browsable
dropdown: the browser exposes it natively to screen readers and provides
keyboard search, scroll, and system-native open/close behaviour for free.
The wrapper only positions the decorative chevron.
-->
<div class="locale-field">
<select
{id}
class="locale-select"
aria-label={ariaLabel}
title={$locales.getPlainText(label)}
value={selected ?? ''}
onchange={(e) => {
const v = (e.currentTarget as HTMLSelectElement).value;
if (v) choose(v);
}}
>
<!-- Placeholder shown only when nothing is selected yet. -->
<option value="" disabled>{ariaLabel}</option>
{#each candidates as locale}
<option value={localeToString(locale)}>{optionText(locale)}</option>
{/each}
</select>
<!-- Decorative chevron; the native select underneath owns all clicks. -->
<svg class="chevron" viewBox="0 0 12 8" aria-hidden="true" focusable="false">
<path d="M1 1.5 L6 6.5 L11 1.5" />
</svg>
</div>

<style>
.locale-field {
position: relative;
display: inline-block;
max-width: 16rem;
}

.locale-select {
/* Remove the OS-native arrow so our chevron is the only one shown. */
appearance: none;
-webkit-appearance: none;

width: 100%;
min-height: max(var(--wordplay-widget-height), 24px);
font-family: var(--wordplay-app-font);
font-size: var(--wordplay-small-font-size);
font-weight: var(--wordplay-font-weight);
line-height: 1;
color: inherit;
background: var(--wordplay-background);
border: var(--wordplay-border-width) solid var(--wordplay-border-color);
border-radius: var(--wordplay-border-radius);
/* Reserve trailing space for the chevron. */
padding-block: calc(0.5 * var(--wordplay-spacing-half));
padding-inline: calc(0.75 * var(--wordplay-spacing));
padding-inline-end: calc(2.5 * var(--wordplay-spacing));
cursor: pointer;
}

.locale-select:focus {
outline: var(--wordplay-focus-width) solid var(--wordplay-focus-color);
outline-offset: var(--wordplay-focus-width);
}

.locale-select option[value=''] {
color: var(--wordplay-inactive-color);
}

.chevron {
position: absolute;
inset-inline-end: calc(0.8 * var(--wordplay-spacing));
top: 50%;
width: 0.7rem;
height: 0.5rem;
transform: translateY(-50%);
/* Clicks fall through to the select underneath. */
pointer-events: none;
/* Follow the current text/theme colour. */
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
}
</style>
14 changes: 9 additions & 5 deletions src/components/settings/LocaleSearch.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script module lang="ts">
import type LanguageCode from '@locale/LanguageCode';
import { Languages } from '@locale/LanguageCode';
import type { Locale } from '@locale/Locale';
import { localeToString, type Locale } from '@locale/Locale';
import { Regions } from '@locale/Regions';

/** Filter a list of locale-bearing items by a query that matches an item's
Expand All @@ -23,6 +23,8 @@
const haystack = [
info?.name ?? '', // native name, e.g. "español", "日本語"
info?.en ?? '', // Latin name, e.g. "Spanish"
locale.language, // language code, e.g. "zh"
localeToString(locale), // full locale code, e.g. "zh-CN"
...locale.regions, // region code, e.g. "MX"
...locale.regions.map((r) => Regions[r]?.en ?? ''), // region name, e.g. "Mexico"
]
Expand All @@ -42,15 +44,17 @@
query: string;
/** A unique id for the underlying text field. */
id: string;
placeholder?: LocaleTextAccessor;
description?: LocaleTextAccessor;
/** Placeholder text shown in the search field. */
placeholder: LocaleTextAccessor;
/** ARIA label/description for the search field. */
description: LocaleTextAccessor;
}

let {
query = $bindable(''),
id,
placeholder = (l) => l.ui.dialog.locale.search.placeholder,
description = (l) => l.ui.dialog.locale.search.description,
placeholder,
description,
}: Props = $props();
</script>

Expand Down
Loading
Loading