Skip to content

feat(l10n, sources): Traditional Chinese (Taiwan) localization & Seamless Multi-Source Failover (LAN/WAN auto-switch) - #15

Open
yangyws wants to merge 113 commits into
AverageConsumer:mainfrom
yangyws:main-zh
Open

feat(l10n, sources): Traditional Chinese (Taiwan) localization & Seamless Multi-Source Failover (LAN/WAN auto-switch)#15
yangyws wants to merge 113 commits into
AverageConsumer:mainfrom
yangyws:main-zh

Conversation

@yangyws

@yangyws yangyws commented Aug 8, 2026

Copy link
Copy Markdown

Summary

This PR introduces two main contributions to R-Shop:

  1. Traditional Chinese (Taiwan) Localization (zh / zh-TW): Complete translation for all UI screens, dialogs, gamepad HUD hints, and error messages following Taiwan gaming terminology.
  2. Seamless Multi-Source Failover (LAN/WAN Auto-Switching): Automatic endpoint probing and failover routing between primary and fallback sources.

Motivation & Real-World Use Case

Many users host their own game server (e.g. RomM / SMB / HTTP):

  • At Home (LAN): Handheld devices connect directly via high-speed, zero-latency local IP (192.168.x.x).
  • Outside / Travelling (WAN): When away from home, local IPs become unreachable.

With Multi-Source Failover, R-Shop automatically probes connections on startup or sync. If the local LAN server is unreachable, it seamlessly fails over to an external fallback domain (e.g. DDNS / Tailscale / Cloudflare Tunnel) without requiring manual configuration changes from the user.


Note for Maintainer & AI-Assisted Development

  • AI-Assisted Development: This feature was developed and refined with the assistance of AI coding tools, and has been hardware-tested on handheld devices and verified via flutter test and flutter analyze. Because of this, some code structures may not be 100% perfect or fully aligned with your preferred conventions.
  • Maintainer Flexibility: Please feel free to cherry-pick, refactor, adapt, or adopt any part of this PR as you see fit! Whether you'd like to merge the localization alone, refactor the failover implementation to fit your architectural vision, or adjust the design language, please do whatever works best for the R-Shop codebase.

Verification & Testing

  • Hardware tested on generic Android handhelds (Anbernic / Retroid / AYN Thor).
  • Passed all unit and widget tests (flutter test).
  • Analyzed clean with flutter analyze (0 issues).

yangyws and others added 30 commits July 24, 2026 23:22
…eferences

- docs/SPEC.md: branch layout against upstream, the layered structure, the
  multi-source abstraction (including why SourceType has five members and
  ProviderType only four), the download queue and its retry/alternate-source
  behaviour, the controller-first focus system, the platform channels, the data
  and cache layers, and a "where do I change X" index.
- docs/ARCHITECTURE.md: twelve Mermaid diagrams — layering, source abstraction,
  library load sequence, the download state machine and queue timing, the focus
  system, platform channels, caching, RetroAchievements, RomM pairing, state
  management, and the main-zh delta.

Corrections to the root ARCHITECTURE.md, which pointed at things that do not
exist:
- FocusSyncManager is in lib/core/input/, not lib/core/focus/ (no such folder).
- File links were absolute paths from a different machine; now repo-relative.
- Version now reflects this branch.

Also aligns .gitignore with the other projects (AGENTS.md canonical, AGENT.md
and CLAUDE.md kept as guards).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
yangyws added 25 commits August 8, 2026 00:28
… across SourcesScreen and FallbackPickerOverlay
… ensure all overlay action text is pure white
…cus on delete button and pick existing dialog
…lth check to display ⚠️ 無法連線 (已切換至備援)
…nslucent red styling and subtle pulsing animation
…ailover status into top-right SyncBadge pill
…s to ⚡ 備援啟用中 and ⚡ 正在使用此備援
…ving fallbacks and replace 備援 strings with 代理
…o automatically sync failover state on any source mutation
@yangyws

yangyws commented Aug 8, 2026

Copy link
Copy Markdown
Author

Hi @AverageConsumer,

Thank you so much for creating R-Shop! It's an incredible app for retro gaming handhelds.

I’ve submitted this Pull Request containing two key features I built and tested on my hardware:

  1. Traditional Chinese (Taiwan zh-TW) Localization: Complete Traditional Chinese support so native Chinese/Taiwanese handheld players can enjoy R-Shop natively.
  2. Multi-Source Failover (LAN/WAN Auto-Switching):
    My main motivation was my own home server setup — when I'm at home, I want my handheld to connect via fast local LAN IP (192.168.1.x), but when I'm outside or travelling, I want it to automatically failover to my external DDNS / VPN URL without me having to manually change settings in the app.

A quick note on this PR:

  • AI-Assisted Development: I developed this feature with the assistance of an AI coding tool. I've hardware-tested it on device and verified that all unit tests pass, but since I'm not a full-time Flutter developer, there may be areas that aren't 100% polished or idiomatic.
  • Feel Free to Adapt or Cherry-Pick: Please feel free to merge only what you find useful (like the localization), refactor the failover logic to fit your own architectural style, or adapt it in whatever way works best for R-Shop!

Hope these additions are helpful to the project! Let me know if you'd like any changes or adjustments. Thanks again for your awesome work!

@yangyws

yangyws commented Aug 12, 2026

Copy link
Copy Markdown
Author

🐛 Bug Fix: Prevent RenderFlex overflow on home grid count pills

  • Issue: On narrow grid tiles (e.g. 5–6 columns on handhelds) with large game counts (e.g. >10,000 games) or dual pills (Cloud + Local), the pill \Row\ inside \HomeGridView\ exceeded tile width by a few pixels, triggering a Flutter RenderFlex overflow warning (\OVERFLOWED BY X PIXELS).
  • Fix: Wrapped the count pill \Row\ in a \FittedBox(fit: BoxFit.scaleDown, alignment: Alignment.centerLeft)\ in \lib/features/home/widgets/home_grid_view.dart\ so pills gracefully scale down when space is constrained on high-density grid layouts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant