fix: translate backend add log #100
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -655,7 +655,7 @@ function combsPage() {
|
||||
rootDiv.append(content)
|
||||
}
|
||||
|
||||
export async function initCompetitionApi(apiUrlRoot_) {
|
||||
export async function initCompetitionApi(apiUrlRoot_, host) {
|
||||
apiUrlRoot = apiUrlRoot_;
|
||||
|
||||
const options = {
|
||||
@ -663,6 +663,10 @@ export async function initCompetitionApi(apiUrlRoot_) {
|
||||
caches: [],
|
||||
}
|
||||
|
||||
const backend = {
|
||||
loadPath: `${host}/locales/{{lng}}/{{ns}}.json`,
|
||||
}
|
||||
|
||||
await i18next
|
||||
.use(i18nextHttpBackend)
|
||||
.use(i18nextBrowserLanguagedetector)
|
||||
|
||||
@ -225,7 +225,7 @@ function Menu({menuActions, compUuid}) {
|
||||
<div id='safca_api_data'></div>
|
||||
<script type="module">
|
||||
import {initCompetitionApi} from '${vite_url}/competition.js';
|
||||
initCompetitionApi("${vite_url}/api/public/result/${compUuid}")
|
||||
initCompetitionApi("${vite_url}/api/public/result/${compUuid}", "${vite_url}")
|
||||
</script>`
|
||||
).then(() => {
|
||||
toast.success(t('texteCopiéDansLePresse'));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user