-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from RocketChat/change-language
Change language in settings menu;
- Loading branch information
Showing
9 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Template.userSettingsFlex.helpers | ||
languages: -> | ||
languages = TAPi18n.getLanguages() | ||
result = [] | ||
for key, language of languages | ||
result.push _.extend(language, { key: key }) | ||
return _.sortBy(result, 'key') | ||
|
||
userLanguage: (key) -> | ||
return localStorage.getItem('userLanguage')?.split('-').shift().toLowerCase() is key | ||
|
||
Template.userSettingsFlex.events | ||
'mouseenter header': -> | ||
SideNav.overArrow() | ||
|
||
'mouseleave header': -> | ||
SideNav.leaveArrow() | ||
|
||
'click header': -> | ||
SideNav.closeFlex() | ||
|
||
'click footer .save': -> | ||
selectedLanguage = $('#language').val() | ||
if localStorage.getItem('userLanguage') isnt selectedLanguage | ||
localStorage.setItem 'userLanguage', selectedLanguage | ||
Meteor._reload.reload() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template name="userSettingsFlex"> | ||
<header> | ||
<div> | ||
<h4>{{_ "userStatus.Settings"}}</h4> | ||
</div> | ||
</header> | ||
<div class="content"> | ||
<div class="wrapper"> | ||
<div class="input-line"> | ||
<label for="language">{{_ "general.Language"}}</label> | ||
<select id="language" class="required" dir="auto"> | ||
{{#each languages}} | ||
<option value="{{key}}" selected="{{userLanguage key}}">{{name}}</option> | ||
{{/each}} | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
<footer> | ||
<div> | ||
<button class="button clean save">{{_ "general.Save"}}</button> | ||
</div> | ||
</footer> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters