func MergeTranslations(translations map[uint16]*Info) *Info {
	vi := &Info{}

	main := findMainTranslation(translations)
	if main == nil {
		return vi
	}
	vi.Flags = main.Flags
	vi.Type = main.Type
	vi.Timestamp = main.Timestamp
	vi.ProductVersion = main.ProductVersion
	vi.FileVersion = main.FileVersion

	for langID, trans := range translations {
		st := trans.lt[langID]
		if st == nil || len(*st) == 0 {
			st = trans.lt[LangNeutral]
			if st == nil || len(*st) == 0 {
				st = trans.singleLang()
				if st == nil {
					continue
				}
			}
		}
		for k, v := range *st {
			vi.Set(langID, k, v)
		}
	}

	return vi
}
// MergeTranslations merges several VERSIONINFO structs into one multilingual struct.
//
// The fixed part will be taken in priority from:
//  1. The neutral language (zero)
//  2. The default language (en-US)
//  3. The first language ID in ascending order
//
// Each struct corresponds to one translation, and its language ID will be the one it is mapped to.
//
// This means that each struct is supposed to contain exactly one translation,
// either neutral or of same language ID as it is mapped to.
//
// If a struct contains several translations, those that don't correspond to the map key will be ignored.
//
// If a struct contains one translation with a different language ID,
// it will be imported as if it had been the same value as the map key.
//
MergeTranslations merges several VERSIONINFO structs into one multilingual struct.

The fixed part will be taken in priority from:
1. The neutral language (zero)
2. The default language (en-US)
3. The first language ID in ascending order

Each struct corresponds to one translation, and its language ID will be the one it is mapped to.

This means that each struct is supposed to contain exactly one translation,
either neutral or of same language ID as it is mapped to.

If a struct contains several translations, those that don't correspond to the map key will be ignored.

If a struct contains one translation with a different language ID,
it will be imported as if it had been the same value as the map key.
// MergeTranslations merges several VERSIONINFO structs into one multilingual struct . // // The fixed part will be taken in priority from : // 1 . The neutral language ( zero ) // 2 . The default language ( en - US ) // 3 . The first language ID in ascending order // // Each struct corresponds to one translation and its language ID will be the one it is mapped to . // // This means that each struct is supposed to contain exactly one translation // either neutral or of same language ID as it is mapped to . // // If a struct contains several translations those that don ' t correspond to the map key will be ignored . // // If a struct contains one translation with a different language ID // it will be imported as if it had been the same value as the map key . //
func MergeTranslations(translations map[uint16]*Info) *Info {
	vi := &Info{}
	main := findMainTranslation(translations)
	if main == nil {
		return vi
	}
	vi.Flags = main.Flags
	vi.Type = main.Type
	vi.Timestamp = main.Timestamp
	vi.ProductVersion = main.ProductVersion
	vi.FileVersion = main.FileVersion
	for langID, trans := range translations {
		st := trans.lt[langID]
		if st == nil || len(*st) == 0 {
			st = trans.lt[LangNeutral]
			if st == nil || len(*st) == 0 {
				st = trans.singleLang()
				if st == nil {
					continue
				}
			}
		}
		for k, v := range *st {
			vi.Set(langID, k, v)
		}
	}
	return vi
}
func MergeTranslations ( translations map [ uint16 ] * Info ) * Info { vi := & Info { } main := findMainTranslation ( translations ) if main == nil { return vi } vi . Flags = main . Flags vi . Type = main . Type vi . Timestamp = main . Timestamp vi . ProductVersion = main . ProductVersion vi . FileVersion = main . FileVersion for langID , trans := range translations { st := trans . lt [ langID ] if st == nil || len ( * st ) == 0 { st = trans . lt [ LangNeutral ] if st == nil || len ( * st ) == 0 { st = trans . singleLang ( ) if st == nil { continue } } } for k , v := range * st { vi . Set ( langID , k , v ) } } return vi }
MergeTranslations merges several VERSIONINFO structs into one multilingual struct.
MergeTranslations merges several VERSIONINFO structs into one multilingual struct .