Loads and flattens a locale file.
(locale)
| 79 | |
| 80 | /** Loads and flattens a locale file. */ |
| 81 | async function getLocaleMap(locale) { |
| 82 | try { |
| 83 | const module = await loadLocaleModule(locale); |
| 84 | return flatten(module); |
| 85 | } catch (error) { |
| 86 | console.error(`Error loading locale "${locale}":`, error.message); |
| 87 | return {}; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | /** Safely reads a JSON file. */ |
| 92 | function loadJson(filePath) { |
no test coverage detected