diff --git a/user_relationship_blocks/templates/user_relationships-block.tpl.php b/user_relationship_blocks/templates/user_relationships-block.tpl.php index 25a0449..2c1e3cd 100644 --- a/user_relationship_blocks/templates/user_relationships-block.tpl.php +++ b/user_relationship_blocks/templates/user_relationships-block.tpl.php @@ -8,16 +8,14 @@ if ($relationships) { $showing_all_types = $settings->rtid == UR_BLOCK_ALL_TYPES; $rows = array(); foreach ($relationships as $rtid => $relationship) { - $tt_rel_name = ur_tt("user_relationships:rtid:$rtid:name", $relationship->name); - $tt_rel_plural_name = ur_tt("user_relationships:rtid:$rtid:plural_name", $relationship->plural_name); if ($the_other_uid == $relationship->requester_id) { - $rtype_heading = $relationship->is_oneway ? - t("@rel_name of", array('@rel_name' => $tt_rel_name, '@rel_plural_name' => $tt_rel_plural_name)) : - t("@rel_plural_name", array('@rel_name' => $tt_rel_name, '@rel_plural_name' => $tt_rel_plural_name)); + $rtype_heading = $relationship->is_oneway ? + t("@rel_name of", user_relationships_type_translations($relationship)) : + t("@rel_plural_name", user_relationships_type_translations($relationship, TRUE)); $relatee = $relationship->requestee; } else { - $rtype_heading = t("@rel_plural_name", array('@rel_name' => $tt_rel_name, '@rel_plural_name' => $tt_rel_plural_name)); + $rtype_heading = t("@rel_plural_name", user_relationships_type_translations($relationship)); $relatee = $relationship->requester; } diff --git a/user_relationship_blocks/templates/user_relationships-pending_block.tpl.php b/user_relationship_blocks/templates/user_relationships-pending_block.tpl.php index 383add5..45c5200 100644 --- a/user_relationship_blocks/templates/user_relationships-pending_block.tpl.php +++ b/user_relationship_blocks/templates/user_relationships-pending_block.tpl.php @@ -7,12 +7,10 @@ if ($relationships) { $list = array(); foreach ($relationships as $rtid => $relationship) { - $tt_rel_name = ur_tt("user_relationships:rtid:$rtid:name", $relationship->name); - $tt_rel_plural_name = ur_tt("user_relationships:rtid:$rtid:plural_name", $relationship->plural_name); if ($user->uid == $relationship->requester_id) { $relation_to =& $relationship->requestee; $controls = theme('user_relationships_pending_request_cancel_link', array('uid' => $account->uid, 'rid' => $relationship->rid)); - $line = t('@rel_name to !username (!controls)', array('@rel_name' => $tt_rel_name, '!username' => theme('username', array('account' => $relation_to)), '!controls' => $controls)); + $line = t('@rel_name to !username (!controls)', array('!username' => theme('username', array('account' => $relation_to)), '!controls' => $controls) + user_relationships_type_translations($relationship)); $key = t('Sent requests'); } else { @@ -20,7 +18,7 @@ if ($relationships) { $controls = theme('user_relationships_pending_request_approve_link', array('uid' => $account->uid, 'rid' => $relationship->rid)).'|'. theme('user_relationships_pending_request_disapprove_link', array('uid' => $account->uid, 'rid' => $relationship->rid)); - $line = t('@rel_name from !username (!controls)', array('@rel_name' => $tt_rel_name, '!username' => theme('username', array('account' => $relation_to)), '!controls' => $controls)); + $line = t('@rel_name from !username (!controls)', array('!username' => theme('username', array('account' => $relation_to)), '!controls' => $controls) + user_relationships_type_translations($relationship)); $key = t('Received requests'); } $list[$key][] = $line; diff --git a/user_relationship_blocks/user_relationship_blocks.module b/user_relationship_blocks/user_relationship_blocks.module index 4fbc90a..e9b6328 100644 --- a/user_relationship_blocks/user_relationship_blocks.module +++ b/user_relationship_blocks/user_relationship_blocks.module @@ -73,10 +73,10 @@ function theme_user_relationship_block_subject($variables) { global $user; $rtype = user_relationships_type_load($rtid); if ($account->uid == $user->uid) { - return t('I am a @rel_name of', array('@rel_name' => ur_tt("user_relationships:rtid:$rtid:name", $rtype->name), '@rel_plural_name' => $rtype->plural_name)); + return t('I am a @rel_name of', user_relationships_type_translations($rtype)); } else { - return t('@username is a @rel_name of', array('@username' => format_username($account), '@rel_name' => ur_tt("user_relationships:rtid:$rtid:name", $rtype->name), '@rel_plural_name' => $rtype->plural_name)); + return t('@username is a @rel_name of', array('@username' => format_username($account)) + user_relationships_type_translations($rtype)); } } else { @@ -87,8 +87,8 @@ function theme_user_relationship_block_subject($variables) { else { $rtype = user_relationships_type_load($rtid); $output = ($account->uid == $user->uid) - ? t('My @relationships', array('@relationships' => ur_tt("user_relationships:rtid:$rtid:plural_name", $rtype->plural_name))) - : t("@username's @relationships", array('@username' => format_username($account), '@relationships' => ur_tt("user_relationships:rtid:$rtid:plural_name", $rtype->plural_name))); + ? t('My @rel_name', user_relationships_type_translations($rtype)) + : t("@username's @rel_name", array('@username' => format_username($account)) + user_relationships_type_translations($rtype)); } return $output; } @@ -129,7 +129,7 @@ function user_relationship_blocks_block_configure($delta) { } else { $type = user_relationships_type_load($rtid); - $relationship_name = ur_tt("user_relationships:rtid:$rtid:name", $type->name); + $relationship_name = user_relationships_type_get_name($type); } $form['size'] = array( @@ -146,7 +146,7 @@ function user_relationship_blocks_block_configure($delta) { ); $user_identifier = ($block == UR_BLOCK_MY) ? t('currently logged in user') : t('author whose node is being viewed'); - $msg = t("NOTE: This block displays @relationship_name relationships of the @user_identifier.", array('@relationship_name' => ur_tt("user_relationships:rtid:$rtid:name", $relationship_name), '@user_identifier' => $user_identifier)); + $msg = t("NOTE: This block displays @rel_name relationships of the @user_identifier.", array('@rel_name' => $relationship_name, '@user_identifier' => $user_identifier)); if ($extra) { $relation = $extra == 'you_to_them' ? t('requester') : t('requestee'); @@ -287,8 +287,8 @@ function user_relationship_blocks_block_info() { foreach ($extras as $token => $extra) { $block_types = array( - "{$my_delta}{$token}" => t('My Relationships: @type @extra', array('@type' => $type->plural_name, '@extra' => $extra)), - "{$usr_delta}{$token}" => t('User Relationships: @type @extra', array('@type' => $type->plural_name, '@extra' => $extra)), + "{$my_delta}{$token}" => t('My Relationships: @rel_name_plural @extra', array('@extra' => $extra) + user_relationships_type_translations($type)), + "{$usr_delta}{$token}" => t('User Relationships: @rel_name_plural @extra', array('@extra' => $extra) + user_relationships_type_translations($type)), ); foreach ($block_types as $bid => $title) { $blocks[$bid] = array( diff --git a/user_relationship_defaults/user_relationship_defaults.module b/user_relationship_defaults/user_relationship_defaults.module index 49290dd..f580ac1 100644 --- a/user_relationship_defaults/user_relationship_defaults.module +++ b/user_relationship_defaults/user_relationship_defaults.module @@ -175,7 +175,7 @@ function user_relationship_defaults_add_form_submit($form, &$form_state) { $message_p = array( '%username' => $user->name, - '%relationship_name' => ur_tt("user_relationships:rtid:$relationship_type->rtid:name", $relationship_type->name), + '%relationship_name' => user_relationships_type_get_name($relationship_type), ); drupal_set_message(t('Default relationship %relationship_name of %username has been added.', $message_p)); watchdog('u_relationship', 'Default relationship %relationship_name of %username has been added.', $message_p, WATCHDOG_NOTICE, l(t('view'), 'admin/config/people/relationships')); @@ -195,10 +195,7 @@ function user_relationship_defaults_delete_form($form, &$form_state, $default_re $form = confirm_form( $form, - t('Are you sure you want to delete the default relationship %relationship of %name?', array( - '%relationship' => ur_tt('user_relationships:rtid:' . $default_relationship->relationship_type->rtid . ':name', $default_relationship->relationship_type->name), - '%name' => $default_relationship->user->name, - )), + t('Are you sure you want to delete the default relationship %rel_name of %name?', array('%name' => $default_relationship->user->name) + user_relationships_type_translations($default_relationship)), 'admin/config/people/relationships', t('This action cannot be undone.'), t('Delete'), t('Cancel') @@ -218,7 +215,7 @@ function user_relationship_defaults_delete_form_submit($form, &$form_state) { ->execute(); $message_p = array( '%name' => $default_relationship->user_name, - '%relationship' => ur_tt("user_relationships:rtid:$default_relationship->rtid:name", $default_relationship->name), + '%relationship' => user_relationships_type_get_name($default_relationship), ); drupal_set_message(t('Default relationship %relationship of %name has been deleted.', $message_p)); watchdog('u_relationship', 'Default relationship %relationship of %name has been deleted.', $message_p, WATCHDOG_NOTICE); @@ -264,7 +261,7 @@ function user_relationship_defaults_user_relationships_types_list_alter(&$page) $default_rows = array(); foreach ($defaults as $default) { $default_rows[] = array( - $default->relationship_type->name, + user_relationships_type_get_name($default->relationship_type), theme('username', array('account' => $default->user)), l(t('delete'), "admin/config/people/relationships/defaults/{$default->rdid}/delete"), ); diff --git a/user_relationship_implications/user_relationship_implications.module b/user_relationship_implications/user_relationship_implications.module index 3ba48a9..c812225 100644 --- a/user_relationship_implications/user_relationship_implications.module +++ b/user_relationship_implications/user_relationship_implications.module @@ -50,7 +50,7 @@ function user_relationship_implications_form_user_relationships_admin_type_edit_ if (!isset($relationship_type) || $type->rtid != $relationship_type->rtid && !in_array($type->rtid, $implied_by)) { $imp_name = "implies_{$type->rtid}"; $form['implications']['opts'][$type->rtid][$imp_name] = array( - '#title' => t('@type_name', array('@type_name' => $type->name)), + '#title' => t('@rel_name', user_relationships_type_translations($type)), '#type' => 'checkbox', '#return_value' => $type->rtid, '#default_value' => isset($form['#post'][$imp_name]) || isset($values[$type->rtid]), @@ -322,10 +322,7 @@ function theme_user_relationship_implications_page($variables) { $output .= theme('pager'); - drupal_set_title(t("%username's %relationships", array( - '%username' => $viewed_user->name, - '%relationships' => $relationship->plural_name ? $relationship->plural_name : t('relationships') - ))); + drupal_set_title(t("%username's @rel_name_plural", array('%username' => format_username($viewed_user)) + user_relationships_type_translations($relationship))); return $output; } @@ -337,7 +334,7 @@ function _user_relationship_implications_load_relationship_names($relationships, $output = array(); foreach ($relationships as $relationship) { if ($relationship->requester_id == $uid || $relationship->requestee_id == $uid) { - $output[] = $relationship->name; + $output[] = user_relationships_type_get_name($relationship); } } return $output; diff --git a/user_relationship_invites/user_relationship_invites.module b/user_relationship_invites/user_relationship_invites.module index bee7c97..8b2c29f 100644 --- a/user_relationship_invites/user_relationship_invites.module +++ b/user_relationship_invites/user_relationship_invites.module @@ -83,7 +83,7 @@ function user_relationship_invites_form_user_register_form_alter(&$form, &$form_ if (!$relationship_type->is_oneway || $relationship_type->requires_approval) { $form['relationship_invite_approve'] = array( '#type' => 'radios', - '#title' => t('Please confirm the %relationship_name request from !name', array('!name' => theme('username', array('account' => $inviter)), '%relationship_name' => $relationship_type->name)), + '#title' => t('Please confirm the @rel_name request from !name', array('!name' => theme('username', array('account' => $inviter))) + user_relationships_type_translations($relationship_type)), '#default_value' => 'approve', '#options' => array( 'approve' => t('Yes'), diff --git a/user_relationship_node_access/user_relationship_node_access.module b/user_relationship_node_access/user_relationship_node_access.module index 4b6036a..6a99be7 100644 --- a/user_relationship_node_access/user_relationship_node_access.module +++ b/user_relationship_node_access/user_relationship_node_access.module @@ -172,11 +172,11 @@ function _user_relationship_node_access_permission_form($object_type, $object) { foreach ($types as $rtid => $type) { unset($types[$rtid]); if ($type->is_oneway) { - $types["{$rtid}_yt"] = t('Post to @type (you to them)', array('@type' => $type->plural_name)); - $types["{$rtid}_ty"] = t('Post to @type (them to you)', array('@type' => $type->plural_name)); + $types["{$rtid}_yt"] = t('Post to @rel_name', user_relationships_type_translations($type)); + $types["{$rtid}_ty"] = t('Post to @rel_name_reverse', user_relationships_type_translations($type)); } else { - $types[$rtid] = t('Post to @type', array('@type' => $type->plural_name)); + $types[$rtid] = t('Post to @rel_name', user_relationships_type_translations($type)); } } asort($types); diff --git a/user_relationship_privatemsg/user_relationship_privatemsg.module b/user_relationship_privatemsg/user_relationship_privatemsg.module index ee88d81..2b2cd91 100644 --- a/user_relationship_privatemsg/user_relationship_privatemsg.module +++ b/user_relationship_privatemsg/user_relationship_privatemsg.module @@ -83,9 +83,9 @@ function theme_user_relationship_privatemsg_format($variables) { if ($relationship->account->uid == $user->uid) { - return t('your %relationship', array('%relationship' => $relationship->plural_name, '@url' => url('relationships/' . $relationship->rtid))); + return t('your @rel_name_plural', array('@url' => url('relationships/' . $relationship->rtid)) + user_relationships_type_translations($relationship)); } - $name = t('%relationship of @username', array('%relationship' => $relationship->plural_name, '@username' => format_username($relationship->account))); + $name = t('@rel_name_plural of @username', array('@username' => format_username($relationship->account)) + user_relationships_type_translations($relationship)); if (user_relationships_ui_check_access(array('user'), $relationship->account)) { return l($name, 'user/' . $relationship->account->uid . '/relationships/' . $relationship->rtid, array('html' => TRUE)); } diff --git a/user_relationship_views/user_relationship_views.module b/user_relationship_views/user_relationship_views.module index 33b8215..254d446 100644 --- a/user_relationship_views/user_relationship_views.module +++ b/user_relationship_views/user_relationship_views.module @@ -53,7 +53,7 @@ function user_relationship_views_ajax_autocomplete_relationships_type($string = if (strpos($rtype->name, ',') !== FALSE || strpos($rtype->name, '"') !== FALSE) { $n = '"'. str_replace('"', '""', $rtype->name) .'"'; } - $matches[$prefix . $n] = check_plain(ur_tt("user_relationships:rtid:$rtype->rtid:name", $rtype->name)); + $matches[$prefix . $n] = check_plain(user_relationships_type_get_name($rtype)); } } } diff --git a/user_relationships.admin.inc b/user_relationships.admin.inc index 262ab73..e69c267 100644 --- a/user_relationships.admin.inc +++ b/user_relationships.admin.inc @@ -155,12 +155,6 @@ function user_relationships_admin_settings() { function user_relationships_admin_type_edit($form, &$form_state, $relationship_type = NULL) { if (!$relationship_type) { drupal_set_title(t('Add relationship type')); - $relationship_type = (object) array( - 'name' => '', - 'plural_name' => '', - 'is_oneway' => FALSE, - 'is_reciprocal' => FALSE, - ); } else { drupal_set_title(t('Edit @name relationship type', array('@name' => $relationship_type->name))); @@ -179,15 +173,6 @@ function user_relationships_admin_type_edit($form, &$form_state, $relationship_t '#required' => TRUE, '#weight' => -10, ); - $form['plural_name'] = array( - '#type' => 'textfield', - '#title' => t('Plural name'), - '#maxlength' => 255, - '#default_value' => isset($relationship_type) ? $relationship_type->plural_name : NULL, - '#description' => t("Example: buddies, friends, coworkers, spouses."), - '#required' => TRUE, - '#weight' => -9, - ); $form['requires_approval'] = array( '#type' => 'checkbox', '#title' => t('Requires Approval'), @@ -229,6 +214,91 @@ function user_relationships_admin_type_edit($form, &$form_state, $relationship_t ), ); + $form['branding'] = array( + '#type' => 'fieldset', + '#title' => t('Branding'), + '#group' => 'tabs', + ); + + $form['branding']['plural_name'] = array( + '#type' => 'textfield', + '#title' => t('Plural name'), + '#maxlength' => 255, + '#default_value' => isset($relationship_type->plural_name) ? $relationship_type->plural_name : NULL, + '#description' => t("Example: buddies, friends, coworkers, spouses."), + '#weight' => 2, + ); + + $form['branding']['name_capitalized'] = array( + '#type' => 'textfield', + '#title' => t('Capitalized name'), + '#maxlength' => 255, + '#default_value' => isset($relationship_type) ? $relationship_type->name_capitalized : NULL, + '#description' => t("Example: buddies, friends, coworkers, spouses."), + '#weight' => 6, + ); + + $form['branding']['plural_name_capitalized'] = array( + '#type' => 'textfield', + '#title' => t('Capitalized plural name'), + '#maxlength' => 255, + '#default_value' => isset($relationship_type) ? $relationship_type->plural_name_capitalized : NULL, + '#description' => t("Example: buddies, friends, coworkers, spouses."), + '#weight' => 10, + ); + + // #states doesn't work on a vertical tab fieldset, hide each input element + // separately. + $form['reverse_branding'] = array( + '#type' => 'fieldset', + '#title' => t('One-way reverse branding'), + '#group' => 'tabs', + '#description' => t('One-way reversed branding is only used when this relationship type only goes one way. Then, these names are used when displaying relationships initiated by other users.'), + // Doesn't work properly yet. + '#states' => array( + 'visible' => array( + ':input[name=is_oneway]' => array('checked' => TRUE), + ), + ), + ); + + $form['reverse_branding']['reverse_name'] = array( + '#type' => 'textfield', + '#title' => t('Name'), + '#maxlength' => 255, + '#default_value' => isset($relationship_type) ? $relationship_type->reverse_name : NULL, + '#description' => t("Example: buddies, friends, coworkers, spouses."), + '#weight' => 0, + ); + + $form['reverse_branding']['reverse_plural_name'] = array( + '#type' => 'textfield', + '#title' => t('Plural name'), + '#maxlength' => 255, + '#default_value' => isset($relationship_type) ? $relationship_type->reverse_plural_name : NULL, + '#description' => t("Example: buddies, friends, coworkers, spouses."), + '#weight' => 4, + ); + + $form['reverse_branding']['reverse_name_capitalized'] = array( + '#type' => 'textfield', + '#title' => t('Capitalized name'), + '#maxlength' => 255, + '#default_value' => isset($relationship_type) ? $relationship_type->reverse_name_capitalized : NULL, + '#description' => t("Example: buddies, friends, coworkers, spouses."), + '#weight' => 8, + ); + + $form['reverse_branding']['reverse_plural_name_capitalized'] = array( + '#type' => 'textfield', + '#title' => t('Capitalized plural name'), + '#maxlength' => 255, + '#default_value' => isset($relationship_type) ? $relationship_type->reverse_plural_name_capitalized : NULL, + '#description' => t("Example: buddies, friends, coworkers, spouses."), + '#weight' => 12, + ); + + $form['rtid'] = array( '#type' => 'value', '#value' => isset($relationship_type->rtid) ? (int)$relationship_type->rtid : NULL, @@ -238,11 +308,21 @@ function user_relationships_admin_type_edit($form, &$form_state, $relationship_t '#value' => (isset($relationship_type->rtid) ? 'edit' : 'add'), ); - $form['submit'] = array( + $form['actions'] = array('#type' => 'actions'); + $form['actions']['submit'] = array( '#type' => 'submit', '#value' => (isset($relationship_type->rtid) ? t('Save relationship type') : t('Add relationship type')), - '#weight' => 10, + '#weight' => 0, ); + if (module_exists('i18n_string')) { + $form['actions']['translate'] = array( + '#type' => 'submit', + '#name' => 'save_translate', + '#value' => (isset($relationship_type->rtid) ? t('Save and translate') : t('Add and translate')), + '#weight' => 5, + ); + } + return $form; } @@ -260,7 +340,7 @@ function user_relationships_admin_type_delete($form, &$form_state, $relationship return confirm_form( $form, - t('Are you sure you want to delete %name?', array('%name' => ur_tt("user_relationships:rtid:$relationship_type->rtid:name", $relationship_type->name))), + t('Are you sure you want to delete %rel_name?', user_relationships_type_translations($relationship_type)), 'admin/config/people/relationships', t('This action cannot be undone.'), t('Delete'), t('Cancel') @@ -297,19 +377,10 @@ function user_relationships_admin_type_edit_validate($form, &$form_state) { */ function user_relationships_admin_type_edit_submit($form, &$form_state) { $relationship_type = (object)$form_state['values']; - if ($form_state['values']['action'] == 'add') { - //#348025 when editing a type, make sure that two-way relationships are not left as reciprocal, just in case, as the UI allows it. - if (!$relationship_type->is_oneway) { - $relationship_type->is_reciprocal = 0; - } - drupal_write_record('user_relationship_types', $relationship_type); - - // Update strings for translation - _user_relationships_update_translations($relationship_type); - $form_state['values']['rtid'] = $relationship_type->rtid; - module_invoke_all('user_relationships_type_insert', $relationship_type); + user_relationships_type_save($relationship_type); + if ($form_state['values']['action'] == 'add') { drupal_set_message(t('Relationship %name has been added.', array('%name' => $relationship_type->name))); watchdog( 'u_relationship', @@ -319,16 +390,6 @@ function user_relationships_admin_type_edit_submit($form, &$form_state) { ); } else { - //#348025 when editing a type, make sure that two-way relationships are not left as reciprocal, just in case, as the UI allows it. - if (!$relationship_type->is_oneway) { - $relationship_type->is_reciprocal = 0; - } - drupal_write_record('user_relationship_types', $relationship_type, 'rtid'); - - // Update strings for translation - _user_relationships_update_translations($relationship_type); - module_invoke_all('user_relationships_type_update', $relationship_type); - drupal_set_message(t('Relationship %name has been updated.', array('%name' => $relationship_type->name))); watchdog( 'u_relationship', @@ -338,10 +399,9 @@ function user_relationships_admin_type_edit_submit($form, &$form_state) { ); } - user_relationships_types_load(TRUE); - menu_rebuild(); + $translate = module_exists('i18n_string') && $form_state['triggering_element']['#name'] == 'save_translate' ? TRUE : FALSE; - $form_state['redirect'] = 'admin/config/people/relationships'; + $form_state['redirect'] = $translate ? 'admin/config/people/relationships/' . $relationship_type->rtid . '/translate' : 'admin/config/people/relationships'; } @@ -368,17 +428,6 @@ function user_relationships_admin_type_delete_submit($form, &$form_state) { } /** - * Make relationship type available to translation by i18nstrings.module - */ -function _user_relationships_update_translations(&$relationship_type) { - if (function_exists('i18nstrings_update') && $relationship_type->rtid) { - i18nstrings_update("user_relationships:rtid:$relationship_type->rtid:name", $relationship_type->name); - i18nstrings_update("user_relationships:rtid:$relationship_type->rtid:plural_name", $relationship_type->plural_name); - } -} - - -/** * Relationship Types List */ function user_relationships_admin_types_list_page() { @@ -461,3 +510,41 @@ function _user_relationships_message_settings_form(&$form, $defaults = array()) } } } + +/** + * Build a translation page for the given relationship type. + */ +function user_relationships_translate_tab_page($type, $language = NULL) { + module_load_include('inc', 'i18n_string', 'i18n_string.pages'); + $form_meta = array( + '#page_title' => t('Translate relationship type'), + '#item_title_header' => t('Relationship type'), + '#item_title_key' => array('user_relationships', 'rtid', $type->rtid, 'name'), + '#item_title_default' => $type->name, + '#edit' => 'admin/config/people/relationships/' . $type->rtid . '/edit', + '#translate' => 'admin/config/people/relationships/' . $type->rtid . '/translate/', + '#items' => array(), + ); + $form_meta['#items'][] = array( + '#title' => t('Name'), + '#string_key' => array('user_relationships', 'rtid', $type->rtid, 'name'), + '#default_value' => $type->name, + ); + $form_meta['#items'][] = array( + '#title' => t('Plural name'), + '#string_key' => array('user_relationships', 'rtid', $type->rtid, 'plural_name'), + '#default_value' => $type->plural_name, + ); + $form_meta['#items'][] = array( + '#title' => t('Capitalized name'), + '#string_key' => array('user_relationships', 'rtid', $type->rtid, 'name_capitalized'), + '#default_value' => $type->name_capitalized, + ); + $form_meta['#items'][] = array( + '#title' => t('Plural capitalized name'), + '#string_key' => array('user_relationships', 'rtid', $type->rtid, 'plural_name_capitalized'), + '#default_value' => $type->plural_name_capitalized, + ); + $form = i18n_string_translate_page($form_meta, $language); + return $form; +} diff --git a/user_relationships.author-pane.inc b/user_relationships.author-pane.inc index fed60a2..359cb2a 100644 --- a/user_relationships.author-pane.inc +++ b/user_relationships.author-pane.inc @@ -44,7 +44,7 @@ function user_relationships_preprocess_author_pane(&$variables) { // Existing relationship; need remove icon/link. (Despite the foreach, // there should only be one.) foreach ($relationships as $relationship) { - $link_label = t('Remove @name from @rel_plural_name', array('@name' => format_username($account), '@rel_plural_name' => $relationship->plural_name)); + $link_label = t('Remove @name from @rel_plural_name', array('@name' => format_username($account)) + user_relationships_type_translations($relationship)); $css_class = array(str_replace(' ', '-', $relationship->name), 'author-pane-link', 'user_relationships_popup_link', 'author-relationship-remove-icon'); //link to remove if (!isset($variables['user_relationships'])) { @@ -52,7 +52,7 @@ function user_relationships_preprocess_author_pane(&$variables) { } $variables['user_relationships'] .= '