@@ -124,7 +124,7 @@ func stringSliceContains(haystack []string, needle string) bool {
124124 return false
125125}
126126
127- func makeLocalToRemoteLanguageMappings (
127+ func makeRemoteToLocalLanguageMappings (
128128 cfg config.Config , cfgResource config.Resource ,
129129) map [string ]string {
130130 // In the configuration, the language mappings are "remote code -> local
@@ -133,24 +133,22 @@ func makeLocalToRemoteLanguageMappings(
133133 // reverse the maps
134134
135135 result := make (map [string ]string )
136- for key , value := range cfg .Local .LanguageMappings {
137- result [value ] = key
136+ for transifexLanguageCode , localLanguageCode := range cfg .Local .LanguageMappings {
137+ result [transifexLanguageCode ] = localLanguageCode
138138 }
139- for key , value := range cfgResource .LanguageMappings {
139+ for transifexLanguageCode , localLanguageCode := range cfgResource .LanguageMappings {
140140 // Resource language mappings overwrite "global" language mappings
141- result [value ] = key
141+ result [transifexLanguageCode ] = localLanguageCode
142142 }
143143 return result
144144}
145145
146- func makeRemoteToLocalLanguageMappings (
147- localToRemoteLanguageMappings map [string ]string ,
148- ) map [string ]string {
149- result := make (map [string ]string )
150- for key , value := range localToRemoteLanguageMappings {
151- result [value ] = key
146+ func reverseMap (src map [string ]string ) map [string ]string {
147+ dst := make (map [string ]string )
148+ for key , value := range src {
149+ dst [value ] = key
152150 }
153- return result
151+ return dst
154152}
155153
156154/*
0 commit comments