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

Plugin frontend helper to get the client language code #5904

Open
JohnXLivingston opened this issue Jul 26, 2023 · 0 comments
Open

Plugin frontend helper to get the client language code #5904

JohnXLivingston opened this issue Jul 26, 2023 · 0 comments
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Feature Request ✨

Comments

@JohnXLivingston
Copy link
Contributor

Describe the problem to be solved

In the livechat plugin, i want to add some links to the online documentation.
This documentation is translated in the same languages as Peertube.
So, i want to add the current user language code in the url, to point to the correct documentation page.

It seems the languages is calculated by Angular, with a logic that returns the first found criteria:

  • cookie clientLanguage
  • browser language
  • english

Describe the solution you would like

I don't want to reproduce the Angular logic in my code, and i'd like a helper function that returns the current language code.

I need this for frontend, but maybe it could also be useful for backend? I don't know if the backend knows the user's language?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Feature Request ✨
2 participants