fix(plugins): use String(format:) for interpolated localized strings#1733
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 739a58c987
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return driver.escapeStringLiteral(value) | ||
| } | ||
| return value.replacingOccurrences(of: "'", with: "''") | ||
| return SQLEscaping.escapeStringLiteral(value) |
There was a problem hiding this comment.
Preserve NUL bytes in query-result SQL exports
In non-streaming query-results export, ExportDialog constructs ExportService(databaseType:), leaving this data source without a driver, and the SQL exporter writes text cells through dataSource.escapeStringLiteral before generating INSERT values. Reusing SQLEscaping.escapeStringLiteral on this nil-driver path strips embedded \0 characters, so a text result containing a NUL byte is silently changed in the exported SQL; the previous fallback only doubled quotes and preserved the value. Please keep result-set export escaping lossless here or route through a driver-specific literal encoder.
Useful? React with 👍 / 👎.
What
Fixes 19 spots across the registry plugins where an error string was built with
String(localized: "...\(value)"). String interpolation insideString(localized:)creates a runtime key that can never match a strings catalog entry, so the string would never localize. Replaced each withString(format: String(localized: "... %@"), value), which keeps a stable catalog key and substitutes at runtime.Output is identical today (these plugins ship no catalogs, so both forms return the English text); the fix removes the latent bug so the strings can actually be translated later.
Files
RedisCommandParserEtcdHttpClient,EtcdCommandParserCloudflareD1PluginDriver,D1HttpClientDynamoDBConnectionMongoShellParserTests
Added a case to
MongoShellParserTestsasserting eachMongoShellParseErrordescription substitutes its argument (catches a wrong format specifier). The other plugins follow the identical mechanical pattern; their error enums live in plugin bundles the test target cannot link.Notes
No CHANGELOG entry: these are plugin-internal error strings with no app-user-facing change, and they ship through plugin releases, not the app release.