(language)
| 208 | } |
| 209 | |
| 210 | function getTranslation(language) { |
| 211 | if (!translations) { |
| 212 | // Translations not loaded yet, return null (will use default) |
| 213 | return null |
| 214 | } |
| 215 | |
| 216 | const translationKeys = Object.keys(translations) |
| 217 | for (const availableTranslation of translationKeys) { |
| 218 | if (!language) { |
| 219 | break |
| 220 | } |
| 221 | |
| 222 | if (availableTranslation.includes(language)) { |
| 223 | return translations[availableTranslation] |
| 224 | } |
| 225 | } |
| 226 | return null |
| 227 | } |
| 228 | |
| 229 | export { loadTranslations } |
| 230 | export default gherkinParser |
no test coverage detected