Skip to content

Commit

Permalink
updating everything to the current user
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-addison-h committed Jun 6, 2024
1 parent e78784b commit 5cee9f9
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion app/femr/ui/views/admin/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
3 changes: 2 additions & 1 deletion app/femr/ui/views/layouts/admin.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
3 changes: 2 additions & 1 deletion app/femr/ui/views/layouts/settings.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
3 changes: 2 additions & 1 deletion app/femr/ui/views/manager/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
3 changes: 2 additions & 1 deletion app/femr/ui/views/medical/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
3 changes: 2 additions & 1 deletion app/femr/ui/views/partials/authenticated.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
3 changes: 2 additions & 1 deletion app/femr/ui/views/partials/footer.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
3 changes: 2 additions & 1 deletion app/femr/ui/views/pharmacies/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
2 changes: 0 additions & 2 deletions app/femr/ui/views/settings/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
.then(data => {
languageData = data;
let initialLanguage = @currentUser.getLanguageCode();
console.log(initialLanguage);
if (initialLanguage == null) {
initialLanguage = "en";
}
console.log(initialLanguage);
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down

0 comments on commit 5cee9f9

Please sign in to comment.