util/singleton/localization.js
// The localized array must be in the order defined by 'languagesToIndex' defined above
The localized array must be in the order defined by 'languagesToIndex' defined above
The localized array must be in the order defined by ' languagesToIndex ' defined above
function Localization (language, symbols) {
  Assert.assertIsValidString(
    language,
    Object.keys(languagesToIndex),
    'Error: Language must be one of {$languagesToIndex}')
  Assert.assertIsObject(
    symbols,
    'Error: symbols is an object that associates tokens with localized strings')
  const index = languagesToIndex[language]
  let result = {}
  for (let property in symbols) {
    result[property] = symbols[property][index]
  }
  return result
}
function Localization ( language , symbols ) { Assert . assertIsValidString ( language , Object . keys ( languagesToIndex ) , 'Error: Language must be one of {$languagesToIndex}' ) Assert . assertIsObject ( symbols , 'Error: symbols is an object that associates tokens with localized strings' ) const index = languagesToIndex [ language ] let result = { } for ( let property in symbols ) { result [ property ] = symbols [ property ] [ index ] } return result }
The localized array must be in the order defined by 'languagesToIndex' defined above
The localized array must be in the order defined by ' languagesToIndex ' defined above