{"record":{"id":"5bd50ac9d0b7440b","repo":"pentaho/pentaho-kettle","slug":"the-i18-directive-need-3-parameters-i18n-the-package-name","errorCode":null,"errorMessage":"the i18, directive need 3 parameters: i18n, the package name and the key, but <count> parameters were found in [<value>]","messagePattern":"the i18, directive need 3 parameters: i18n, the package name and the key, but <count> parameters were found in \\[<value>\\]","errorType":"exception","errorClass":"KettleConfigException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/config/PropertySetter.java","lineNumber":78,"sourceCode":"      val = value;\n    }\n\n    try {\n      // SET!\n      BeanUtils.setProperty( obj, property, val );\n    } catch ( Exception e ) {\n      throw new KettleConfigException( e );\n    }\n\n  }\n\n  private Object setI18nProperty( String[] expression, String value ) throws KettleConfigException {\n    if ( expression.length == 3 ) {\n      String packageName = expression[1];\n      String key = expression[2];\n      return BaseMessages.getString( packageName, key );\n    } else {\n      throw new KettleConfigException(\n        \"the i18, directive need 3 parameters: i18n, the package name and the key, but \"\n          + expression.length + \" parameters were found in [\" + value + \"]\" );\n    }\n  }\n\n  private Object setOgnlProperty( String[] expression, String value ) throws KettleConfigException {\n    if ( expression.length >= 2 ) {\n      OgnlExpression expr = ognlExpressions.get( value );\n      if ( expr == null ) {\n        synchronized ( ognlExpressions ) {\n          try {\n            expr = new OgnlExpression( expression[1] );\n            ognlExpressions.put( value, expr );\n\n          } catch ( OgnlException e ) {\n            throw new KettleConfigException( \"Unable to parse expression [\" + expression[1] + \"] with Ognl\", e );\n          }\n        }","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/config/PropertySetter.java#L60-L96","documentation":"setI18nProperty resolves a value using the 'i18n' directive, which must have exactly 3 colon-separated parts: the directive name, the message package name, and the message key. It delegates to BaseMessages.getString(packageName, key). If the expression does not have exactly 3 parameters, a KettleConfigException reports the actual count and the raw value.","triggerScenarios":"setProperty(obj, property, \"i18n:com.example.messages\") (2 parts) or \"i18n:a:b:c\" (4 parts) — any i18n expression whose token count after splitting on ':' is not exactly 3.","commonSituations":"A message key containing a colon splits into extra tokens; a developer forgot the package segment; copy-pasted an i18n value with trailing colons; localized key names that include ':' characters.","solutions":["Rewrite the value as exactly 'i18n:<package>:<key>', e.g. 'i18n:org.pentaho.di.trans:Trans.Description'.","Remove or escape colons inside the message key; choose a key without ':' characters.","Verify the package name segment matches the package containing the messages .properties files."],"exampleFix":"// before\npropertySetter.setProperty(obj, \"title\", \"i18n:mypkg:my:key\");\n\n// after\npropertySetter.setProperty(obj, \"title\", \"i18n:mypkg:mykey\");","handlingStrategy":"validation","validationCode":"String[] parts = value.split(\":\");\nif (!parts[0].equals(\"i18n\") || parts.length != 3) {\n  throw new IllegalArgumentException(\"i18n value must be 'i18n:<package>:<key>': \" + value);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use message keys without colon characters.","Keep a template of valid i18n directive values and copy from it.","Unit-test config files by resolving all i18n values at build time."],"tags":["config","i18n","argument-format"],"backgroundTag":"invalid-argument-format","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}