Skip to content

Add an opt-in Filipino-in-Baybayin locale pilot - #321

Merged
ultraelectronica merged 4 commits into
mainfrom
versionF
Oct 18, 2026
Merged

ultraelectronica merged 4 commits into
mainfrom
versionF

Conversation

@ultraelectronica

Copy link
Copy Markdown
Member

Summary

Introduces an experimental, explicitly opt-in tl_Tglg locale so Baybayin can
be reviewed in the real UI without changing what any existing device shows.

Script-aware, opt-in locale

  • Adds kBaybayinLocale = Locale.fromSubtags(languageCode: 'tl', scriptCode: 'Tglg') to the supported locales after English and Chinese.
  • resolveSupportedLocale now tries an exact match, then a script match, and only then a language-only match that requires the supported locale to have no script. A plain tl, tl_PH, tl_Latn, or fil device therefore never activates the pilot.
  • Passes a new resolveAppLocale to MaterialApp so Flutter's default language-only fallback cannot select the script-specific entry.
  • Parses persisted locale tags script-aware: 2–3 letter language, optional 4-letter script (normalized to title case), optional 2-letter region or 3-digit UN M.49 code; malformed values fall back to English. LocaleController.select normalizes through the same resolver, and stored values use Locale.toString().

Partial pilot strings

  • app_tl.arb is an intentionally empty generator base; app_tl_Tglg.arb carries 50 draft messages with x-latin transliterations and x-review-status. Everything not translated falls back to English.
  • Adds lookupFlickLocalizations plus a first-priority Baybayin delegate. Its localeName is overridden to en so inherited English text uses English ICU rules (an untranslated songUnit(0) says "song", not the Tagalog form) while Localizations.localeOf(context) still reports tl_Tglg and built-in Material controls use Tagalog.
  • Adds a localized baybayinPilotDescription warning ("Experimental draft; untranslated text stays in English") to the English, Tagalog and Chinese ARBs.

Language settings

  • Extracts the inline language list into a reusable LanguageSettingsCard and uses it from Interface settings.
  • Adds a "Tagalog (Baybayin)" row with the draft warning as its subtitle. Autonyms stay readable, and English remains in Latin script so users can switch back.

Font and licensing

  • Bundles the unmodified ~52 KB NotoSansTagalog-Regular.ttf and its OFL license, registers it in AppTheme.fontFamilyFallback so Baybayin renders in the selector before the locale is selected, and adds the license to the app info screen.

Review workflow

  • Adds docs/BAYBAYIN_REVIEW.md: the pilot is explicitly unverified, documents the chosen conventions (modern final-consonant virama U+1714, shared da/ra, e/i and o/u), and carries a 50-row review sheet with English, UI context, Latin Tagalog, Baybayin and status.
  • Reviewers correct the ARB and the sheet together; automated tests check that the table matches the ARB, that every draft has review context, and that placeholders survive in both scripts.

Tests

  • baybayin_pilot_test.dart: pilot is explicit, every draft has context, placeholders preserved, reviewer corrections reach labels and related forms, plurals/arguments survive generation, table/ARB sync.
  • baybayin_layout_test.dart: selector survives narrow screens and enlarged text, can enter Baybayin and escape to English, and Baybayin navigation fits without changing music metadata.
  • locale_switch_test.dart: script-specific locales are never matched by language alone, persisted reloads keep the script, legacy/script/region/malformed stored tags resolve safely, Filipino device locales stay on English, and switches reach widgets and services.

Related issue

none

Checklist

  • flutter analyze passes
  • flutter test passes
  • Rust changes: cargo test --manifest-path rust/Cargo.toml passes
  • Built and ran the app if the change touches a playback path (flutter run --flavor full)
  • Generated code regenerated and committed if bridge/drift/freezed models changed
  • CHANGELOG.md updated for user-facing changes
  • No secrets, keys, tokens, or machine-local files committed
  • One change per PR; no unrelated reformatting in the same diff
  • Hardware tested if the Rust audio engine or USB/DAC output changed

- Register NotoSansTagalog in the theme font fallback list alongside
  NotoSansSC for the Baybayin pilot
- Use kAppLocalizationsDelegates and resolveAppLocale for locale
  handling in the app widget
Also add Noto Sans Tagalog license to the app info screen.
Introduce the tl-Tglg locale as a script-specific opt-in: script
matching keeps ordinary tl devices from selecting it, and stored locale
tags are parsed script-aware. The pilot inherits English ICU rules so
untranslated messages pluralize correctly while Localizations still
reports the Tagalog-in-Baybayin locale.
Bundle Noto Sans Tagalog, add a 50-message tl_Tglg draft with Latin
transliterations, and wire a language option with review docs and tests.
@ultraelectronica ultraelectronica self-assigned this Oct 18, 2026
@ultraelectronica
ultraelectronica merged commit 1b167a6 into main Oct 18, 2026
6 checks passed
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