Drop the source name from the status line, make it localized
statusLine() used to build the whole "via Coinbase, updated ..."
string in shared code with hardcoded English literals ("updated",
"loading rates…", "via ") — not localizable, since this shared code
has no Composable/moko-resources context to resolve a string from,
and said more than needed (the source is already shown in the Price
Source picker right above it).
Replaced with lastUpdatedDateTime(): String?, which returns only the
locale-formatted date/time (still shared, since that part is genuine
platform-native locale formatting, not translated text) — null for
Manual, or while the first fetch hasn't completed. Each UI layer now
builds the localized "Updated %1$s" / "Loading rates…" text itself
via stringResource()/IosLocalizationKt around that value, using two
new string resources.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
This commit is contained in:
@@ -37,6 +37,21 @@ struct ContentView: View {
|
||||
: state.fiatRows
|
||||
}
|
||||
|
||||
/// Nil for Manual (a manually typed rate has no "last updated" moment to show). Doesn't name
|
||||
/// the price source — just when the rate was last fetched.
|
||||
private func statusText(for state: IosConverterState) -> String? {
|
||||
if state.isManualSource {
|
||||
return nil
|
||||
}
|
||||
if let dateTime = state.lastUpdatedDateTime {
|
||||
return IosLocalizationKt.localizedFormattedString(
|
||||
resource: MR.strings.shared.updated_status,
|
||||
args: [dateTime]
|
||||
)
|
||||
}
|
||||
return IosLocalizationKt.localizedString(resource: MR.strings.shared.loading_rates_status)
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
/// [codes] with [moving] relocated to sit right before [target] — how macOS's manual
|
||||
/// drag-and-drop (see `.dropDestination` above) computes its new currency order, since
|
||||
@@ -56,8 +71,8 @@ struct ContentView: View {
|
||||
Form {
|
||||
Section(
|
||||
footer: Group {
|
||||
if !state.statusLine.isEmpty {
|
||||
Text(state.statusLine)
|
||||
if let statusText = statusText(for: state) {
|
||||
Text(statusText)
|
||||
}
|
||||
}
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user