New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat-i18n-api-messages #3156
base: master
Are you sure you want to change the base?
feat-i18n-api-messages #3156
Conversation
Thanks for choosing to contribute @mind-ar. We lint all PR's with golangci-lint and eslint, I may add a review to your PR with some suggestions. You are free to apply the changes if you're comfortable, alternatively you are welcome to ask a team member for advice. ArtifactsThese changes once approved by a team member will be published for testing on Buildkite, DockerHub and GitHub Container Registry. Docker Container
|
Co-authored-by: Authelia[bot] <59121742+autheliabot@users.noreply.github.com>
Co-authored-by: Authelia[bot] <59121742+autheliabot@users.noreply.github.com>
Just upon initial inspection, the backend namespace is unused. You need to load it when calling the |
Hi @james-d-elliott sorry for not clarifying. regarding your question: the namespaces are loaded in web/src/i18n/index.ts. try {
const res = await postFirstFactor(username, password, rememberMe, redirectionURL, requestMethod);
props.onAuthenticationSuccess(res ? res.redirect : undefined);
} catch (err) {
console.error(err);
createErrorNotification(translate("Incorrect username or password"));
props.onAuthenticationFailure();
setPassword("");
passwordRef.current.focus();
} To use the backend namespace we would to use somethink like this try {
const res = await postFirstFactor(username, password, rememberMe, redirectionURL, requestMethod);
props.onAuthenticationSuccess(res ? res.redirect : undefined);
} catch (err) {
console.error(err);
createErrorNotification(translate(err.message, {ns: "backend"}));
props.onAuthenticationFailure();
setPassword("");
passwordRef.current.focus();
} So, this PR only gives the "readyness" for backend translations, because that requires that we display the backend's message to the user (maybe not desired) Let me know what you think |
Hello, I think this PR could be discarded as it does not provide any visible improvement |
This PR implements i18n for api messages and Closes #2834
This first commit implements a concept of work, it needs validation from maintainers to be able to continue