(key: string)
| 37 | } |
| 38 | |
| 39 | export function getAllLocalizations(key: string) { |
| 40 | const obj: { [key: string]: string } = {}; |
| 41 | const splitKey = key.split("."); |
| 42 | for (const [locale, data] of locales.entries()) { |
| 43 | let str: string | undefined; |
| 44 | try { |
| 45 | str = splitKey.reduce((prev, cur) => prev[cur], data); |
| 46 | } catch { |
| 47 | /* empty */ |
| 48 | } |
| 49 | if (!str) continue; |
| 50 | obj[locale] = str; |
| 51 | } |
| 52 | return obj; |
| 53 | } |
no outgoing calls
no test coverage detected