parameters: (translations, ignore_list=[])
return_statement: return replace
docstring: Build Mapping.
  
      Generate a mapping of lang => { default_name => name }
docstring_summary: Build Mapping.
docstring_tokens: Build Mapping .
function: def build_mapping(translations, ignore_list=[]):
      """Build Mapping.
  
      Generate a mapping of lang => { default_name => name }
      """
      replace = defaultdict(dict)
      for _, item in translations.items():
          for lang, name in item.items():
              if lang == default_language:
                  continue
              default_name = item[default_language]
              if default_name in ignore_list:
                  continue
              if default_name.startswith("Unknown_"):
                  continue
              if default_name in replace[lang]:
                  existing_name = replace[lang][default_name]
                  if existing_name != name:
                      # Just clean this up in post.
                      # raise Exception('Conflict on %s: "%s" and "%s"' % (default_name, existing_name, name))
                      pass
              else:
                  if default_name and name:
                      replace[lang][default_name] = name
      return replace
function_tokens: def build_mapping ( translations , ignore_list = [ ] ) : replace = defaultdict ( dict ) for _ , item in translations . items ( ) : for lang , name in item . items ( ) : if lang == default_language : continue default_name = item [ default_language ] if default_name in ignore_list : continue if default_name . startswith ( "Unknown_" ) : continue if default_name in replace [ lang ] : existing_name = replace [ lang ] [ default_name ] if existing_name != name : # Just clean this up in post. # raise Exception('Conflict on %s: "%s" and "%s"' % (default_name, existing_name, name)) pass else : if default_name and name : replace [ lang ] [ default_name ] = name return replace