Compare commits
2 Commits
4bf07cc8f8
...
cad6d14ba8
| Author | SHA1 | Date | |
|---|---|---|---|
| cad6d14ba8 | |||
| c456fdae8b |
@ -21,11 +21,15 @@ public class UserInfoProvider implements ContainerRequestFilter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void filter(ContainerRequestContext requestContext) {
|
public void filter(ContainerRequestContext requestContext) {
|
||||||
|
System.out.println(requestContext.getHeaders());
|
||||||
|
|
||||||
List<Locale> acceptableLanguages = requestContext.getAcceptableLanguages();
|
List<Locale> acceptableLanguages = requestContext.getAcceptableLanguages();
|
||||||
|
System.out.println(acceptableLanguages);
|
||||||
Locale selectedLocale = findFirstSupportedLanguage(acceptableLanguages);
|
Locale selectedLocale = findFirstSupportedLanguage(acceptableLanguages);
|
||||||
|
|
||||||
if (selectedLocale == null)
|
if (selectedLocale == null)
|
||||||
selectedLocale = TradService.fallbackLocale;
|
selectedLocale = TradService.fallbackLocale;
|
||||||
|
System.out.println(selectedLocale);
|
||||||
requestContext.setProperty("userLocale", selectedLocale);
|
requestContext.setProperty("userLocale", selectedLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -655,7 +655,7 @@ function combsPage() {
|
|||||||
rootDiv.append(content)
|
rootDiv.append(content)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function initCompetitionApi(apiUrlRoot_) {
|
export async function initCompetitionApi(apiUrlRoot_, host) {
|
||||||
apiUrlRoot = apiUrlRoot_;
|
apiUrlRoot = apiUrlRoot_;
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
@ -663,6 +663,10 @@ export async function initCompetitionApi(apiUrlRoot_) {
|
|||||||
caches: [],
|
caches: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const backend = {
|
||||||
|
loadPath: `${host}/locales/{{lng}}/{{ns}}.json`,
|
||||||
|
}
|
||||||
|
|
||||||
await i18next
|
await i18next
|
||||||
.use(i18nextHttpBackend)
|
.use(i18nextHttpBackend)
|
||||||
.use(i18nextBrowserLanguagedetector)
|
.use(i18nextBrowserLanguagedetector)
|
||||||
|
|||||||
@ -225,7 +225,7 @@ function Menu({menuActions, compUuid}) {
|
|||||||
<div id='safca_api_data'></div>
|
<div id='safca_api_data'></div>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import {initCompetitionApi} from '${vite_url}/competition.js';
|
import {initCompetitionApi} from '${vite_url}/competition.js';
|
||||||
initCompetitionApi("${vite_url}/api/public/result/${compUuid}")
|
initCompetitionApi("${vite_url}/api/public/result/${compUuid}", "${vite_url}")
|
||||||
</script>`
|
</script>`
|
||||||
).then(() => {
|
).then(() => {
|
||||||
toast.success(t('texteCopiéDansLePresse'));
|
toast.success(t('texteCopiéDansLePresse'));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user