Skip to content

Commit

Permalink
Continue localization
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoleNG18 committed Apr 14, 2024
1 parent 7218dd3 commit 6615b13
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ public void init() {

private void initSchool() {
if(this.schoolRepository.count()==0){
SchoolEntity school=new SchoolEntity().setCity("Kyustendil").setName("PMG Prof. Emanuil Ivanov");
SchoolEntity school=new SchoolEntity().setCity("Кюстендил").setName("ПМГ 'Проф. Емануил Иванов'");
this.schoolRepository.saveAndFlush(school);
}
}

public void initSuperAdmin() {
if (this.userRepository.count() == 0) {
UserEntity user = new UserEntity()
.setFirstName("Nikol")
.setLastName("Georgieva")
.setFirstName("Никол")
.setLastName("Георгиева")
.setEmail("[email protected]")
.setPassword(passwordEncoder.encode("nikol@superadmin"))
.setSchool(this.schoolRepository.findSchoolEntityBySchoolName("PMG Prof. Emanuil Ivanov"))
.setSchool(this.schoolRepository.findSchoolEntityBySchoolName("ПМГ 'Проф. Емануил Иванов'"))
.setRoles(userRoleRepository.findAll());
this.userRepository.saveAndFlush(user);
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ home_if_have=If you have an account - here.
home_login=log in
home_register=sign up
title_home= Home
title_login = Log in
title_register= Register
title_howto= How to add your school?
login_login=Log in
login_email=Email
login_err=Invalid username or password.
Expand All @@ -27,3 +32,6 @@ err_email=Email should be unique
err_school=At least 15 symbols.
err_pass=At least 8 characters and 1 digit
err_confirm_pass=Passwords should match
howto_welcome=Welcome to PE Scores
howto_text=If you want your school to become part of us, please send us an email to [email protected] with the name of the school, the city and the future username of your admin. Then we will add the school to the platform and the admin will be able to make registration.
10 changes: 9 additions & 1 deletion src/main/resources/i18n/messages_bg.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ home_if_have = Ако имате акаунт - тук
home_login= влезте
home_register = регистрирайте се

title_home= Начална страница
title_login = Вход
title_register= Регистрация
title_howto= Как да добавите училището си?

login_login= Вход
login_email = Имейл
login_err=Невалидно име или парола
Expand All @@ -26,4 +31,7 @@ err_name=Между 2 и 15 букви
err_email=Имейлът трябва да бъде уникален
err_school=Поне 15 символа
err_pass=Поне 8 символа и поне 1 число
err_confirm_pass=Паролите трябва да съвпадат
err_confirm_pass=Паролите трябва да съвпадат

howto_welcome=Добре дошли
howto_text=Ако искате да станете част от нас, моля изпратете имейл на [email protected] с името на училището, градът и бъдещото потребителско име на админа ви. След това ние ще добавим училището в платформата и админът ще може да направи регистрация и да започне да изгражда училището в платформата.
11 changes: 8 additions & 3 deletions src/main/resources/static/css/contact.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@
}

.main-section p {
opacity: 80%;
font-size: large;
padding: 0.5em;
font-weight: 700;
background: linear-gradient(to right, white 51.16%, #5d54c3 48.84%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
border-radius: 10px;
/*background: linear-gradient(to right, white 51.16%, #5d54c3 48.84%);*/
background-color: #5d54c3;
color: #d8d7fe;
/*-webkit-background-clip: text;*/
/*-webkit-text-fill-color: transparent;*/
margin-bottom: 0.5em;
}

Expand Down
23 changes: 18 additions & 5 deletions src/main/resources/templates/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

<head>
<title>Contact</title>
<title th:text="#{title_howto}">How to add your school?</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -24,8 +24,21 @@

<nav class="navbar">
<ul class="navbar-buttons" sec:authorize="!isAuthenticated()">
<a th:href="@{/users/login}">Log in</a>
<a th:href="@{/users/register}">Sign up</a>
<a th:href="@{/contact}" th:text="#{navbar_add_school}">How to add your school?</a>
<a th:href="@{/users/login}" th:text="#{navbar_login}">Log in</a>
<a th:href="@{/users/register}" th:text="#{navbar_register}">Register</a>
<a class="nav-item">
<form th:method="get">
<label class="text-white" th:text="#{navbar_language}" for="lang"></label>
<select
onchange="this.form.submit()"
id="lang"
name="lang">
<option value="en_US" th:selected="${#locale.toString()} == 'en_US'">English</option>
<option value="bg_BG" th:selected="${#locale.toString()} == 'bg_BG'">Български</option>
</select>
</form>
</a>
</ul>

<ul class="navbar-buttons" sec:authorize="isAuthenticated()">
Expand Down Expand Up @@ -53,8 +66,8 @@
<div sec:authorize="!isAuthenticated()" class="main-section-wrap">
<section class="main-section">
<div class="main-text">
<h3>Welcome to PE Scores.</h3>
<p>If you want your school to become part of us, please send us an email to [email protected] with the name of the school,
<h3 th:text="#{howto_welcome}">Welcome to PE Scores</h3>
<p th:text="#{howto_text}">If you want your school to become part of us, please send us an email to [email protected] with the name of the school,
the city and the future username of your admin. Then we will add the school to the platform and the admin
will be able to make registration.</p>

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

<head>
<title>Home</title>
<title th:text="#{title_home}">Home</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/login.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<head>
<title>Login</title>
<title th:text="#{title_login}">Login</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
<title>Register</title>
<title th:text="#{title_register}">Register</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down

0 comments on commit 6615b13

Please sign in to comment.