+ 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 ?
7 Réponses
+ 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
+ 4
Are you trying to have it remember which language the end-user picked? If so, just use cookies for that.
+ 4
JavaScript:
https://www.w3schools.com/js/js_cookies.asp
^Read through that. Doesn't require node or PHP, just vanilla JavaScript.
+ 3
use npm databases? i use mysql-server and node if that helps u
if ur using php u can go for phpMyAdmin
+ 2
Can't I make it without using node.js or php ?
+ 2
I will search thank you 😊
+ 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.