forked from biologist79/ESPuino
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #4 from biologist79/master
Add support for i18next localisation library (biologist79#194)
- Loading branch information
Showing
24 changed files
with
1,920 additions
and
1,652 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ cmake-build-debug/ | |
platformio-override.ini | ||
src/settings-override.h | ||
src/settings-custom-override.h | ||
node_modules/ |
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 @@ | ||
<!DOCTYPE html><html><head><title data-i18n="wifi.title"></title><meta charset="utf-8"><script src="/js/i18next.min.js"></script><script src="/js/i18nextHttpBackend.min.js"></script><script src="/js/loc_i18next.min.js"></script><style>input{width:90%;height:44px;border-radius:4px;margin:10px auto;font-size:15px;background:#f1f1f1;border:0;padding:0 15px}body{background:#007bff;font-family:sans-serif;font-size:14px;color:#777}.box{background:#fff;max-width:258px;margin:75px auto;padding:30px;border-radius:5px;text-align:center}.btn{background:#3498db;color:#fff;cursor:pointer;width:90%;height:44px;border-radius:4px;margin:10px auto;font-size:15px}.rebootmsg{display:none}.fas{padding-right:.25em}</style></head><body><form id="settings" action="/init" class="box" method="POST"><h1 data-i18n="wifi.title">WiFi-configuration</h1><label for="ssid" data-i18n="[prepend]wifi.ssid.title">SSID:</label><br><input type="text" id="ssid" name="ssid" placeholder="SSID" required><br><label for="pwd" data-i18n="[prepend]wifi.password.title">Password:</label><br><input type="password" id="pwd" name="pwd" autocomplete="off" required><br><label for="hostname" data-i18n="[prepend]wifi.hostname.title">ESPuino's name (hostname):</label><br><input type="text" id="hostname" name="hostname" placeholder="espuino" required><br><br><button type="submit" id="save-button" data-i18n="submit"></button></form><form action="/restart" class="box"><h1 data-i18n="wifi.restartPrompt">Ready to go?</h1><button type="submit" id="restart-button" data-i18n="restart" value="Reboot"></button></form><script>i18next.use(i18nextHttpBackend).init({backend:{loadPath:"/locales/{{lng}}.json"},debug:!0,fallbackLng:"en"},((e,n)=>{localize=locI18next.init(i18next),localize("body")}));</script></body></html> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
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,81 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title data-i18n="wifi.title"></title> | ||
<meta charset="utf-8"> | ||
<script src="/js/i18next.min.js"></script> | ||
<script src="/js/i18nextHttpBackend.min.js"></script> | ||
<script src="/js/loc_i18next.min.js"></script> | ||
<style> | ||
input { | ||
width: 90%; | ||
height: 44px; | ||
border-radius: 4px; | ||
margin: 10px auto; | ||
font-size: 15px; | ||
background: #f1f1f1; | ||
border: 0; | ||
padding: 0 15px | ||
} | ||
body { | ||
background: #007bff; | ||
font-family: sans-serif; | ||
font-size: 14px; | ||
color: #777 | ||
} | ||
.box { | ||
background: #fff; | ||
max-width: 258px; | ||
margin: 75px auto; | ||
padding: 30px; | ||
border-radius: 5px; | ||
text-align: center | ||
} | ||
.btn { | ||
background: #3498db; | ||
color: #fff; | ||
cursor: pointer; | ||
width: 90%; | ||
height: 44px; | ||
border-radius: 4px; | ||
margin: 10px auto; | ||
font-size: 15px; | ||
} | ||
.rebootmsg { | ||
display: none; | ||
} | ||
.fas{ | ||
padding-right: 0.25em; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<form id="settings" action="/init" class="box" method="POST"> | ||
<h1 data-i18n="wifi.title">WiFi-configuration</h1> | ||
<label for="ssid" data-i18n="[prepend]wifi.ssid.title">SSID:</label><br> | ||
<input type="text" id="ssid" name="ssid" placeholder="SSID" required><br> | ||
<label for="pwd" data-i18n="[prepend]wifi.password.title">Password:</label><br> | ||
<input type="password" id="pwd" name="pwd" autocomplete="off" required><br> | ||
<label for="hostname" data-i18n="[prepend]wifi.hostname.title">ESPuino's name (hostname):</label><br> | ||
<input type="text" id="hostname" name="hostname" placeholder="espuino" required><br><br> | ||
<button type="submit" id="save-button" data-i18n="submit"></button> | ||
</form> | ||
<form action="/restart" class="box"> | ||
<h1 data-i18n="wifi.restartPrompt">Ready to go?</h1> | ||
<button type="submit" id="restart-button" data-i18n="restart" value="Reboot"></button> | ||
</form> | ||
|
||
<script> | ||
i18next.use(i18nextHttpBackend).init({ | ||
backend: { | ||
loadPath: "/locales/{{lng}}.json" | ||
}, | ||
debug: true, | ||
fallbackLng: 'en', | ||
}, (err, t) => { | ||
localize = locI18next.init(i18next); | ||
localize('body'); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.