Skip to content

Commit c7408ca

Browse files
feat: enhance AccountLocaleProvider with detailed documentation and implement getDefaultLocale method
1 parent fb1bedc commit c7408ca

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

sources/core/src/main/java/tools/dynamia/modules/saas/AccountLocaleProvider.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,40 @@
2424

2525
import java.util.Locale;
2626

27+
/**
28+
* AccountLocaleProvider is an implementation of {@link LocaleProvider} for SaaS environments.
29+
* <p>
30+
* Provides the default {@link Locale} based on the current account session context.
31+
* The priority for this provider is set to 10, making it suitable for account-level locale resolution.
32+
* <p>
33+
* If the account session or locale cannot be resolved, this provider returns null.
34+
*
35+
* @author Mario
36+
*/
2737
@Provider
2838
public class AccountLocaleProvider implements LocaleProvider {
29-
39+
/**
40+
* Logger for this provider, using SLF4J.
41+
*/
3042
private final LoggingService logger = new SLF4JLoggingService(AccountLocaleProvider.class);
3143

44+
/**
45+
* Returns the priority of this provider. Lower values indicate higher priority.
46+
*
47+
* @return the priority value (10)
48+
*/
3249
@Override
3350
public int getPriority() {
3451
return 10;
3552
}
3653

54+
/**
55+
* Returns the default {@link Locale} for the current account session.
56+
* <p>
57+
* Attempts to retrieve the account locale from the current session. If unavailable, returns null.
58+
*
59+
* @return the account's default Locale, or null if not available
60+
*/
3761
@Override
3862
public Locale getDefaultLocale() {
3963
try {

0 commit comments

Comments
 (0)