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

Languages Select not working for pt-BR livechat text #13305

Closed
Anderson-Vasques opened this issue Jan 31, 2019 · 1 comment · Fixed by #14012
Closed

Languages Select not working for pt-BR livechat text #13305

Anderson-Vasques opened this issue Jan 31, 2019 · 1 comment · Fixed by #14012

Comments

@Anderson-Vasques
Copy link

When changing Language to 'Português do Brasil' in admin/General the livechat You i18n text (https://github.com/RocketChat/Rocket.Chat/blob/0.74.0/packages/rocketchat-livechat/.app/client/views/message.html#L7) changes to 'Tu' (which is the text from Português translate)
I think the problem is https://github.com/RocketChat/Rocket.Chat/blob/0.74.0/packages/rocketchat-ui-admin/client/admin.js#L99 that changes pt-BR to pt-br. If I change the option value from pt-br to pt-BR on the option value, the correct text is displayed

Rocketchat version: 0.74.0

@Anderson-Vasques
Copy link
Author

Removing toLowerCase from map could fix this problem, but I am not sure why toLowerCase was inserted.

languages() {
  const languages = TAPi18n.getLanguages();

  const result = Object.entries(languages)
    .map(([key, language]) => ({ ...language, key: key }))
    .sort((a, b) => a.key - b.key);

  result.unshift({
    name: 'Default',
    en: 'Default',
    key: '',
  });

  return result;
},
isAppLanguage(key) {
  const languageKey = RocketChat.settings.get('Language');
  return typeof languageKey === 'string' && languageKey.toLowerCase() === key.toLowerCase();
}

@Anderson-Vasques Anderson-Vasques changed the title Languages Select not working for pt-BR livechat Languages Select not working for pt-BR livechat text Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants