leehaut opened a new issue, #9414:
URL: https://github.com/apache/hop/issues/9414

   ### Apache Hop version?
   
   2.21.0-SNAPSHOT
   
   ### Java version?
   
   openjdk 21
   
   ### Operating system
   
   Windows
   
   ### What happened?
   
   ### What were you trying to do
   
   Start Hop GUI with the Simplified Chinese locale (`zh_CN`).
   
   ### What happened
   
   Startup logs a format error while GUI plugins are initialized, and the 
Database Explorer "Generate SQL Select" menu item is not translated:
   ```text
   Format problem with key=[DatabaseExplorerDialog.Menu.SQLSelect], 
locale=[zh_CN], package=org.apache.hop.ui.core.database.dialog : 
java.lang.IllegalArgumentException: can't parse argument number: {0}
   java.lang.IllegalArgumentException: can't parse argument number: {0}
           at 
java.base/java.text.MessageFormat.makeFormat(MessageFormat.java:1485)
           at 
java.base/java.text.MessageFormat.applyPattern(MessageFormat.java:512)
           at java.base/java.text.MessageFormat.<init>(MessageFormat.java:383)
           at java.base/java.text.MessageFormat.format(MessageFormat.java:883)
           at 
org.apache.hop.i18n.GlobalMessageUtil.calculateString(GlobalMessageUtil.java:328)
           at 
org.apache.hop.i18n.GlobalMessageUtil.calculateString(GlobalMessageUtil.java:295)
           at 
org.apache.hop.i18n.GlobalMessageUtil.calculateString(GlobalMessageUtil.java:268)
           at 
org.apache.hop.i18n.GlobalMessageUtil.calculateString(GlobalMessageUtil.java:229)
           at 
org.apache.hop.i18n.LafMessageHandler.calculateString(LafMessageHandler.java:87)
           at 
org.apache.hop.i18n.GlobalMessages.getString(GlobalMessages.java:210)
           at org.apache.hop.i18n.BaseMessages.getString(BaseMessages.java:75)
           at 
org.apache.hop.core.gui.plugin.BaseGuiElements.getTranslation(BaseGuiElements.java:37)
           at 
org.apache.hop.core.gui.plugin.menu.GuiMenuItem.<init>(GuiMenuItem.java:72)
           at 
org.apache.hop.core.gui.plugin.GuiRegistry.addGuiMenuElement(GuiRegistry.java:412)
           at 
org.apache.hop.ui.hopgui.HopGuiEnvironment.initGuiPlugins(HopGuiEnvironment.java:118)
           at 
org.apache.hop.ui.hopgui.HopGuiEnvironment.init(HopGuiEnvironment.java:68)
           at 
org.apache.hop.ui.hopgui.HopGuiEnvironment.init(HopGuiEnvironment.java:53)
           at org.apache.hop.ui.hopgui.HopGui.main(HopGui.java:702)
   Caused by: java.lang.NumberFormatException: For input string: "{0}"
           at 
java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
           at java.base/java.lang.Integer.parseInt(Integer.java:662)
           at java.base/java.lang.Integer.parseInt(Integer.java:778)
           at 
java.base/java.text.MessageFormat.makeFormat(MessageFormat.java:1483)
           ... 17 more
   
   2026/11/11 10:17:32 - Hop - Projects enabled
   2026/11/11 10:17:32 - Hop - Enabling project : 'hop_run'
   ```
   
   
   English (`en_US`) starts normally. `GlobalMessageUtil` catches the 
`IllegalArgumentException`, prints it, and treats the key as missing, so the 
GUI keeps going with a missing translation.
   
   ### What did you expect
   
   Every locale should load without a `MessageFormat` error, and the menu label 
should be a normal translation of "Generate SQL Select...".
   
   ### Cause
   
   Hop formats every bundle value with `java.text.MessageFormat`. A `{` starts 
a placeholder. The Chinese value was `{{0}} `, so the parser read `{0}` as the 
argument index.
   
   The same class of defect exists in other bundles. A scan of 
`messages_*.properties` (excluding `target/`) found patterns that `new 
MessageFormat(value)` rejects:
   
   - Swapped or unmatched braces: `{{0}}`, `{0]`, `[{0]]`, `{{0}]`, `{[0}]`, 
`{[0]}`, `[{{2}]`, `{2` with no closing `}`
   - A space or letter inside the placeholder: `{ 3}`, `{n}`, `{n{0}`, `{}`
   - A literal `${...}` left unquoted, which `MessageFormat` reads as an 
argument name (`${PROJECT_HOME}`, `${...}`, 
`"${HOP_PIPELINE_PERF_SNAPSHOT_LIMIT}"`)
   
   Locales with at least one invalid pattern: `zh_CN`, `pt_BR`, `ko_KR`, 
`it_IT`, `de_DE`, `pl_PL`, `es_ES`, and `en_US` (Native Spark tooltips).
   
   Menu labels such as `DatabaseExplorerDialog.Menu.*` are translated once 
during plugin init, with no arguments. A `{0}` left in those labels is shown 
literally, because the table name is never passed in.
   
   ### Affected keys
   
   `zh_CN`
   
   - `DatabaseExplorerDialog.Menu.SQLSelect` (and the other Database Explorer 
menu labels that embedded `{0}`)
   - `ResourceUtil.ExportResourcesExplanation`
   - `ActionGetMailsFromPOP.Log.AttachmentFolderExists`
   
   `pt_BR`
   
   - `ResourceUtil.ExportResourcesExplanation`
   - `ActionMoveFiles.Log.FileMoved`
   - `CrateDBBulkLoaderMeta.CheckResult.FieldsSpecifiedNotFound`
   - `GetVariableMeta.CheckResult.VariableNotSpecified`
   - `Validator.Exception.EndsWithString`, `DoesNotEndWithString`, 
`DoesNotStartWithString`
   - `SQLEditor.NoRows.Message`, `SQLEditor.ErrorExecSQL.Message`
   - `ManageRepositoriesDialog.Edit.UrlTemplate.Tooltip`
   - `SparkGuiPlugin.ExportSparkProject.Dialog.Message3`
   - `SparkFileInputDialog.FilePath.Tooltip`, 
`SparkFileOutputDialog.FilePath.Tooltip`
   - `SparkSqlDialog.Sql.Tooltip`
   
   `ko_KR`
   
   - `HopServer.DETAILED_SentXmlToService`
   - `PipelineStatusServlet.Log.CoundNotFindSpecPipeline`
   - `ActionSftp.Log.DeletedFile`
   - `Delete.Exception.FieldRequired`
   
   `it_IT`
   
   - `SalesforceUpsert.ObjectCreated`
   - `GroupByMeta.CheckResult.IgnoreAggregateFieldNotBoolean`
   
   `de_DE`
   
   - `CsvInputDialog.UsageInfoDialog.DialogMessage`
   - `CsvInputMeta.CheckResult.TransformRecevingData`
   
   `pl_PL`
   
   - `TextFileCSVImportProgressDialog.Info.DateExample` (file input and text 
file input bundles)
   
   `es_ES`
   
   - `PipelineDialog.TransformPerformanceMaxSize.Tooltip`
   
   `en_US`
   
   - `SparkGuiPlugin.ExportSparkProject.Dialog.Message3`
   - `SparkFileInputDialog.FilePath.Tooltip`, 
`SparkFileOutputDialog.FilePath.Tooltip`
   - `SparkSqlDialog.Sql.Tooltip`
   
   ### Issue Priority
   
   Priority: 3
   
   ### Issue Component
   
   Component: Hop Gui


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to