Compare commits

..

No commits in common. "876545630a13ac3413ac6f7dd9f1c33b8da29c3d" and "cad6d14ba8f9ce8ef6b39374fa50b9e7aff263dd" have entirely different histories.

4 changed files with 7 additions and 8 deletions

View File

@ -21,11 +21,15 @@ public class UserInfoProvider implements ContainerRequestFilter {
@Override
public void filter(ContainerRequestContext requestContext) {
System.out.println(requestContext.getHeaders());
List<Locale> acceptableLanguages = requestContext.getAcceptableLanguages();
System.out.println(acceptableLanguages);
Locale selectedLocale = findFirstSupportedLanguage(acceptableLanguages);
if (selectedLocale == null)
selectedLocale = TradService.fallbackLocale;
System.out.println(selectedLocale);
requestContext.setProperty("userLocale", selectedLocale);
}

View File

@ -68,7 +68,7 @@ quarkus.http.auth.permission.public.policy=permit
quarkus.keycloak.admin-client.server-url=https://auth.safca.fr
quarkus.native.resources.includes=asset/**,lang/**
quarkus.native.resources.includes=asset/**
# HelloAsso Connector
helloasso.api=https://api.helloasso.com

View File

@ -671,14 +671,12 @@ export async function initCompetitionApi(apiUrlRoot_, host) {
.use(i18nextHttpBackend)
.use(i18nextBrowserLanguagedetector)
.init({
supportedLngs: ['fr', 'en'],
fallbackLng: 'fr',
debug: host.startsWith('http://localhost'),
debug: true,
interpolation: {
escapeValue: true,
},
detection: options,
backend: backend,
ns: ['result'],
defaultNS: 'result',
})

View File

@ -3,8 +3,6 @@ import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import {initReactI18next} from 'react-i18next';
const vite_url = import.meta.env.VITE_URL;
const options = {
order: [ 'querystring', 'cookie', 'localStorage', 'sessionStorage', 'navigator', 'htmlTag'],
caches: [],
@ -22,9 +20,8 @@ i18n
// init i18next
// for all options read: https://www.i18next.com/overview/configuration-options
.init({
supportedLngs: ['fr', 'en'],
fallbackLng: 'fr',
debug: vite_url.startsWith('http://localhost'),
debug: true,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},