l10n_update.api.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @file
  4. * API documentation for Localize updater module.
  5. */
  6. /**
  7. * Alter the list of project to be updated by l10n update.
  8. *
  9. * l10n_update uses the same list of projects as update module. Using this hook
  10. * the list can be altered.
  11. *
  12. * @param array $projects
  13. * Array of projects.
  14. */
  15. function hook_l10n_update_projects_alter(&$projects) {
  16. // The $projects array contains the project data produced by
  17. // update_get_projects(). A number of the array elements are described in
  18. // the documentation of hook_update_projects_alter().
  19. // In the .info file of a project a localization server can be specified.
  20. // Using this hook the localization server specification can be altered or
  21. // added. The 'l10n path' element is optional but can be specified to override
  22. // the translation download path specified in the 10n_server.xml file.
  23. $projects['existing_example_project'] = array(
  24. 'info' => array(
  25. 'l10n path' => 'http://example.com/files/translations/%core/%project/%project-%release.%language.po',
  26. ),
  27. );
  28. // With this hook it is also possible to add a new project wich does not
  29. // exist as a real module or theme project but is treated by the localization
  30. // update module as one. The below data is the minumum to be specified.
  31. // As in the previous example the 'l10n path' element is optional.
  32. $projects['new_example_project'] = array(
  33. 'project_type' => 'module',
  34. 'name' => 'new_example_project',
  35. 'info' => array(
  36. 'name' => 'New example project',
  37. 'version' => '7.x-1.5',
  38. 'core' => '7.x',
  39. 'l10n path' => 'http://example.com/files/translations/%core/%project/%project-%release.%language.po',
  40. ),
  41. );
  42. }