public String getLanguageKey ( String path ) { // Parse language key from filename Matcher languageKeyMatcher = LANGUAGE_KEY_PATTERN . matcher ( path ) ; if ( ! languageKeyMatcher . matches ( ) ) return null ; // Return parsed key return languageKeyMatcher . group ( 1 ) ; }
Derives a language key from the filename within the given path if possible . If the filename is not a valid language key null is returned .