Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Introduced CurrentLocaleResolver component allowing to override imple…
…mentation for guessing current locale in MessagesRouter It may be useful if, for instance, request.getLocale() is not *always* used to guess current user's locale (for instance if the user's locale is part of the user's data)
- Loading branch information
Showing
3 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
restx-i18n/src/main/java/restx/i18n/CurrentLocaleResolver.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,13 @@ | ||
package restx.i18n; | ||
|
||
import restx.RestxRequest; | ||
import restx.StdRequest; | ||
|
||
import java.util.Locale; | ||
|
||
/** | ||
* @author fcamblor | ||
*/ | ||
public interface CurrentLocaleResolver { | ||
Locale guessLocale(RestxRequest request); | ||
} |
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