Conversation
`autocomplete_lang` was a fixed setting, so a Hebrew search needed one
language and the next English search needed the opposite - manual switching
between every query. detect_language(text) returns "he" the moment any
character in U+0590-U+05FF appears anywhere in the query (reusing the same
Hebrew block prep_search_str already tests a subset of), "en" otherwise;
digits and Latin punctuation never flip it, and a single Hebrew character in
an otherwise-English query is enough ("שובר bad" -> he).
resolve_language(search_str) is the one place that decides the EFFECTIVE
language for a request: if autocomplete_lang is "auto" it calls
detect_language on the text just typed, otherwise it returns the configured
value completely unchanged - an existing install with a real language code
set behaves byte-for-byte as before. The language is passed into each
provider as a constructor kwarg rather than mutated onto a shared setting,
so nothing is global and nothing needs resetting between searches.
Google (hl=) and TMDb (language=) now receive the resolved value. Bing's
build_url never referenced self.language and still doesn't - it was never
asked to change. LocalDictProvider keeps reading its own separate
autocomplete_lang_local setting, untouched.
resources/settings.xml gains a single new `auto` option in the existing
autocomplete_lang spinner; the default stays `en`, so nothing changes for
anyone who hasn't picked it.
13 tests in tests/, covering the exact examples from the request plus the
two guarantees most likely to regress silently: a fixed language must
survive being read again unchanged, and the "auto" sentinel must never reach
a real Google/TMDb request URL. AutoCompletion.py resolves xbmcaddon/xbmcvfs
at import time rather than inside a function, so tests/kodistubs.py fakes
those three modules in sys.modules before import - no third-party test
dependency, consistent with the module's own zero-dependency rule. Also adds
.github/workflows/ci.yml to run compileall + the new tests on every push and
PR (the existing release.yml only runs on a version tag).
Manual verification still needed on real hardware (not reproducible outside
a running Kodi instance): physical-keyboard and virtual-keyboard input both
trigger correct per-query language switching, and no exception appears in
kodi.log for either input method.
Author
|
סוגר - הקוד עובר לריפו שלי (kodi-room-sync) במקום. |
Nemet360
added a commit
to Nemet360/kodi-room-sync
that referenced
this pull request
Oct 3, 2026
Hebrew/English auto-detect language feature was built against a fork of Appz4Fun/plugin.program.autocompletion-voice and offered upstream as a PR. Owner wants his own code living only in his own repo, not upstream — so the whole AutoCompletion add-on (incl. the Hebrew/English auto-detect patch) is copied in full as a second add-on under addon/plugin.program.autocompletion/, discovered automatically by the existing multi-addon build_repository.py. - addon.xml: version normalized to 3.0.1+beta.3 (was 3.0.1-beta.3, invalid per the Kodi manifest schema) and the xbmc.service start="startup" attribute dropped (schema-invalid; "startup" is the documented default when omitted, so behaviour is unchanged) - ci.yml: runs this add-on's own unit tests and includes it in the kodi-addon-checker pass alongside the two existing add-ons - repository/ rebuilt: addons.xml gained the new manifest entry, and the add-on's own zip+hashes were added — the two pre-existing add-ons' zips are untouched (verified byte-identical to HEAD) Upstream PR (Appz4Fun/plugin.program.autocompletion-voice#4) is closed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
`autocomplete_lang` was a fixed setting, so a Hebrew search needed one language and the next English search needed the opposite — manual switching between every query.
Tests
13 tests in `tests/`, covering the exact examples from the request plus the two guarantees most likely to regress silently: a fixed language must survive being read again unchanged, and the `"auto"` sentinel must never reach a real Google/TMDb request URL.
`AutoCompletion.py` resolves `xbmcaddon`/`xbmcvfs` at import time rather than inside a function, so `tests/kodistubs.py` fakes those three modules in `sys.modules` before import — no third-party test dependency, consistent with the module's own zero-dependency rule. Also adds `.github/workflows/ci.yml` to run `compileall` + the new tests on every push and PR (the existing `release.yml` only runs on a version tag).
Manual verification still needed
Not reproducible outside a running Kodi instance:
Changed files