Commit cd31649c authored by webchick's avatar webchick

Issue #1802128 by legolasbo, jucallme: Fixed Replace "user name" with "username" in UI text.

parent 2f6dff6f
......@@ -15,7 +15,7 @@ function basic_auth_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.basic_auth':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The HTTP Basic Authentication module supplies an <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">HTTP Basic authentication</a> provider for web service requests. This authentication provider authenticates requests using the HTTP Basic Authentication user name and password, as an alternative to using Drupal\'s standard cookie-based authentication system. It is only useful if your site provides web services configured to use this type of authentication (for instance, the <a href="!rest_help">RESTful Web Services module</a>). For more information, see <a href="!hba_do">the online documentation for the HTTP Basic Authentication module</a>.', array('!hba_do' => 'https://drupal.org/documentation/modules/basic_auth', '!rest_help' => \Drupal::url('help.page', array('name' => 'rest')))) . '</p>';
$output .= '<p>' . t('The HTTP Basic Authentication module supplies an <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">HTTP Basic authentication</a> provider for web service requests. This authentication provider authenticates requests using the HTTP Basic Authentication username and password, as an alternative to using Drupal\'s standard cookie-based authentication system. It is only useful if your site provides web services configured to use this type of authentication (for instance, the <a href="!rest_help">RESTful Web Services module</a>). For more information, see <a href="!hba_do">the online documentation for the HTTP Basic Authentication module</a>.', array('!hba_do' => 'https://drupal.org/documentation/modules/basic_auth', '!rest_help' => \Drupal::url('help.page', array('name' => 'rest')))) . '</p>';
return $output;
}
}
......@@ -64,7 +64,7 @@ function contact_entity_extra_field_info() {
);
if ($bundle == 'personal') {
$fields['contact_message'][$bundle]['form']['recipient'] = array(
'label' => t('Recipient user name'),
'label' => t('Recipient username'),
'description' => t('User'),
'weight' => -30,
);
......
......@@ -55,7 +55,7 @@ protected static function getSchema() {
'length' => 60,
'not null' => TRUE,
'default' => '',
'description' => 'Unique user name.',
'description' => 'Unique username.',
),
'pass' => array(
'type' => 'varchar',
......
......@@ -85,7 +85,7 @@ function search_help($route_name, RouteMatchInterface $route_match) {
$output .= '<dt>' . t('Displaying the Search block') . '</dt>';
$output .= '<dd>' . t('The Search module includes a block, which can be enabled and configured on the <a href="!blocks">Block layout page</a>, if you have the Block module enabled; the default block title is Search, and it is the Search form block in the Forms category, if you wish to add another instance. The block is available to users with the <a href="!search_permission">Use search</a> permission, and it performs a search using the configured default search page.', array('!blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#', '!search_permission' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-search')))) . '</dd>';
$output .= '<dt>' . t('Searching your site') . '</dt>';
$output .= '<dd>' . t('Users with <a href="!search_permission">Use search</a> permission can use the Search block and <a href="!search">Search page</a>. Users with the <a href="!node_permission">View published content</a> permission can use configured search pages of type <em>Content</em> to search for content containing exact keywords; in addition, users with <a href="!search_permission">Use advanced search</a> permission can use more complex search filtering. Users with the <a href="!user_permission">View user information</a> permission can use configured search pages of type <em>Users</em> to search for active users containing the keyword anywhere in the user name, and users with the <a href="!user_permission">Administer users</a> permission can search for active and blocked users, by email address or user name keyword.', array('!search' => \Drupal::url('search.view'), '!search_permission' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-search')), '!node_permission' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-node')), '!user_permission' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-user')))) . '</dd>';
$output .= '<dd>' . t('Users with <a href="!search_permission">Use search</a> permission can use the Search block and <a href="!search">Search page</a>. Users with the <a href="!node_permission">View published content</a> permission can use configured search pages of type <em>Content</em> to search for content containing exact keywords; in addition, users with <a href="!search_permission">Use advanced search</a> permission can use more complex search filtering. Users with the <a href="!user_permission">View user information</a> permission can use configured search pages of type <em>Users</em> to search for active users containing the keyword anywhere in the username, and users with the <a href="!user_permission">Administer users</a> permission can search for active and blocked users, by email address or username keyword.', array('!search' => \Drupal::url('search.view'), '!search_permission' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-search')), '!node_permission' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-node')), '!user_permission' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-user')))) . '</dd>';
$output .= '<dt>' . t('Extending the Search module') . '</dt>';
$output .= '<dd>' . t('By default, the Search module only supports exact keyword matching in content searches. You can modify this behavior by installing a language-specific stemming module for your language (such as <a href="!porterstemmer_url">Porter Stemmer</a> for American English), which allows words such as walk, walking, and walked to be matched in the Search module. Another approach is to use a third-party search technology with stemming or partial word matching features built in, such as <a href="!solr_url">Apache Solr</a> or <a href="!sphinx_url">Sphinx</a>. There are also contributed modules that provide additional search pages. These and other <a href="!contrib-search">search-related contributed modules</a> can be downloaded by visiting Drupal.org.', array('!contrib-search' => 'https://drupal.org/project/project_module?f[2]=im_vid_3%3A105', '!porterstemmer_url' => 'https://drupal.org/project/porterstemmer', '!solr_url' => 'https://drupal.org/project/apachesolr', '!sphinx_url' => 'https://drupal.org/project/sphinx')) . '</dd>';
$output .= '</dl>';
......
......@@ -137,13 +137,13 @@ protected function assertReadWrite($entity_type) {
$new_user = $this->createUser();
$entity->user_id->entity = $new_user;
$this->assertEqual($new_user->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
$this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', array('%entity_type' => $entity_type)));
$this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
// Change the assigned user by id.
$new_user = $this->createUser();
$entity->user_id->target_id = $new_user->id();
$this->assertEqual($new_user->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
$this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', array('%entity_type' => $entity_type)));
$this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
// Try unsetting a field.
$entity->name->value = NULL;
......
......@@ -58,7 +58,7 @@ function testUserRegistrationRebuild() {
);
$this->drupalPostForm('user/register', $edit, 'Rebuild');
$this->assertText('Form rebuilt.');
$this->assertFieldByName('name', 'foo', 'Entered user name has been kept.');
$this->assertFieldByName('name', 'foo', 'Entered username has been kept.');
$this->assertFieldByName('mail', 'bar@example.com', 'Entered mail address has been kept.');
}
......@@ -72,7 +72,7 @@ function testUserRegistrationMultipleField() {
);
$this->drupalPostForm('user/register', $edit, t('Add another item'));
$this->assertText('Test a multiple valued field', 'Form has been rebuilt.');
$this->assertFieldByName('name', 'foo', 'Entered user name has been kept.');
$this->assertFieldByName('name', 'foo', 'Entered username has been kept.');
$this->assertFieldByName('mail', 'bar@example.com', 'Entered mail address has been kept.');
}
}
......@@ -341,7 +341,7 @@ public function validate(array $form, FormStateInterface $form_state) {
->execute();
if ($name_taken) {
$form_state->setErrorByName('name', $this->t('The name %name is already taken.', array('%name' => $form_state->getValue('name'))));
$form_state->setErrorByName('name', $this->t('The username %name is already taken.', array('%name' => $form_state->getValue('name'))));
}
}
}
......
......@@ -19,7 +19,7 @@
*/
class UserNameUnique extends Constraint {
public $message = 'The name %value is already taken.';
public $message = 'The username %value is already taken.';
/**
* {@inheritdoc}
......
......@@ -160,7 +160,7 @@ function testUserBlock() {
$this->drupalGet('user/' . $account->id() . '/edit');
$this->drupalPostForm(NULL, NULL, t('Cancel account'));
$this->assertText(t('Are you sure you want to cancel your account?'), 'Confirmation form to cancel account displayed.');
$this->assertText(t('Your account will be blocked and you will no longer be able to log in. All of your content will remain attributed to your user name.'), 'Informs that all content will be remain as is.');
$this->assertText(t('Your account will be blocked and you will no longer be able to log in. All of your content will remain attributed to your username.'), 'Informs that all content will be remain as is.');
$this->assertNoText(t('Select the method to cancel the account above.'), 'Does not allow user to select account cancellation method.');
// Confirm account cancellation.
......
......@@ -28,7 +28,7 @@ function testUserEdit() {
// Test that error message appears when attempting to use a non-unique user name.
$edit['name'] = $user2->getUsername();
$this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save'));
$this->assertRaw(t('The name %name is already taken.', array('%name' => $edit['name'])));
$this->assertRaw(t('The username %name is already taken.', array('%name' => $edit['name'])));
// Check that filling out a single password field does not validate.
$edit = array();
......
......@@ -45,13 +45,13 @@ function testUserSearch() {
$keys = $user1->getUsername();
$edit = array('keys' => $keys);
$this->drupalPostForm('search/user', $edit, t('Search'));
$this->assertLink($keys, 0, 'Search by user name worked for non-admin user');
$this->assertLink($keys, 0, 'Search by username worked for non-admin user');
// Verify that searching by sub-string works too.
$subkey = substr($keys, 1, 5);
$edit = array('keys' => $subkey);
$this->drupalPostForm('search/user', $edit, t('Search'));
$this->assertLink($keys, 0, 'Search by user name substring worked for non-admin user');
$this->assertLink($keys, 0, 'Search by username substring worked for non-admin user');
// Verify that wildcard search works.
$subkey = substr($keys, 0, 2) . '*' . substr($keys, 4, 2);
......@@ -67,27 +67,27 @@ function testUserSearch() {
$edit = array('keys' => $keys);
$this->drupalPostForm('search/user', $edit, t('Search'));
$this->assertText($keys, 'Search by email works for administrative user');
$this->assertText($user2->getUsername(), 'Search by email resulted in user name on page for administrative user');
$this->assertText($user2->getUsername(), 'Search by email resulted in username on page for administrative user');
// Verify that a substring works too for email.
$subkey = substr($keys, 1, 5);
$edit = array('keys' => $subkey);
$this->drupalPostForm('search/user', $edit, t('Search'));
$this->assertText($keys, 'Search by email substring works for administrative user');
$this->assertText($user2->getUsername(), 'Search by email substring resulted in user name on page for administrative user');
$this->assertText($user2->getUsername(), 'Search by email substring resulted in username on page for administrative user');
// Verify that wildcard search works for email
$subkey = substr($keys, 0, 2) . '*' . substr($keys, 4, 2);
$edit = array('keys' => $subkey);
$this->drupalPostForm('search/user', $edit, t('Search'));
$this->assertText($user2->getUsername(), 'Search for email wildcard resulted in user name on page for administrative user');
$this->assertText($user2->getUsername(), 'Search for email wildcard resulted in username on page for administrative user');
// Verify that if they search by user name, they see email address too.
$keys = $user1->getUsername();
$edit = array('keys' => $keys);
$this->drupalPostForm('search/user', $edit, t('Search'));
$this->assertText($keys, 'Search by user name works for admin user');
$this->assertText($user1->getEmail(), 'Search by user name for admin shows email address too');
$this->assertText($keys, 'Search by username works for admin user');
$this->assertText($user1->getEmail(), 'Search by username for admin shows email address too');
// Create a blocked user.
$blocked_user = $this->drupalCreateUser();
......
......@@ -97,7 +97,7 @@ function testValidation() {
$violations = $user->validate();
$this->assertEqual(count($violations), 1, 'Violation found on name collision.');
$this->assertEqual($violations[0]->getPropertyPath(), 'name');
$this->assertEqual($violations[0]->getMessage(), t('The name %name is already taken.', array('%name' => 'existing')));
$this->assertEqual($violations[0]->getMessage(), t('The username %name is already taken.', array('%name' => 'existing')));
// Make the name valid.
$user->set('name', $this->randomMachineName());
......
......@@ -60,7 +60,7 @@ function user_help($route_name, RouteMatchInterface $route_match) {
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Creating and managing users') . '</dt>';
$output .= '<dd>' . t('Through the <a href="!people">People administration page</a> you can add and cancel user accounts and assign users to roles. By editing one particular user you can change their user name, email address, password, and information in other fields.', array('!people' => \Drupal::url('user.admin_account'))) . '</dd>';
$output .= '<dd>' . t('Through the <a href="!people">People administration page</a> you can add and cancel user accounts and assign users to roles. By editing one particular user you can change their username, email address, password, and information in other fields.', array('!people' => \Drupal::url('user.admin_account'))) . '</dd>';
$output .= '<dt>' . t('Configuring user roles') . '</dt>';
$output .= '<dd>' . t('<em>Roles</em> are used to group and classify users; each user can be assigned one or more roles. Typically there are two pre-defined roles: <em>Anonymous user</em> (users that are not logged in), and <em>Authenticated user</em> (users that are registered and logged in). Depending on how your site was set up, an <em>Administrator</em> role may also be available: users with this role will automatically be assigned any new permissions whenever a module is enabled. You can create additional roles on the <a href="!roles">Roles administration page</a>.', array('!roles' => \Drupal::url('user.role_list'))) . '</dd>';
$output .= '<dt>' . t('Setting permissions') . '</dt>';
......@@ -896,7 +896,7 @@ function user_cancel_methods() {
$methods = array(
'user_cancel_block' => array(
'title' => t('Disable the account and keep its content.'),
'description' => t('Your account will be blocked and you will no longer be able to log in. All of your content will remain attributed to your user name.'),
'description' => t('Your account will be blocked and you will no longer be able to log in. All of your content will remain attributed to your username.'),
),
'user_cancel_block_unpublish' => array(
'title' => t('Disable the account and unpublish its content.'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment