           lang_obj.name = language_names[tag_name][1]
 
         projectTapI18n.language_names[tag_name] = lang_obj
-
     else
       log "tap-i18n is not enabled in the project level, don't build unified languages files"
 
-  # Once per ARCH per build cycle
-  if not (compileStep.arch of build_files_once_arch_log)
+  oncePerCyclePerArch = (arch) ->
     if projectTapI18n?
       # If tap-i18n is enabled, add the project configurations to the TAPi18n
       # object if we haven't done that for the current arch already. (remember:


  return map

buildUnifiedLangFiles = (compileStep=null, lang_files_path=default_build_files_path, supported_languages=null, project_translations_dir=null) ->
  # Build the unified languages files on lang_files_path
  #
  # Returns an object whose keys are all the supported languages (if
  # lang_files_path is null all the languages we find translation files to
  # either in the project or in the packages are considered supported). The
  # value for each key is *true* if we generated a language file for that
  # language *false* otherwise. (language file is not generated if the language
  # is supported but there are no files for it).
  #
  # Attributes:
  # lang_files_path (string): the path we build the unified languages files to
  # supported_languages (array or null): Array of languages tags to which
  # unified files will be built. If null, a language file will be built for any
  # language the project or one of its packages was translated to.

  log "Building unified files directory: #{lang_files_path}"

  lang_files_path = removeFileTrailingSeparator lang_files_path
  lang_files_backup_path = "#{lang_files_path}~"

  getLangFilePath = (lang) ->
    lang_files_path + path.sep + lang + ".json"

  # Remove old backup
  try
    wrench.rmdirSyncRecursive lang_files_backup_path
    log "Old languages files backup #{lang_files_backup_path} removed"
  catch error

  # Create a backup for current lang_files_path
  try
    fs.renameSync lang_files_path, lang_files_backup_path
    log "[IMPORTANT] unified languages files folder #{lang_files_path} already exists. Backing it up"
    log "[IMPORTANT] to #{lang_files_backup_path}. If you need to, save the backup before building your"
    log "[IMPORTANT] project again - otherwise you'll lose it."
  catch error

  # Create the new languages files dir
  try
    wrench.mkdirSyncRecursive lang_files_path, 0o744 # 0744 - owner: rwx, rest: r
  catch error
    throw new Meteor.Error 500, "Can't create folder `#{lang_files_path}'",
      {error: error}

  # A rollback procedure to use on failure
  rollback = ->
    log "Build failed, rolling back `#{lang_files_path}'"
    wrench.rmdirSyncRecursive lang_files_path
    try
      fs.renameSync lang_files_backup_path, lang_files_path
    catch error

  packageTapI18nMaps =
    (wrench.readdirSyncRecursive project_root, (x) -> /package-tap.i18n$/.test(x)).map (x) -> loadPackageTapMap(x)

    _.each dialects, (dialect) ->
      base_language = (dialect.split "-")[0]
      if not (base_language of languages_files)
        throw new Meteor.Error 500, "Package #{package_map.name} has no language file for the base language (#{base_language}) of the dialect (#{dialect})"

    if supported_languages
