Skip to content

Commit

Permalink
Using lowercase languages (de, en).
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjampen committed Jan 15, 2024
1 parent efd8441 commit 43ab43f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/api/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export async function POST(request) {
let id = rows.insertId

query = 'INSERT INTO `settings` (user_id, theme, wake_up_time, bed_time, newsletter, language) VALUES (?, ?, ?, ?, ?, ?)';
params = [id, 1, '07:00:00', '23:00:00', 1, "En"]
params = [id, 1, '07:00:00', '23:00:00', 1, "en"]
rows = await executeQuery(query, params);
}
if (type === "loginUser") {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function getSettings() {

let defaultSettings = {
"theme": 1,
"language": "En",
"language": "en",
}
return defaultSettings
}
4 changes: 2 additions & 2 deletions components/SettingsForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function SettingsForm() {
"theme": theme === "Dark" ? 0 : 1,
"awakeTime": awakeTime,
"bedTime": bedTime,
"language": language === "German" ? "De" : "En",
"language": language === "German" ? "de" : "en",
}),
})

Expand All @@ -50,7 +50,7 @@ export function SettingsForm() {
setAwakeTime(data.wake_up_time)
setBedTime(data.bed_time)
setTheme(data.theme === 0 ? "Dark" : "Light")
setLanguage(data.language === "De" ? "German" : "English")
setLanguage(data.language === "de" ? "German" : "English")
}
fetchData();
}, [])
Expand Down

0 comments on commit 43ab43f

Please sign in to comment.