MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Merge

Method Merge

pkg/i18n/i18n.go:247–263  ·  view source on GitHub ↗

Merge messages from the given descriptor map into the current registry.

(other MessageDescriptorMap)

Source from the content-addressed store, hash-verified

245
246// Merge messages from the given descriptor map into the current registry.
247func (m MessageDescriptorMap) Merge(other MessageDescriptorMap) {
248 for id, other := range other {
249 if m[id] == nil {
250 m[id] = other
251 } else {
252 if other.Translations[defaultLanguage] != m[id].Translations[defaultLanguage] {
253 m[id].updated = true
254 }
255 for language, translation := range other.Translations {
256 if language == defaultLanguage {
257 continue // This one is set from the Define.
258 }
259 m[id].Translations[language] = translation
260 }
261 }
262 }
263}
264
265// Updated returns updated message descriptors.
266func (m MessageDescriptorMap) Updated() (updated []string) {

Callers 4

mainFunction · 0.45
initResourceFunction · 0.45
generateConsoleCSPStringFunction · 0.45
TestI18NFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestI18NFunction · 0.36