mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 02:29:55 +02:00
feat(apple): generate type-safe L10n accessors and migrate all key literals
Replaces every stringly-typed localization key in the Apple app with compile-time-checked accessors generated from localization/strings.json. A mistyped key is now a build error instead of a silent fallback to the raw key at runtime. The runtime path is unchanged: plain keys are String.LocalizationValue constants resolved with String(localized:) and Apple's String Catalog still does the lookup; keys with arguments become typed, named functions applying args through String(format:). Generator: new renderSwiftAccessors emits apple/VniDrop/Generated/L10n.swift, wired into generate. Renamed generic arg1/arg2 tokens on four keys to semantic names (receiver, transferName, deviceId) and updated their context notes; positional output is unchanged so .xcstrings (bar the 4 comments) and the Android XML regenerate identical. Migration: every key-carrying value flipped to String.LocalizationValue end to end, resolved only at the leaf. Zero key literals and zero LocalizedStringKey remain in app or test code. macOS build passes; iOS test run pending.
This commit is contained in:
@@ -1810,7 +1810,7 @@
|
||||
}
|
||||
},
|
||||
"approval_endpoint_id": {
|
||||
"comment": "Approval prompt: shows the requesting device's ID. {arg1} = device/endpoint identifier.",
|
||||
"comment": "Approval prompt: shows the requesting device's ID. {deviceId} = device/endpoint identifier.",
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"de": {
|
||||
@@ -1990,7 +1990,7 @@
|
||||
}
|
||||
},
|
||||
"approval_request_body": {
|
||||
"comment": "Approval prompt body: '{arg1} wants to receive \"{arg2}\".' {arg1} = requester name, {arg2} = transfer name.",
|
||||
"comment": "Approval prompt body: '{receiver} wants to receive \"{transferName}\".' {receiver} = requester name, {transferName} = transfer name.",
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"de": {
|
||||
@@ -9130,7 +9130,7 @@
|
||||
}
|
||||
},
|
||||
"receive_delete_history_description": {
|
||||
"comment": "Receive history: confirmation body for removing one item. {arg1} = transfer name.",
|
||||
"comment": "Receive history: confirmation body for removing one item. {transferName} = transfer name.",
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"de": {
|
||||
@@ -13090,7 +13090,7 @@
|
||||
}
|
||||
},
|
||||
"transfer_delete_description": {
|
||||
"comment": "Transfer details: confirmation body for deleting a transfer. {arg1} = transfer name.",
|
||||
"comment": "Transfer details: confirmation body for deleting a transfer. {transferName} = transfer name.",
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"de": {
|
||||
|
||||
Reference in New Issue
Block a user