* Gets the string matching the specified localized string ID in the language * specified. * @param {!{[key: string]: !LocalizedStringBundleDef}} localizedStringBundles * @param {!Array } languageCodes * @param {!LocalizedStringId_Enum} localizedStringId * @return {?string}
( localizedStringBundles, languageCodes, localizedStringId )
| 32 | * @return {?string} |
| 33 | */ |
| 34 | function findLocalizedString( |
| 35 | localizedStringBundles, |
| 36 | languageCodes, |
| 37 | localizedStringId |
| 38 | ) { |
| 39 | for (const code of languageCodes) { |
| 40 | const entry = localizedStringBundles[code]?.[localizedStringId]; |
| 41 | if (entry != null) { |
| 42 | // In unminified builds, this is an object {"string": "foo", ...}. |
| 43 | // In minified builds, this is the actual string "foo". |
| 44 | return entry['string'] || entry; |
| 45 | } |
| 46 | } |
| 47 | return null; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @param {string} languageCode |
no outgoing calls
no test coverage detected