Skip to content

refactor: extract Android & iOS UI strings to resource files - #9

Merged
jvsena42 merged 2 commits into
mainfrom
refactor/extract-ui-strings
Jun 14, 2026
Merged

refactor: extract Android & iOS UI strings to resource files#9
jvsena42 merged 2 commits into
mainfrom
refactor/extract-ui-strings

Conversation

@jvsena42

Copy link
Copy Markdown
Owner

Summary

Extracts all hardcoded user-facing UI copy out of Compose screens and SwiftUI views into proper string resource files, with consistent namespaced keys shared across both platforms.

Android — composeApp/src/androidMain/res/values/strings.xml

  • ~190 namespaced keys (home_*, decks_*, deck_detail_*, deck_editor_*, edit_card_*, study_*, discover_*, paste_*, publish_*, onboarding_*, profile_*, friend_profile_*, settings_*, component_*, nav_*).
  • 22 Compose files now use stringResource(R.string.…); interpolated text became positional format strings (e.g. %1$d of %2$d done · keep going!).
  • EchoTab enum labels moved from String to @StringRes labelRes: Int, resolved at the composable call site.

iOS — iosApp/iosApp/Localizable.xcstrings (new String Catalog, 217 keys)

  • 18 SwiftUI views reference the same keys as Android; format specifiers converted to C-style (%lld / %@).
  • Plain literals use the key as LocalizedStringKey; parameterized strings use String(format: NSLocalizedString(...)).
  • No project.pbxproj edits needed — the project uses Xcode 16 fileSystemSynchronizedGroups, so the catalog in iosApp/iosApp/ is auto-included.

Verification

  • :composeApp:compileDebugKotlin passes.
  • ✅ All 101 keys referenced in Swift exist in the catalog (cross-checked).
  • ✅ SwiftLint passes with 0 warnings.

Notes / follow-ups

  • 3 keys carry different wording per platform (kept native to each, since the files are separate): decks_empty_subtitle, deck_detail_delete_dialog_title, deck_detail_delete_dialog_message. Unify if desired.
  • 5 iOS-only keys added (no Android equivalent yet): deck_editor_saving, deck_editor_title_placeholder_untitled, deck_editor_card_new, component_stats_bar_cards, common_coming_soon.
  • Fixed a styling bug surfaced during extraction in DeckEditorView (ternary modifiers bound to only one branch → empty-card label was unstyled); now an if/else in a Group.
  • Skipped intentionally: SF Symbol names, color hex, testTag/accessibilityIdentifier, #Preview mock data, log strings, pubky URIs, decorative emoji glyphs, dynamic variables.

🤖 Generated with Claude Code

jvsena42 and others added 2 commits June 14, 2026 14:36
Move hardcoded user-facing copy out of Compose screens and SwiftUI views
into localization resources, with consistent namespaced keys across both
platforms.

Android: ~190 keys in res/values/strings.xml, referenced via
stringResource(R.string.*); interpolated text converted to positional
format strings. EchoTab labels moved to @stringres labelRes.

iOS: new Localizable.xcstrings String Catalog (217 keys) reusing the same
keys; C-style format specifiers. Auto-included via Xcode 16
fileSystemSynchronizedGroups (no project.pbxproj changes).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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