TO SQUASH: Spanish translation done.
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
# Preferences Language Toggles Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** Add a Language section to Preferences with two mutually exclusive toggles that switch active game language between default (`None`) and Spanish (`"spanish"`), placed to the right of Skip.
|
||||
|
||||
**Architecture:** Extend the existing top preferences row in `screen preferences()` by adding one `radio`-styled `vbox` section for language controls. Use Ren'Py built-in `Language(...)` actions for immediate language switching and selected-state semantics. Update Spanish translation strings so button labels follow Option B behavior (`English/Inglés`, `Spanish/Español` depending on active language).
|
||||
|
||||
**Tech Stack:** Ren'Py screen language (`.rpy`), Ren'Py translation files (`game/tl/spanish/*.rpy`), Ren'Py CLI (`renpy.sh` lint/compile/run).
|
||||
|
||||
---
|
||||
|
||||
## File Structure
|
||||
|
||||
- Modify: `game/screens.rpy` (preferences layout and language toggle actions)
|
||||
- Modify: `game/tl/spanish/screens.rpy` (translations for `Language`, `English`, `Spanish`)
|
||||
- Reference: `docs/superpowers/specs/2026-03-20-preferences-language-toggles-design.md`
|
||||
|
||||
Notes:
|
||||
- Keep all work in the currently active local translation branch.
|
||||
- Do not create or use git worktrees for this task (required for local playtesting workflow).
|
||||
- Follow existing `Display`/`Skip` section layout and style patterns.
|
||||
|
||||
## Chunk 1: Preferences UI Section
|
||||
|
||||
### Task 1: Add Language block in top preferences row
|
||||
|
||||
**Files:**
|
||||
- Modify: `game/screens.rpy` (inside `screen preferences()` first `hbox` near existing `Display` and `Skip` blocks)
|
||||
|
||||
- [ ] **Step 1: Baseline acceptance check (expected to fail current requirement)**
|
||||
|
||||
Run: `"renpy.sh" "/home/$USER/Documentos/Renpy Projects/Soul Droid Chat" run`
|
||||
Expected baseline: Preferences has no `Language` section to the right of `Skip`.
|
||||
|
||||
- [ ] **Step 2: Add Language section with matching style/title**
|
||||
|
||||
In `screen preferences()` first `hbox`, add this `vbox` immediately after the existing `Skip` `vbox`:
|
||||
|
||||
```renpy
|
||||
vbox:
|
||||
style_prefix "radio"
|
||||
label _("Language")
|
||||
textbutton _("English") action Language(None)
|
||||
textbutton _("Spanish") action Language("spanish")
|
||||
```
|
||||
|
||||
Implementation details:
|
||||
- Keep section placement in the same `hbox` that contains `Display` and `Skip`.
|
||||
- Keep title wrapped in `_()`.
|
||||
- Use `style_prefix "radio"` so title/button appearance matches established pattern.
|
||||
|
||||
- [ ] **Step 3: Run lint to validate screen syntax after UI change**
|
||||
|
||||
Run: `"renpy.sh" "/home/$USER/Documentos/Renpy Projects/Soul Droid Chat" lint`
|
||||
Expected: No new lint errors from preferences screen edits.
|
||||
|
||||
## Chunk 2: Translation Labels and End-to-End Validation
|
||||
|
||||
### Task 2: Add Spanish string mappings for Option B labels
|
||||
|
||||
**Files:**
|
||||
- Modify: `game/tl/spanish/screens.rpy` (within `translate spanish strings:`)
|
||||
|
||||
- [ ] **Step 1: Add/confirm Spanish translations for new strings**
|
||||
|
||||
Ensure these mappings exist exactly once in `game/tl/spanish/screens.rpy`:
|
||||
|
||||
```renpy
|
||||
old "Language"
|
||||
new "Idioma"
|
||||
|
||||
old "English"
|
||||
new "Inglés"
|
||||
|
||||
old "Spanish"
|
||||
new "Español"
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Verify compile after translation update**
|
||||
|
||||
Run: `"renpy.sh" "/home/$USER/Documentos/Renpy Projects/Soul Droid Chat" compile`
|
||||
Expected: Successful compile.
|
||||
|
||||
- [ ] **Step 3: Manual smoke test for behavior and mutual exclusivity**
|
||||
|
||||
Run: `"renpy.sh" "/home/$USER/Documentos/Renpy Projects/Soul Droid Chat" run`
|
||||
|
||||
Validate in Preferences:
|
||||
- `Language` section appears to the right of `Skip`.
|
||||
- `Language` title style matches `Display` and `Skip` titles.
|
||||
- Selecting `English` sets default language (`Language(None)`).
|
||||
- Selecting `Spanish` sets Spanish language (`Language("spanish")`).
|
||||
- Only one of the two language toggles appears selected at a time.
|
||||
- Section title and labels behave per Option B/localization mappings:
|
||||
- Default language active: section title `Language`; buttons `English`, `Spanish`
|
||||
- Spanish active: section title `Idioma`; buttons `Inglés`, `Español`
|
||||
- Switching back to English restores title `Language` and buttons `English`, `Spanish`
|
||||
|
||||
## Completion Checklist
|
||||
|
||||
- [ ] Language section added with title `_("Language")`.
|
||||
- [ ] Section appears to the right of Skip in the preferences top row.
|
||||
- [ ] Toggles use `Language(None)` and `Language("spanish")`.
|
||||
- [ ] Mutual exclusivity confirmed in UI selected state.
|
||||
- [ ] Option B labels confirmed (`English/Inglés`, `Spanish/Español` by active language).
|
||||
- [ ] `lint` and `compile` completed successfully.
|
||||
- [ ] Manual run smoke check completed.
|
||||
@@ -0,0 +1,82 @@
|
||||
# Preferences Language Toggles Design
|
||||
|
||||
## Goal
|
||||
|
||||
Add a new Language section to the preferences screen with two mutually exclusive toggles:
|
||||
|
||||
- Default language (`None` translation), labeled `English` in default language and `Inglés` when Spanish is active.
|
||||
- Spanish language (`"spanish"` translation), labeled `Spanish` in default language and `Español` when Spanish is active.
|
||||
|
||||
Selecting either toggle must immediately set the active game language.
|
||||
|
||||
## Scope
|
||||
|
||||
- Modify only preferences UI and related translatable strings.
|
||||
- Preserve existing layout and visual language used by `Display` and `Skip` sections.
|
||||
- Keep behavior compatible with Ren'Py language switching conventions.
|
||||
- Work in the current active local translation branch (no git worktrees), to keep local playtesting straightforward.
|
||||
|
||||
## Current Context
|
||||
|
||||
- `game/screens.rpy` currently defines two top-row preference blocks in `screen preferences()`: `Display` and `Skip`.
|
||||
- This row uses `hbox` with `box_wrap True` and section `vbox` blocks.
|
||||
- Spanish translations for screen strings live in `game/tl/spanish/screens.rpy`.
|
||||
|
||||
## Proposed UI/Behavior
|
||||
|
||||
### Placement
|
||||
|
||||
Add a third `vbox` in the first preferences `hbox`, immediately after the `Skip` block, so Language appears to the right of Skip in desktop/web layout.
|
||||
|
||||
### Styling
|
||||
|
||||
- Use `style_prefix "radio"` on the Language `vbox`.
|
||||
- Use `label _("Language")` for the section title so it matches existing section title styling and translation behavior.
|
||||
|
||||
### Controls
|
||||
|
||||
Add two radio-style textbuttons:
|
||||
|
||||
- `textbutton _("English") action Language(None)`
|
||||
- `textbutton _("Spanish") action Language("spanish")`
|
||||
|
||||
These actions switch active language immediately and preserve mutual exclusivity through the radio preference button styling/selection behavior.
|
||||
|
||||
### Translation Labels (Option B)
|
||||
|
||||
Add/ensure Spanish translations in `game/tl/spanish/screens.rpy`:
|
||||
|
||||
- `Language` -> `Idioma`
|
||||
- `English` -> `Inglés`
|
||||
- `Spanish` -> `Español`
|
||||
|
||||
Because button text is wrapped in `_()`, labels automatically localize based on active language.
|
||||
|
||||
## Error Handling and Edge Cases
|
||||
|
||||
- If Spanish translations are unavailable at runtime, `Language("spanish")` still sets the language code; labels fall back based on available string catalog.
|
||||
- `Language(None)` safely returns to default strings.
|
||||
|
||||
## Validation Plan
|
||||
|
||||
1. Run lint:
|
||||
- `"renpy.sh" "/home/$USER/Documentos/Renpy Projects/Soul Droid Chat" lint`
|
||||
2. Run compile:
|
||||
- `"renpy.sh" "/home/$USER/Documentos/Renpy Projects/Soul Droid Chat" compile`
|
||||
3. Manual smoke check via run:
|
||||
- `"renpy.sh" "/home/$USER/Documentos/Renpy Projects/Soul Droid Chat" run`
|
||||
|
||||
Manual checks during run:
|
||||
|
||||
- Open Preferences and verify Language section appears to the right of Skip.
|
||||
- Confirm title style matches Display/Skip.
|
||||
- Toggle English -> UI strings reflect default language.
|
||||
- Toggle Spanish -> UI strings reflect Spanish.
|
||||
- Confirm labels show `English/Spanish` in default language and `Inglés/Español` in Spanish.
|
||||
- Confirm only one language toggle appears active at a time.
|
||||
|
||||
## Out of Scope
|
||||
|
||||
- Adding more languages.
|
||||
- Refactoring preferences screen structure beyond this section.
|
||||
- Any worktree setup or branch restructuring.
|
||||
Reference in New Issue
Block a user