Skip to content

fix(i18n): normalize locale folders to canonical BCP-47#26

Merged
JarbasAl merged 1 commit into
devfrom
fix/locales
Apr 3, 2026
Merged

fix(i18n): normalize locale folders to canonical BCP-47#26
JarbasAl merged 1 commit into
devfrom
fix/locales

Conversation

@JarbasAl
Copy link
Copy Markdown
Member

@JarbasAl JarbasAl commented Apr 3, 2026

Summary

  • Normalize all locale folder names to canonical BCP-47 form (e.g. da-dkda-DK, dada-DK)
  • Merge duplicate locale directories that differ only in case
  • Remove nested bare-language subdirectories (e.g. eu-ES/eu/eu-ES/)
  • Fixes wheel/sdist build failures: ZIP file contains multiple entries with different contents

Test plan

  • Verify pip install . / uv pip install . builds without ZIP duplicate errors
  • Verify locale files load correctly at runtime

🤖 Generated with Claude Code

Rename all locale directories to use canonical BCP-47 codes:
- Lowercase regions → uppercase (da-dk → da-DK, en-us → en-US)
- Bare language codes → full BCP-47 (da → da-DK, eu → eu-ES)
- Invalid codes remapped (eu-eu → eu-ES, fa-fa → fa-IR)
- Nested bare-language subdirs merged up (eu-ES/eu/ → eu-ES/)

This fixes wheel build failures caused by ZIP files containing
duplicate entries with different contents for the same logical path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 3, 2026

Warning

Rate limit exceeded

@JarbasAl has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 8 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 8 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3984ee14-6259-4804-8b9f-61417f4be92e

📥 Commits

Reviewing files that changed from the base of the PR and between 26a44a2 and 36c7bb7.

