diff --git a/i18n.install b/i18n.install index dd4c496..b9941f8 100644 --- a/i18n.install +++ b/i18n.install @@ -24,7 +24,7 @@ function i18n_install() { * necessary when additional implementations of hook_schema_alter() have * become available since the schema was originally built. */ -function i18n_install_create_fields($table, $fields, $force_rebuild_schema = FALSE) { +function i18n_install_create_fields($table, array $fields, $force_rebuild_schema = FALSE) { static $schema; $rebuild_schema = !isset($schema) || $force_rebuild_schema; $schema = backdrop_get_schema($table, $rebuild_schema); diff --git a/i18n.module b/i18n.module index 628b9ec..dcbab9b 100644 --- a/i18n.module +++ b/i18n.module @@ -362,7 +362,7 @@ function i18n_preprocess_html(&$variables) { * @return string * Translated string, $string if not found. */ -function i18n_string($name, $string, $options = array()) { +function i18n_string($name, $string, array $options = array()) { $options += array('translate' => TRUE, 'update' => FALSE); if ($options['update']) { $result = function_exists('i18n_string_update') ? i18n_string_update($name, $string, $options) : FALSE; diff --git a/i18n_field/i18n_field.i18n.inc b/i18n_field/i18n_field.i18n.inc index e21a84d..3d28c04 100644 --- a/i18n_field/i18n_field.i18n.inc +++ b/i18n_field/i18n_field.i18n.inc @@ -27,7 +27,6 @@ function i18n_field_i18n_object_info() { 'title' => t('Label'), ), ), - // 'translate path' => 'admin/structure/block/manage/%module/%delta/translate/%i18n_language', ), ); $info['field_instance'] = array( diff --git a/i18n_field/i18n_field.module b/i18n_field/i18n_field.module index 938628e..f26447b 100644 --- a/i18n_field/i18n_field.module +++ b/i18n_field/i18n_field.module @@ -419,7 +419,7 @@ function i18n_field_instance_update_strings($instance) { * The array of allowed values. Keys of the array are the raw stored values * (number or text), values of the array are the display labels. */ -function i18n_field_translate_allowed_values($field, $langcode = NULL) { +function i18n_field_translate_allowed_values(array $field, $langcode = NULL) { if (!empty($field['settings']['allowed_values'])) { $context = array( 'field', diff --git a/i18n_field/i18n_field.pages.inc b/i18n_field/i18n_field.pages.inc index 6757c06..44144d9 100644 --- a/i18n_field/i18n_field.pages.inc +++ b/i18n_field/i18n_field.pages.inc @@ -20,7 +20,6 @@ function i18n_field_page_translate($instance, $language = NULL) { // language object loader is not working. $language = i18n_language_object($language); backdrop_set_title(t('Translate to !language', array('!language' => i18n_language_name($language->langcode)))); - // Return backdrop_get_form('i18n_field_page_translate_form', $instance, $language->language); // Create form with two tabs, one for instance, once for field. $groups = array( 'instance' => t('Field instance'), diff --git a/i18n_menu/i18n_menu.admin.inc b/i18n_menu/i18n_menu.admin.inc index aa6091f..c13937d 100644 --- a/i18n_menu/i18n_menu.admin.inc +++ b/i18n_menu/i18n_menu.admin.inc @@ -139,6 +139,8 @@ function i18n_menu_translation_form_submit($form, &$form_state) { * @param array $item * The menu item or the node type for which to generate a list of parents. * If $item['mlid'] == 0 then the complete tree is returned. + * @param string $langcode + * Language code. * * @return array * An array of menu link titles keyed on the a string containing the menu name @@ -147,7 +149,7 @@ function i18n_menu_translation_form_submit($form, &$form_state) { * @todo This has to be turned into a #process form element callback. The * 'menu_override_parent_selector' variable is entirely superfluous. */ -function i18n_menu_parent_options($menus, $item, $langcode) { +function i18n_menu_parent_options(array $menus, array $item, $langcode) { // The menu_links table can be practically any size and we need a way to // allow contrib modules to provide more scalable pattern choosers. // hook_form_alter is too late in itself because all the possible parents are diff --git a/i18n_menu/i18n_menu.module b/i18n_menu/i18n_menu.module index 474b462..60318ff 100644 --- a/i18n_menu/i18n_menu.module +++ b/i18n_menu/i18n_menu.module @@ -401,6 +401,8 @@ function i18n_menu_localize_tree($tree, $langcode = NULL) { /** * Localize menu renderable array. + * + * @todo This might be dead code, for example $tree in if clause is never set. */ function i18n_menu_localize_elements(&$elements) { foreach (element_children($elements) as $mlid) { diff --git a/i18n_node/i18n_node.module b/i18n_node/i18n_node.module index c0bd39f..c91724b 100644 --- a/i18n_node/i18n_node.module +++ b/i18n_node/i18n_node.module @@ -113,7 +113,7 @@ function i18n_node_get_lang($nid, $default = '') { * This allows node types to define its own language list * implementing hook 'language_list'. * - * @param object $node + * @param Node $node * Node to retrieve language list for. * @param bool $translate * Only languages available for translation. diff --git a/i18n_node/i18n_node.pages.inc b/i18n_node/i18n_node.pages.inc index d4e9f72..06ff1af 100644 --- a/i18n_node/i18n_node.pages.inc +++ b/i18n_node/i18n_node.pages.inc @@ -276,7 +276,7 @@ function i18n_node_nid2autocomplete($nid) { * @param string $field * Form field name attribute. */ -function i18n_node_autocomplete2nid($name, $type, $language, $field = NULL) { +function i18n_node_autocomplete2nid($name, $type, array $language, $field = NULL) { if (!empty($name)) { preg_match('/^(?:\s*|(.*) )?\[\s*nid\s*:\s*(\d+)\s*\]$/', $name, $matches); if (!empty($matches)) { @@ -316,7 +316,7 @@ function i18n_node_autocomplete2nid($name, $type, $language, $field = NULL) { * @param array $params * Other query arguments: type, language or numeric ones. */ -function _i18n_node_references($string, $match = 'contains', $params = array(), $limit = 10) { +function _i18n_node_references($string, $match = 'contains', array $params = array(), $limit = 10) { $query = db_select('node', 'n') ->fields('n', array('nid', 'title', 'type')) ->orderBy('n.title') diff --git a/i18n_path/i18n_path.module b/i18n_path/i18n_path.module index 0c9b52e..fd55d11 100644 --- a/i18n_path/i18n_path.module +++ b/i18n_path/i18n_path.module @@ -62,21 +62,6 @@ function i18n_path_menu() { return $items; } -/** - * Implements hook_url_outbound_alter() - */ -/* -function i18n_path_url_outbound_alter(&$path, &$options, $original_path) { -if (!empty($options['language'])) { -$langcode = $options['language']->language; -$original = $options['alias'] ? backdrop_get_normal_path($path, $langcode) : $original_path; -if (($translations = i18n_path_get_translations($path)) && !empty($translations[$langcode])) { -$path = $options['alias'] ? backdrop_get_path_alias($translations[$langcode], $langcode) : $translations[$langcode]; -} -} -} - */ - /** * Get translations for path. */ diff --git a/i18n_string/i18n_string.admin.inc b/i18n_string/i18n_string.admin.inc index 66d6915..3f3b4c5 100644 --- a/i18n_string/i18n_string.admin.inc +++ b/i18n_string/i18n_string.admin.inc @@ -161,7 +161,7 @@ function i18n_string_refresh_string_list($strings) { * @param bool $delete * Optional, delete existing (but not refresed, strings and translations) */ -function i18n_string_refresh_batch($groups, $delete = FALSE) { +function i18n_string_refresh_batch(array $groups, $delete = FALSE) { $operations = array(); foreach ($groups as $group) { $operations[] = array('_i18n_string_batch_refresh_prepare', array($group)); diff --git a/i18n_string/i18n_string.i18n.inc b/i18n_string/i18n_string.i18n.inc index 0c5272f..74745ae 100644 --- a/i18n_string/i18n_string.i18n.inc +++ b/i18n_string/i18n_string.i18n.inc @@ -80,9 +80,6 @@ function i18n_string_object_type_string_list($type) { * @see backdrop_array_merge_deep() * @see array_merge_recursive() * - * @param ... - * Arrays to merge. - * * @return array * The merged array. */ diff --git a/i18n_string/i18n_string.inc b/i18n_string/i18n_string.inc index 4253156..8cc0587 100644 --- a/i18n_string/i18n_string.inc +++ b/i18n_string/i18n_string.inc @@ -267,7 +267,7 @@ class i18n_string_object { /** * Get source string provided a string object. * - * @return object + * @return object|null * String object if source exists. */ public function get_source() { @@ -609,7 +609,7 @@ class i18n_string_textgroup_default { * @param array $options * Additional options. * - * @return status + * @return int|false * SAVED_UPDATED | SAVED_NEW | SAVED_DELETED | FALSE (If the string is * to be removed but has no source) */ @@ -865,7 +865,7 @@ class i18n_string_textgroup_default { * - 'check', whether to check string format and then update/delete * if not allowed. */ - public function context_update($context, $string, $options = array()) { + public function context_update($context, $string, array $options = array()) { $options += array( 'format' => FALSE, 'messages' => $this->debug, @@ -916,7 +916,7 @@ class i18n_string_textgroup_default { * @return array * Array of i18n string objects. */ - protected function multiple_translation_build($translations, $langcode) { + protected function multiple_translation_build(array $translations, $langcode) { $strings = array(); foreach ($translations as $translation) { // The string object may be already in list. @@ -954,7 +954,7 @@ class i18n_string_textgroup_default { * @return array * Array of string objects with translation set. */ - protected function multiple_translation_load($conditions, $langcode) { + protected function multiple_translation_load(array $conditions, $langcode) { $conditions += array( 'language' => $langcode, 'textgroup' => $this->textgroup, @@ -1061,7 +1061,7 @@ class i18n_string_textgroup_default { * @param array $strings * Array of strings (may be empty) to cache. */ - protected function multiple_cache_set($context, $strings) { + protected function multiple_cache_set(array $context, array $strings) { $cache_key = implode(':', $context); $this->cache_multiple[$cache_key] = $strings; } @@ -1076,7 +1076,7 @@ class i18n_string_textgroup_default { * Array of strings (may be empty) if we've got a cache hit. * Null otherwise. */ - protected function multiple_cache_get($context) { + protected function multiple_cache_get(array $context) { $cache_key = implode(':', $context); if (isset($this->cache_multiple[$cache_key])) { return $this->cache_multiple[$cache_key]; @@ -1116,7 +1116,7 @@ class i18n_string_textgroup_default { * Array of string objects (with translation) * indexed by the placeholder field. */ - public function multiple_translate($context, $strings = array(), $options = array()) { + public function multiple_translate(array $context, array $strings = array(), array $options = array()) { // First, build conditions and identify the variable field. $search = $context = array_combine(array('type', 'objectid', 'property'), $context); $langcode = isset($options['langcode']) ? $options['langcode'] : i18n_langcode(); @@ -1169,7 +1169,7 @@ class i18n_string_textgroup_default { * @param object $translation * String translation for this language. */ - public function update_translation($context, $langcode, $translation) { + public function update_translation(array $context, $langcode, $translation) { $i18nstring = $this->build_string($context); if ($source = $i18nstring->get_source()) { $source->set_translation($translation, $langcode); @@ -1219,7 +1219,7 @@ class i18n_string_object_wrapper extends i18n_object_wrapper { * Array with processing options. * - 'empty', whether to return empty strings, defaults to FALSE. */ - public function get_strings($options = array()) { + public function get_strings(array $options = array()) { $options += array('empty' => FALSE); $strings = array(); foreach ($this->get_properties() as $textgroup => $textgroup_list) { @@ -1585,7 +1585,7 @@ class i18n_string_textgroup_cached extends i18n_string_textgroup_default { * Array of strings (may be empty) if we've got a cache hit. * Null otherwise. */ - protected function multiple_cache_get($context) { + protected function multiple_cache_get(array $context) { // Ensure the values from the persistent cache are properly re-build. $cache_key = implode(':', $context); if (isset($this->cache_multiple[$cache_key])) { diff --git a/i18n_string/i18n_string.module b/i18n_string/i18n_string.module index e748f68..3c29730 100644 --- a/i18n_string/i18n_string.module +++ b/i18n_string/i18n_string.module @@ -1016,8 +1016,8 @@ function i18n_string_translation_search($name, $langcode = NULL) { * @param array|string $name * Array or string concatenated with ':' that contains * textgroup and string context. - * @param string $translation - * Translation string for this language code. + * @param array|string $translation + * Translation string for this language code. Might be an array with multiple. * @param string $langcode * The language code to translate to a language other than * what is used to display the page. diff --git a/i18n_string/views/i18n_string_views_handler_argument_locale_group.inc b/i18n_string/views/i18n_string_views_handler_argument_locale_group.inc index 388092e..989c8e3 100644 --- a/i18n_string/views/i18n_string_views_handler_argument_locale_group.inc +++ b/i18n_string/views/i18n_string_views_handler_argument_locale_group.inc @@ -14,7 +14,7 @@ class i18n_string_views_handler_argument_locale_group extends views_handler_argu * Set up. */ public function construct() { - parent::construct('group'); + parent::construct(); } /** diff --git a/i18n_sync/i18n_sync.module b/i18n_sync/i18n_sync.module index 0d311ba..2469589 100644 --- a/i18n_sync/i18n_sync.module +++ b/i18n_sync/i18n_sync.module @@ -136,6 +136,8 @@ function i18n_sync_node_check($node) { /** * Get node translations if any, excluding the node itself. * + * @param Node $node + * The node object. * @param bool $reset * Whether to reset the translation_node_get_translations cache. */ diff --git a/i18n_sync/i18n_sync.node.inc b/i18n_sync/i18n_sync.node.inc index a392e28..ff4f287 100644 --- a/i18n_sync/i18n_sync.node.inc +++ b/i18n_sync/i18n_sync.node.inc @@ -103,6 +103,11 @@ function i18n_sync_node_translation_nodereference_field(&$node, &$translation, $ * English A and B are translated to German A and B, but English C is not. * The syncronization from English A to German A * would it German B and English C. + * + * @param Node $reference_node + * The node object. + * @param string $langcode + * The language code. */ function i18n_sync_node_translation_reference_field(&$reference_node, $default_value, $langcode) { if (isset($reference_node->tnid) && translation_supported_type($reference_node->type)) { diff --git a/i18n_taxonomy/i18n_taxonomy.install b/i18n_taxonomy/i18n_taxonomy.install index f64c738..756399f 100644 --- a/i18n_taxonomy/i18n_taxonomy.install +++ b/i18n_taxonomy/i18n_taxonomy.install @@ -20,8 +20,8 @@ function i18n_taxonomy_install() { if (isset($data['language']) && $data['language'] == TAXONOMY_LANGUAGE_ENABLED) { // But only if multilingual support is enabled. $data['i18n_mode'] = I18N_MODE_NONE; - $data['langcode'] = LANGAGE_NONE; - $config->save($data); + $data['langcode'] = LANGUAGE_NONE; + $config->save(); } } } @@ -39,7 +39,7 @@ function i18n_taxonomy_uninstall() { $data = $config->get(); unset($data['i18n_mode']); unset($data['langcode']); - $config->save($data); + $config->save(); } } diff --git a/i18n_taxonomy/i18n_taxonomy.module b/i18n_taxonomy/i18n_taxonomy.module index 9400a19..4d9fbf1 100644 --- a/i18n_taxonomy/i18n_taxonomy.module +++ b/i18n_taxonomy/i18n_taxonomy.module @@ -475,12 +475,12 @@ function i18n_taxonomy_term_description($term, $langcode = NULL) { /** * Find term translation from translation set. * - * @param object $term + * @param TaxonomyTerm $term * Term object to find translation. * @param string $langcode * Language code to find translation for. * - * @return object + * @return TaxonomyTerm|null * Taxonomy Term, translated if exists. */ function i18n_taxonomy_term_get_translation($term, $langcode) { @@ -623,6 +623,9 @@ function i18n_taxonomy_taxonomy_term_update($term) { /** * Implements hook_taxonomy_term_delete(). + * + * @param TaxonomyTerm $term + * The term object. */ function i18n_taxonomy_taxonomy_term_delete($term) { // If a translation set exists for this term, remove this term from the set. @@ -1087,7 +1090,7 @@ function i18n_taxonomy_form_all_localize(&$item) { * Array with translated terms: tid -> $term * Array with vid and term array. */ -function i18n_taxonomy_translate_terms($taxonomy, $langcode, $fullterms = TRUE) { +function i18n_taxonomy_translate_terms(array $taxonomy, $langcode, $fullterms = TRUE) { $translation = array(); if (is_array($taxonomy) && $taxonomy) { foreach ($taxonomy as $index => $tdata) {