internationalization app (#1394)
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
greeting=Hello! Welcome to our website!
|
||||
lang.change=Change the language
|
||||
lang.eng=English
|
||||
lang.fr=French
|
||||
@@ -0,0 +1,4 @@
|
||||
greeting=Bonjour! Bienvenue sur notre site!
|
||||
lang.change=Changez la langue
|
||||
lang.eng=Anglais
|
||||
lang.fr=Francais
|
||||
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="ISO-8859-1" />
|
||||
<title>Home</title>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#locales").change(function () {
|
||||
var selectedOption = $('#locales').val();
|
||||
if (selectedOption != ''){
|
||||
window.location.replace('international?lang=' + selectedOption);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 th:text="#{greeting}"></h1>
|
||||
|
||||
<br /><br />
|
||||
<span th:text="#{lang.change}"></span>:
|
||||
<select id="locales">
|
||||
<option value=""></option>
|
||||
<option value="en" th:text="#{lang.eng}"></option>
|
||||
<option value="fr" th:text="#{lang.fr}"></option>
|
||||
</select>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user