pentaho/pentaho-kettle · error · KettleConfigException

the i18, directive need 3 parameters: i18n, the package…

Error message

the i18, directive need 3 parameters: i18n, the package name and the key, but <count> parameters were found in [<value>]

What it means

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.

Solutions

  1. Rewrite the value as exactly 'i18n:<package>:<key>', e.g. 'i18n:org.pentaho.di.trans:Trans.Description'.
  2. Remove or escape colons inside the message key; choose a key without ':' characters.
  3. Verify the package name segment matches the package containing the messages .properties files.

Example fix

// before
propertySetter.setProperty(obj, "title", "i18n:mypkg:my:key");

// after
propertySetter.setProperty(obj, "title", "i18n:mypkg:mykey");
Defensive patterns

Strategy: validation

Validate before calling

String[] parts = value.split(":");
if (!parts[0].equals("i18n") || parts.length != 3) {
  throw new IllegalArgumentException("i18n value must be 'i18n:<package>:<key>': " + value);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/5bd50ac9d0b7440b. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/config/PropertySetter.java:78

      val = value;
    }

    try {
      // SET!
      BeanUtils.setProperty( obj, property, val );
    } catch ( Exception e ) {
      throw new KettleConfigException( e );
    }

  }

  private Object setI18nProperty( String[] expression, String value ) throws KettleConfigException {
    if ( expression.length == 3 ) {
      String packageName = expression[1];
      String key = expression[2];
      return BaseMessages.getString( packageName, key );
    } else {
      throw new KettleConfigException(
        "the i18, directive need 3 parameters: i18n, the package name and the key, but "
          + expression.length + " parameters were found in [" + value + "]" );
    }
  }

  private Object setOgnlProperty( String[] expression, String value ) throws KettleConfigException {
    if ( expression.length >= 2 ) {
      OgnlExpression expr = ognlExpressions.get( value );
      if ( expr == null ) {
        synchronized ( ognlExpressions ) {
          try {
            expr = new OgnlExpression( expression[1] );
            ognlExpressions.put( value, expr );

          } catch ( OgnlException e ) {
            throw new KettleConfigException( "Unable to parse expression [" + expression[1] + "] with Ognl", e );
          }
        }

View on GitHub (pinned to f3058517a1)