diff --git a/src/main/java/pmgkn/pescores/pescores/config/I18NConfig.java b/src/main/java/pmgkn/pescores/pescores/config/I18NConfig.java new file mode 100644 index 0000000..37ca366 --- /dev/null +++ b/src/main/java/pmgkn/pescores/pescores/config/I18NConfig.java @@ -0,0 +1,35 @@ +package pmgkn.pescores.pescores.config; + +import org.springframework.context.MessageSource; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.web.servlet.LocaleResolver; +import org.springframework.web.servlet.i18n.CookieLocaleResolver; +import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; + +@Configuration +public class I18NConfig { +//bazirano na requesta razbira kakuv e ezika na koiyo iskame da se vidi saita + @Bean + public LocaleResolver localeResolver() { + CookieLocaleResolver clr = new CookieLocaleResolver(); + clr.setCookieName("lang"); + return clr; + } +//prihvashta koga potrebitelqt iska da smeni ezika + @Bean + public LocaleChangeInterceptor localeChangeInterceptor() { + LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); + lci.setParamName("lang"); + return lci; + } +//files with keys + @Bean + public MessageSource messageSource() { + ResourceBundleMessageSource resourceBundleMessageSource = new ResourceBundleMessageSource(); + resourceBundleMessageSource.setBasename("i18n/messages"); + resourceBundleMessageSource.setDefaultEncoding("UTF-8"); + return resourceBundleMessageSource; + } +} diff --git a/src/main/java/pmgkn/pescores/pescores/config/WebConfig.java b/src/main/java/pmgkn/pescores/pescores/config/WebConfig.java new file mode 100644 index 0000000..ee632c0 --- /dev/null +++ b/src/main/java/pmgkn/pescores/pescores/config/WebConfig.java @@ -0,0 +1,21 @@ +package pmgkn.pescores.pescores.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; + +@Configuration +public class WebConfig implements WebMvcConfigurer { + private LocaleChangeInterceptor localeChangeInterceptor; + + public WebConfig(LocaleChangeInterceptor localeChangeInterceptor) { + this.localeChangeInterceptor = localeChangeInterceptor; + } + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(localeChangeInterceptor); + } + +} diff --git a/src/main/resources/i18n/messages.properties b/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000..871e69b --- /dev/null +++ b/src/main/resources/i18n/messages.properties @@ -0,0 +1,29 @@ +navbar_language=Language +navbar_login=Login +navbar_register=Sign up +navbar_add_school=How to add your school? + +home_welcome=Welcome to PE Scores +home_if_dont_have=If you don't have an account - here. +home_if_have=If you have an account - here. +home_login=log in +home_register=sign up + +login_login=Log in +login_email=Email +login_err=Invalid username or password. +login_pass=Password + +signup_signup = Register +signup_confirm_pass = Confirm password +signup_pass = Password +signup_school = School +signup_email = Email +signup_last_name = Last name +signup_first_name = First name + +err_name=Between 2 and 15 letters +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 diff --git a/src/main/resources/i18n/messages_bg.properties b/src/main/resources/i18n/messages_bg.properties new file mode 100644 index 0000000..0e203f9 --- /dev/null +++ b/src/main/resources/i18n/messages_bg.properties @@ -0,0 +1,29 @@ +navbar_language = Език +navbar_login = Вход +navbar_register = Регистрация +navbar_add_school = Как да добавите училището си? + +home_welcome = Добре дошли! +home_if_dont_have = Ако нямате акаунт - тук +home_if_have = Ако имате акаунт - тук +home_login= влезте +home_register = регистрирайте се + +login_login= Вход +login_email = Имейл +login_err=Невалидно име или парола +login_pass=Парола + +signup_signup = Регистрация +signup_confirm_pass = Повторена парола +signup_pass = Парола +signup_school = Училище +signup_email = Имейл +signup_last_name = Фамилия +signup_first_name = Име + +err_name=Между 2 и 15 букви +err_email=Имейлът трябва да бъде уникален +err_school=Поне 15 символа +err_pass=Поне 8 символа и поне 1 число +err_confirm_pass=Паролите трябва да съвпадат \ No newline at end of file diff --git a/src/main/resources/static/css/fragments.css b/src/main/resources/static/css/fragments.css index 3c4147d..e7be0e3 100644 --- a/src/main/resources/static/css/fragments.css +++ b/src/main/resources/static/css/fragments.css @@ -53,6 +53,25 @@ header img { color: #d8d7fe; } +select { + background-color: #d8d7fe; + color: #5d54c3; + border-color: #d8d7fe; + font-weight: 600; + font-size: 14px; +} + +option { + font-weight: 600; + background-color: #d8d7fe; + color:#5d54c3; +} + +option:checked { + background-color: #5d54c3; + color: #d8d7fe; +} + .navbar-buttons a { cursor: pointer; background-color: #d8d7fe; diff --git a/src/main/resources/templates/home.html b/src/main/resources/templates/home.html index 872ee13..efe4687 100644 --- a/src/main/resources/templates/home.html +++ b/src/main/resources/templates/home.html @@ -24,9 +24,21 @@