import { basename } from 'path' ; import { fromRoot } from '@kbn/utils' ; import { getTranslationPaths } from './get_translation_paths' ; export const getKibanaTranslationFiles = async ( locale , pluginPaths ) : Promise < string [ ] > => { const translationPaths = await Promise . all ( [ getTranslationPaths ( { cwd : fromRoot ( '.' ) , nested : true , } ) , ... pluginPaths . map ( ( pluginPath ) => getTranslationPaths ( { cwd : pluginPath , nested : false } ) ) , getTranslationPaths ( { cwd : fromRoot ( '../kibana-extra' ) , nested : true , } ) , ] ) ; return ( [ ] as string [ ] ) . concat ( ... translationPaths ) . filter ( ( translationPath ) => basename ( translationPath , '.json' ) === locale ) ; } ;