Repository navigation
feat: accept {en, zh} tables for parameter and key mapping labels - #11
Merged
Merged
Conversation
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.
关联
配合 OpenLegged/BotLab#67:BotLab 的参数与按键映射
label支持{"en": ..., "zh": ...}译文表,界面按语言显示。本 PR 让本地 CLI 接受同一写法。改动
src/botlab/_host.py:参数label与options[].label接受纯字符串或译文表(key 仅en/zh,必须含en,值非空);纯字符串规则不变。src/botlab/sdk/_declaration.py、src/botlab/sdk/_robot.py:从 BotLab 镜像_localized_text及robot.commands(mappings=[{"label": ...}])的校验。只镜像了这两处 hunk:scripts/sync_sdk.py整体同步会同时带入 BotLab dev 上的imu_sensors观测参数,而本仓原生 runner 尚未支持imuSensors,不应夹带进来;该部分留给对应功能同步。botlab run / validate这些模板——旧 CLI 会报label must be a non-empty string。测试方式
uv run ruff check .→ All checks passeduv run pytest --basetemp=tmp/pytest→ 804 passed, 10 skipped, 2 deselecteduv run python -m botlab._runtime.golden_check tests/fixtures/processors.json→ 54 cases within tolerancetests/test_host.py::test_localized_parameter_labels与test_invalid_localized_parameter_labels(缺 en / 未知语言 / 空译文 / 非法类型)。uv build --wheel+verify_wheel.py(本地 worktree 无 UI 快照,用BOTLAB_ALLOW_MISSING_UI=1安装测试环境)。风险
AI 使用说明:
_host.py校验、SDK 镜像 hunk、测试)。localizedText.ts、SDK_declaration.py三处一致——AI 核对:_localized_text与 BotLab 镜像逐字一致,_host版本仅报错类型不同;无新增兜底,非法输入一律抛BotLabError。