You are here

function l10n_update_import_file in Localization update 7

Same name and namespace in other branches
  1. 6 l10n_update.inc \l10n_update_import_file()

Import local file into the database.

Parameters

$file: File object of localy stored file or path to localy stored file.

$locale: Language code.

$mode: Download mode. How to treat exising and modified translations.

Return value

boolean Result array on success. FALSE on failure

2 calls to l10n_update_import_file()
l10n_update_download_import in ./l10n_update.inc
Download and import remote translation file.
l10n_update_source_import in ./l10n_update.check.inc
Import source into locales table.

File

./l10n_update.inc, line 78

Code

function l10n_update_import_file($file, $locale, $mode = LOCALE_IMPORT_OVERWRITE) {

  // If the file is a uri, create a $file object
  if (is_string($file)) {
    $uri = $file;
    $file = new stdClass();
    $file->uri = $uri;
    $file->filename = $uri;
  }
  return _l10n_update_locale_import_po($file, $locale, $mode, 'default');
}