Skip to content
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

sugestion: i18n for snackbar notificaitons #2834

Open
mind-ar opened this issue Jan 23, 2022 · 3 comments · May be fixed by #3156
Open

sugestion: i18n for snackbar notificaitons #2834

mind-ar opened this issue Jan 23, 2022 · 3 comments · May be fixed by #3156
Assignees
Labels
area/i18n Internationalization related features/bugs area/ui UI related features/bugs type/feature Request for adding a new feature

Comments

@mind-ar
Copy link
Collaborator

mind-ar commented Jan 23, 2022

Feature Request

Description

Hi, this issue is to discuss the functionality of i18n for api messages.
i can imagine two methods to impement this

1 - Implement i18n on backend

this can be easily implemented adding i18n in a common place, for example in AutheliaCtx.Error

func (c *AutheliaCtx) Error(err error, message string) {
 	msg := i18n(message)
	c.SetJSONError(msg)

	c.Logger.Error(err)
}

2 - Implement i18n on frontend

with this method we can reuse current i18n implementation, putting i18n in client functions:
PostWithOptionalResponse, Post and Get

Personally, I prefer option 2, as it allows you to centralize all i18n texts in one place

Let me know which option you prefer, and I can work on it

Use Case

N/A

@mind-ar mind-ar added the type/feature Request for adding a new feature label Jan 23, 2022
@james-d-elliott
Copy link
Member

james-d-elliott commented Feb 17, 2022

It would make sense for us to ensure the API messages are consistently English and we translate them in the client. We had a similar discussion regarding logs. It would also make sense to me that these translations exist in their own category rather than in the Portal category though let me know what you think.

@mind-ar
Copy link
Collaborator Author

mind-ar commented Feb 17, 2022

@james-d-elliott totally agree.
i'll post a PR with a draft so you can review it
thanks!

@mind-ar mind-ar linked a pull request Apr 9, 2022 that will close this issue
@mind-ar
Copy link
Collaborator Author

mind-ar commented Apr 9, 2022

@james-d-elliott i pushed a first version of this feature.
I need you to validate or reject the initial idea, before I continue to change things

@james-d-elliott james-d-elliott added area/ui UI related features/bugs area/i18n Internationalization related features/bugs labels Dec 6, 2022
@james-d-elliott james-d-elliott changed the title sugestion: i18n for api messages sugestion: i18n for ~~api messages~~ snackbar notificaitons Dec 6, 2022
@james-d-elliott james-d-elliott changed the title sugestion: i18n for ~~api messages~~ snackbar notificaitons sugestion: i18n for snackbar notificaitons Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/i18n Internationalization related features/bugs area/ui UI related features/bugs type/feature Request for adding a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants