Skip to content

Add LocalizedStringResource Text support#894

Merged
Kyle-Ye merged 1 commit into
mainfrom
feature/localize_resource
Jun 7, 2026
Merged

Add LocalizedStringResource Text support#894
Kyle-Ye merged 1 commit into
mainfrom
feature/localize_resource

Conversation

@Kyle-Ye
Copy link
Copy Markdown
Member

@Kyle-Ye Kyle-Ye commented Jun 7, 2026

Summary

  • Add Text initialization support for Foundation.LocalizedStringResource.
  • Add LocalizedStringKey.StringInterpolation support for localized string resources.
  • Keep resource-specific text storage, resolution, styling, and localization metadata in a dedicated localized text file.

Add Text and LocalizedStringKey support for Foundation.LocalizedStringResource.

Resolve localized resources through the current environment locale, preserve localization metadata, and keep resource-specific text storage in a dedicated localized text file.
@github-actions github-actions Bot added area: text Text, labels, line style, and text rendering APIs. type: feature New API, behavior, platform support, or user-facing capability. labels Jun 7, 2026
@Kyle-Ye Kyle-Ye marked this pull request as ready for review June 7, 2026 08:20
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2026

Codecov Report

❌ Patch coverage is 0% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.68%. Comparing base (681409e) to head (18b2542).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../Text/Localized/Text+LocalizedStringResource.swift 0.00% 40 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #894      +/-   ##
==========================================
- Coverage   26.68%   26.68%   -0.01%     
==========================================
  Files         693      694       +1     
  Lines       48651    48683      +32     
==========================================
+ Hits        12984    12992       +8     
- Misses      35667    35691      +24     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye Kyle-Ye merged commit 1278862 into main Jun 7, 2026
6 of 7 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/localize_resource branch June 7, 2026 08:32
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Jun 7, 2026

🤖 Augment PR Summary

Summary: This PR adds Text support for Foundation.LocalizedStringResource, aligning OpenSwiftUI’s localization behavior more closely with SwiftUI v4.

Changes:

  • Relocates `Text+Localized.swift` into the dedicated `View/Text/Localized/` area and removes resource-specific helpers from that file.
  • Adds a Darwin-only `Text.init(_ resource: LocalizedStringResource)` overload (disfavored) backed by a new `LocalizedStringResourceStorage`.
  • Adds `LocalizedStringKey.StringInterpolation.appendInterpolation(_ resource: LocalizedStringResource)` so resources can participate in localized interpolations.
  • Introduces `LocalizedStringResource.resolve(in:)` to resolve using the current `EnvironmentValues.locale`.
  • Adds `LocalizedStringResource.isStyled` and a `BundleDescription` → `Bundle` resolver to support styling checks and `_LocalizationInfo` metadata.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

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

Labels

area: text Text, labels, line style, and text rendering APIs. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant