Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4530 Add tooltip (title) to the 'remove all' 'X' icon. #5291

Merged
merged 5 commits into from Sep 15, 2018

Conversation

nisha-kaushik
Copy link
Contributor

@nisha-kaushik nisha-kaushik commented May 14, 2018

This pull request includes a

#4530

  • Bug fix
  • New feature
  • Translation

The following changes were made

If this is related to an existing ticket, include a link to it as well.

@pedrofurtado
Copy link
Contributor

pedrofurtado commented Sep 11, 2018

@nisha-kaushik This title attribute must show the I18n value, that select2 already provides for other texts. Modify the PR to show the title from i18n.
That's a great PR, but needs support for i18n.
After it, the PR is ready for merge

@nisha-kaushik
Copy link
Contributor Author

Hi,

I am new to open source and i18n, do we need to add the text for every language in all those files?

e.g: es.js and en.js etc?

@pedrofurtado
Copy link
Contributor

pedrofurtado commented Sep 15, 2018

@nisha-kaushik Wow, Good job! My only one point is, please, to remove all change from files in dist folder of PR. They are generated automatically during build process. So, maintain only the changes in src folder.
After it, the PR is ok for merge 🎉 It will be available in the next release of select2

@nisha-kaushik
Copy link
Contributor Author

There are 3 TO Dos , I couldn't find conversion in Lower Sorbian., Upper Sorbian and turkmen. Can you pleas ehelp me with that.

@pedrofurtado
Copy link
Contributor

pedrofurtado commented Sep 15, 2018

@nisha-kaushik There is no problem, we can maintain the default as english string. Other users from community (that know these languages) will fix this missing messages, if necessary.

@pedrofurtado
Copy link
Contributor

pedrofurtado commented Sep 15, 2018

@nisha-kaushik I am thinking now about it, and I have just only one more point: Add just one more test that has the same code you did in PR, but testing in another locale. Then, we will be safe that this feature is tested in default language (english) and the others languages.

@nisha-kaushik
Copy link
Contributor Author

Can you please guide me on how to change locale in test case while rendering? I tried passing language in options but seems like I am missing something.

@pedrofurtado
Copy link
Contributor

pedrofurtado commented Sep 15, 2018

@nisha-kaushik It is something like this below:

test('clear icon should have title displayed in another locale', function (assert) {
  var selection = new AllowClearPlaceholder(
    $('#qunit-fixture .single-with-placeholder'),
    new Options({
      placeholder: {
        id: 'placeholder',
        text: 'This is the placeholder'
      },
      allowClear: true,
      language: 'ANY_LOCALE'
    });
  );
   var $selection = selection.render();
   selection.update([{
    id: 'one',
    test: 'one'
  }]);
   assert.equal(
    $selection.find('.select2-selection__clear').attr('title'),
    'TEXT OF THE LOCALE',
    'The clear icon should have title displayed in another locale'
  );
});

@nisha-kaushik
Copy link
Contributor Author

I tried the same,
with language : 'af', but it still renders with english :(

@pedrofurtado
Copy link
Contributor

@nisha-kaushik Ok, The pr is good. And the test in english can be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants