* Method collect own property and prototype
(locale, vocabularies)
| 972 | */ |
| 973 | |
| 974 | async function loadTranslation(locale, vocabularies) { |
| 975 | if (!locale) { |
| 976 | return Translation.createEmpty() |
| 977 | } |
| 978 | |
| 979 | let translation |
| 980 | |
| 981 | // check if it is a known translation |
| 982 | const langs = await Translation.getLangs() |
| 983 | if (langs[locale]) { |
| 984 | translation = new Translation(langs[locale]) |
| 985 | } else if (fileExists(path.join(store.codeceptDir, locale))) { |
| 986 | // get from a provided file instead |
| 987 | translation = Translation.createDefault() |
| 988 | translation.loadVocabulary(locale) |
| 989 | } else { |
| 990 | translation = Translation.createDefault() |
| 991 | } |
| 992 | |
| 993 | vocabularies.forEach(v => translation.loadVocabulary(v)) |
| 994 | |
| 995 | return translation |
| 996 | } |
| 997 | |
| 998 | function getHelperModuleName(helperName, config) { |
| 999 | // classical require |
no test coverage detected