Skip to content

fix(plugins): use String(format:) for interpolated localized strings#1733

Merged
datlechin merged 3 commits into
mainfrom
fix/plugin-localized-interpolation
Jun 20, 2026
Merged

fix(plugins): use String(format:) for interpolated localized strings#1733
datlechin merged 3 commits into
mainfrom
fix/plugin-localized-interpolation

Conversation

@datlechin

Copy link
Copy Markdown
Member

What

Fixes 19 spots across the registry plugins where an error string was built with String(localized: "...\(value)"). String interpolation inside String(localized:) creates a runtime key that can never match a strings catalog entry, so the string would never localize. Replaced each with String(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

  • Redis: RedisCommandParser
  • Etcd: EtcdHttpClient, EtcdCommandParser
  • Cloudflare D1: CloudflareD1PluginDriver, D1HttpClient
  • DynamoDB: DynamoDBConnection
  • PluginKit: MongoShellParser

Tests

Added a case to MongoShellParserTests asserting each MongoShellParseError description 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@datlechin datlechin merged commit 6b1b3d6 into main Jun 20, 2026
3 of 4 checks passed
@datlechin datlechin deleted the fix/plugin-localized-interpolation branch June 20, 2026 05:13
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