{"record":{"id":"3332cb3310d88fcd","repo":"pentaho/pentaho-kettle","slug":"unable-to-read-messages-file-for-locale","errorCode":null,"errorMessage":"Unable to read messages file for locale : '","messagePattern":"Unable to read messages file for locale : '","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/i18n/MessagesStore.java","lineNumber":111,"sourceCode":"      }\n    } catch ( Exception e ) {\n      String keys = \"[\";\n      Map<String, List<KeyOccurrence>> po = sourcePackageOccurrences.get( sourceFolder );\n      List<KeyOccurrence> keyList = po == null ? new ArrayList<KeyOccurrence>() : po.get( messagesPackage );\n      if ( keyList == null ) {\n        keyList = new ArrayList<KeyOccurrence>();\n      }\n      boolean first = true;\n      for ( KeyOccurrence occ : keyList ) {\n        if ( first ) {\n          first = false;\n        } else {\n          keys += \", \";\n        }\n        keys += occ.getKey() + \"/\" + occ.getFileObject().toString();\n      }\n      keys += \"]\";\n      throw new KettleException( \"Unable to read messages file for locale : '\"\n        + locale + \"' and package '\" + messagesPackage + \"', keys=\" + keys, e );\n    }\n  }\n\n  public void write() throws KettleException {\n    if ( filename == null ) {\n      throw new KettleException( \"Please specify a filename before saving messages store for package '\"\n        + messagesPackage + \"' and locale '\" + locale + \"\" );\n    }\n    write( filename );\n  }\n\n  public void write( String filename ) throws KettleException {\n    try {\n      File file = new File( filename );\n      if ( !file.exists() ) {\n        File parent = file.getParentFile();\n        if ( !parent.exists() ) {","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/i18n/MessagesStore.java#L93-L129","documentation":"MessagesStore.read() throws this when it cannot read a messages_<locale>.properties file for a given locale and messages package (used by the Pentaho Translator tool). It aggregates occurrences (key/file) into the message to pinpoint the bad file. Typically the underlying IOException/properties parse failure comes from a missing or malformed properties file.","triggerScenarios":"read() is asked for a locale/package whose properties file does not exist in any source folder, is unreadable (permissions), or cannot be parsed as a properties file (bad encoding, invalid escapes).","commonSituations":"Editing translations in the Translator tool against a source folder where the expected messages file was renamed or moved; a locale variant (e.g. messages_es_ES.properties vs messages_es.properties) mismatch; files with wrong encoding after a git or editor change.","solutions":["Check the keys= list in the message: open/verify each listed file exists and is readable at that path.","Confirm the locale string matches the filename pattern messages_<locale>.properties exactly.","Ensure the source folders configured for the store include the folder containing the file.","Validate the properties file syntax/encoding (ASCII with \\u escapes or UTF-8 handled by the loader)."],"exampleFix":"// before\nstore.read(); // fails: messages_es_ES.properties missing in configured folders\n\n// after\nFile expected = new File( sourceFolder + \"/org/pentaho/di/messages/messages_\" + locale + \".properties\" );\nif ( !expected.exists() ) {\n  throw new IllegalStateException( \"Missing messages file: \" + expected.getAbsolutePath() );\n}\nstore.read();","handlingStrategy":"validation","validationCode":"File f = new File( sourceFolder + \"/\" + messagesPackage.replace( '.', '/' ) + \"/messages_\" + locale + \".properties\" );\nif ( !f.isFile() ) throw new IllegalStateException( \"Missing messages file: \" + f );","typeGuard":null,"tryCatchPattern":"try {\n  store.read();\n} catch ( KettleException e ) {\n  log.error( \"Check keys= list for the offending locale/package files: \" + e.getMessage() );\n}","preventionTips":["Keep locale file names exactly messages_<locale>.properties","Verify source folder configuration before running the Translator","Check properties file encoding after editor/git operations"],"tags":["i18n","properties-file","file-read","locale"],"backgroundTag":"file-not-found","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"}