Very basic database in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Very basic database in html

I made a draw application. It is Turkish . But I want to make it in other language so I need a basic database for remember to choosing. I don't have much time. How I can make it ?

3rd Jul 2017, 3:59 PM
Serhat Merak
Serhat Merak - avatar
7 Answers
+ 12
another option is to use local storage access denied here on SL mobile app playground but should work in web to get selected language: var lang = localStorage["lang"] || ""; if no language found set to default as english: if(lang === ""){ localStorage["lang"] = "en"; } can define any key: localStorage["username"] = "Burey"; https://www.w3schools.com/html/html5_webstorage.asp
3rd Jul 2017, 4:12 PM
Burey
Burey - avatar
+ 4
Are you trying to have it remember which language the end-user picked? If so, just use cookies for that.
3rd Jul 2017, 4:01 PM
AgentSmith
+ 4
JavaScript: https://www.w3schools.com/js/js_cookies.asp ^Read through that. Doesn't require node or PHP, just vanilla JavaScript.
3rd Jul 2017, 4:11 PM
AgentSmith
+ 3
use npm databases? i use mysql-server and node if that helps u if ur using php u can go for phpMyAdmin
3rd Jul 2017, 4:08 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 2
Can't I make it without using node.js or php ?
3rd Jul 2017, 4:04 PM
Serhat Merak
Serhat Merak - avatar
+ 2
I will search thank you 😊
7th Jul 2017, 8:24 AM
Serhat Merak
Serhat Merak - avatar
+ 1
You can use json to store language based strings like "usr_name":"Username" and "usr_name":"Kullanıcı Adı" in 'en.json' and 'tr.json'. You can retrieve those json files with Ajax or XmlHttpRequest then show them to users. You need to determine which language (json file) to retrieve to show user.
7th Jul 2017, 8:22 AM
Bekir Uzun
Bekir Uzun - avatar