-
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.
- Loading branch information
1 parent
c9349f0
commit 7218dd3
Showing
12 changed files
with
598 additions
and
429 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/main/java/pmgkn/pescores/pescores/config/I18NConfig.java
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,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; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/pmgkn/pescores/pescores/config/WebConfig.java
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,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); | ||
} | ||
|
||
} |
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,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 |
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,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=Паролите трябва да съвпадат |
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
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
Oops, something went wrong.