diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install index 3b26178..6aa5aa8 100644 --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -6,6 +6,20 @@ */ /** + * Implements hook_install(). + */ +function locale_install() { + // @todo Automatic translations download/import does not need the translations + // directory to exist. Only multi site installations may benefit from having + // this directory. A follow up issue will change this default: + // http://drupal.org/node/1851442 + + // Create the interface translations directory and ensure it's writable. + $directory = variable_get('locale_translate_file_directory', conf_path() . '/files/translations'); + file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); +} + +/** * Implements hook_uninstall(). */ function locale_uninstall() { diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 75ff0d8..44a3b30 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -154,26 +154,23 @@ function locale_help($path, $arg) { $output .= '
' . t('Translating interface text') . '
'; $output .= '
' . t('Translations of text in the Drupal interface may be provided by:'); $output .= '
'; $output .= ''; return $output; case 'admin/config/regional/language': - return '

' . t('Interface translations are automatically imported when a language is added, or when new modules or themes are enabled. Interface text can be customized.', array('@translate' => url('admin/config/regional/translate'))) . '

'; + return '

' . t('Interface translations are downloaded and imported automatically, check the status of Available translation updates. You can edit the interface translations at the Translate page.', array('@update' => url('admin/reports/translations'), '@translate' => url('admin/config/regional/translate'))) . '

'; case 'admin/config/regional/translate': - $output = '

' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to export strings for offline editing in a desktop Gettext translation editor.) Searches may be limited to strings in a specific language.', array('@export' => url('admin/config/regional/translate/export'))) . '

'; + $output = '

' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: Because translation tasks involves many strings, it may be more convenient to export strings for offline editing in a desktop Gettext translation editor). Searches may be limited to strings in a specific language.', array('@export' => url('admin/config/regional/translate/export'))) . '

'; return $output; case 'admin/config/regional/translate/import': - $output = '

' . t('This page imports the translated strings contained in an individual Gettext Portable Object (.po) file. Normally distributed as part of a translation package (each translation package may contain several .po files), a .po file may need to be imported after offline editing in a Gettext translation editor. Importing an individual .po file may be a lengthy process.') . '

'; - $output .= '

' . '' . t('Automatic imports of translations, if available, are done as new languages are added, or when new modules or themes are enabled.', array('@language' => url('admin/config/regional/language'))) . '' . '

'; - $output .= '

' . t('Alternatively, .po translation files can be imported manually on this page, by browsing for your local source .po files. Or, you can get community translation packages by downloading them from the Drupal translation page and then browse for those.', array('@translations' => 'http://localize.drupal.org')) . '

'; - $output .= '

' . t('Since this page only allows the import of one .po file at a time, it may be faster to download and extract a translation package into your Drupal installation directory and then add the language (which automatically imports all .po files within the package).', array('@language-add' => url('admin/config/regional/language/add'))); - $output .= ' ' . t('The Settings tab has more information for configuring your Translation source.') . '

'; + $output = '

' . t('This page imports the translated strings contained in a Gettext Portable Object (.po) file. Normally downloaded from the Drupal translation server. Also a .po file may need to be imported after offline editing in a Gettext translation editor. Importing an individual .po file may be a lengthy process.', array('@url' => 'http://localize.drupal.org')) . '

'; + $output .= '

' . t('Note that the .po files are automatically downloaded and imported when new modules or themes are enabled. This is strongly encouraged for interface translation.') . '

'; return $output; case 'admin/config/regional/translate/export': diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index 7bee3ce..7f999d3 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -605,9 +605,22 @@ function locale_translation_status_form($form, &$form_state) { drupal_set_message(t('No translatable languages available. Add language first.', array('@add_lanuage' => url('admin/config/regional/language'))), 'warning'); } + $last = state()->get('locale.translation_last_checked'); + $markup = '
'; + $markup .= $last ? t('Last checked: @time ago', array('@time' => format_interval(REQUEST_TIME - $last))) : t('Last checked: never'); + $markup .= ' (' . l(t('Check manually'), 'admin/reports/translations/check', array('query' => drupal_get_destination())) . ')'; + $markup .= "
\n"; + $form['last_checked'] = array( + '#markup' => '

' . $markup . '

', + ); + // @todo Add user interface update for translation update. // Followup issues: Display translation status http://drupal.org/node/1804702 // and Translations update feature UX http://drupal.org/node/1029554 + $form['temporary_note'] = array( + '#markup' => '

' . 'The translation status will be included here. See http://drupal.org/node/1804702 for more information.' . '

', + ); + $form['langcodes'] = array( '#type' => 'value', '#value' => drupal_map_assoc(array_keys($languages)),