📒 Files selected for processing (11)
  • ovos_utterance_plugin_cancel/locale/ca-ES/cancel.intent
  • ovos_utterance_plugin_cancel/locale/da-DK/cancel.intent
  • ovos_utterance_plugin_cancel/locale/de-DE/cancel.intent
  • ovos_utterance_plugin_cancel/locale/en-US/cancel.intent
  • ovos_utterance_plugin_cancel/locale/es-ES/cancel.intent
  • ovos_utterance_plugin_cancel/locale/fr-FR/cancel.intent
  • ovos_utterance_plugin_cancel/locale/gl-ES/cancel.intent
  • ovos_utterance_plugin_cancel/locale/it-IT/cancel.intent
  • ovos_utterance_plugin_cancel/locale/nl-NL/cancel.intent
  • ovos_utterance_plugin_cancel/locale/pt-BR/cancel.intent
  • ovos_utterance_plugin_cancel/locale/pt-PT/cancel.intent
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/locales

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the fix label Apr 3, 2026
@JarbasAl JarbasAl merged commit e6e6546 into dev Apr 3, 2026
3 checks passed
JarbasAl added a commit that referenced this pull request Apr 17, 2026
* Translate intents.json via GitLocalize (#24)

Co-authored-by: nuriapochatbsc <nuria.poch.at.bsc@gmail.com>

* Update translations

* Increment Version to 0.2.6a1

* Update Changelog

* fix(i18n): normalize locale folder names to canonical BCP-47 form (#26)

Rename all locale directories to use canonical BCP-47 codes:
- Lowercase regions → uppercase (da-dk → da-DK, en-us → en-US)
- Bare language codes → full BCP-47 (da → da-DK, eu → eu-ES)
- Invalid codes remapped (eu-eu → eu-ES, fa-fa → fa-IR)
- Nested bare-language subdirs merged up (eu-ES/eu/ → eu-ES/)

This fixes wheel build failures caused by ZIP files containing
duplicate entries with different contents for the same logical path.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update translations

* Increment Version to 0.2.7a1

* Update Changelog

* ci: modernize workflows, add pyproject.toml, type hints and tests (#28)

* test: add unit tests for NevermindPlugin

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: provide test coverage (10 tests, 97% on __init__.py)
- Impact: new test/unittests/test_plugin.py; verifies cancel detection, passthrough, lang fallback, context keys
- Verified via: .venv/bin/pytest test/ -v --cov=ovos_utterance_plugin_cancel

* docs: add /docs, FAQ, AUDIT, SUGGESTIONS and update README

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: add required per-repo documentation (docs/index.md, FAQ.md, AUDIT.md, SUGGESTIONS.md, AI_TRANSPARENCY_LOG.md) and modernize README with badges and quickstart
- Impact: all mandatory repo-root docs now present; README rewritten with install/dev instructions
- Verified via: manual review

* ci: modernize GitHub Actions workflows

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: update gh-automations refs @master@dev; replace deprecated set-output with GITHUB_OUTPUT; replace python setup.py bdist_wheel with python -m build; add unit_tests job to build_tests.yml; remove redundant translations job (scripts deleted); use pypa/gh-action-pypi-publish@release/v1
- Impact: workflows now use @dev automations ref; CI runs unit tests on every push/PR; deprecated commands removed
- Verified via: manual review

* ci: add standard OpenVoiceOS shared workflows + pyproject.toml

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: replace bespoke/TigreGotico-based workflows with standard OpenVoiceOS/gh-automations reusable workflows; migrate from setup.py to pyproject.toml; add __version__ to version.py
- Impact: adds build-tests, coverage, lint, license_check, pip_audit, release-preview, repo-health; replaces publish_stable and release_workflow with standard templates; all gh-automations refs pinned to SHA 05c0bb438ca7d2bc485465bc233fd4e1997f23c5
- Verified via: apply_workflows.py dry-run confirmed all required workflows present

* .

* refactor: add type hints, docstrings, fix return type annotation

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: add complete type hints and docstrings to NevermindPlugin; fix invalid tuple() return annotation; replace conflicting Neon BSD header with Apache 2.0 notice
- Impact: __init__.py now fully typed (List/Tuple/Dict/Optional); class and both methods have docstrings; no behavioural change
- Verified via: pytest test/ 10/10 passed

* fix: restore original Neon AI license header

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: this is a fork — original copyright header must be preserved regardless of how much code changed
- Impact: Neon BSD-style header restored to __init__.py

* test: add corner-case tests (empty inputs, None context, mid-sentence non-match, case sensitivity)

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: cover edge cases — empty list, empty string, whitespace-only, None context, cancel phrase not at tail, unsupported lang passthrough, custom constructor args
- Impact: 10 → 21 tests, all passing
- Verified via: pytest test/ 21/21

* test: add per-locale cancel+passthrough tests for all 11 supported languages

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: verify cancel detection and passthrough for every locale shipped with the plugin; also assert all locales load >0 cancel words
- Impact: 21 → 44 tests; covers ca-ES, da-DK, de-DE, en-US, es-ES, fr-FR, gl-ES, it-IT, nl-NL, pt-BR, pt-PT
- Verified via: pytest test/ 44/44

* chore: remove agent-generated docs artefacts

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: remove FAQ.md, AUDIT.md, SUGGESTIONS.md, AI_TRANSPARENCY_LOG.md added by AI pipeline; not appropriate for this repo
- Impact: files deleted from history going forward

* docs: document default-enabled status and how to disable

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: plugin ships enabled by default in ovos-config; users need to know how to disable it
- Impact: Configuration section updated with default config snippet and disable example

* .

* fix: address CodeRabbit review comments

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: address actionable CodeRabbit feedback on PR #28
- Impact:
  - workflows: revert gh-automations refs from pinned SHA back to @dev (per project convention)
  - build-tests.yml: fix install_extras 'test' -> 'dev' to match pyproject.toml extras
  - __init__.py: explicit line.strip() before expand_template; skip blank lines defensively
  - README: consistent uv toolchain in dev snippet (uv pip install + uv run pytest)
- Skipped: min_coverage: 0 — template default, not enforced here
- Verified via: pytest test/ 44/44

* Increment Version to 0.2.7a2

* Update Changelog

* fix: drop setup.py and requirements.txt (#30)

* chore: drop setup.py and requirements.txt, pyproject.toml is the source of truth

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: fix CI build failure — setup.py read requirements.txt which no longer exists; pyproject.toml already declares all deps and entry points
- Impact: python -m build now uses pyproject.toml exclusively; setup.py and requirements.txt removed
- Verified via: pyproject.toml has all deps, entry-points, and dynamic version from version.py

* fix: remove invalid PYPI_TOKEN/MATRIX_TOKEN secrets from non-release workflows

AI-Generated Change:
- Model: claude-sonnet-4-6
- Intent: fix startup_failure on repo-health, build-tests, coverage, lint, license_check, pip_audit, release-preview — those reusable workflows do not declare PYPI_TOKEN/MATRIX_TOKEN as inputs so passing them causes a validation error
- Impact: secrets block removed from 7 workflows; only release_workflow and publish_stable retain them
- Verified via: gh-automations workflow definitions confirm none of these accept those secrets

* Increment Version to 0.2.8a1

* Update Changelog

---------

Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: nuriapochatbsc <nuria.poch.at.bsc@gmail.com>
Co-authored-by: JarbasAl <JarbasAl@users.noreply.github.com>
Co-authored-by: JarbasAI <33701864+JarbasAl@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant