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

Dynamic redirects based on language #1915

Closed
acelaya opened this issue Nov 8, 2023 · 1 comment · Fixed by #2026
Closed

Dynamic redirects based on language #1915

acelaya opened this issue Nov 8, 2023 · 1 comment · Fixed by #2026
Labels
Milestone

Comments

@acelaya
Copy link
Member

acelaya commented Nov 8, 2023

Summary

Allow dynamically redirecting to different long URLs based on the visitor's language (potentially from Accept-Language header).

Depends on #1914

Use case

@acelaya acelaya added feature blocked Issues with some external dependency preventing to work on them labels Nov 8, 2023
@acelaya acelaya added this to the 4.1.0 milestone Nov 8, 2023
@acelaya acelaya removed the blocked Issues with some external dependency preventing to work on them label Feb 24, 2024
@acelaya acelaya modified the milestones: 4.1.0, 4.0.0 Feb 24, 2024
@acelaya acelaya moved this to In Progress in Shlink Feb 24, 2024
@acelaya
Copy link
Member Author

acelaya commented Feb 25, 2024

There's some considerations around languages. For example, according to MDN, a typical Accept-Language header value could look like this Accept-Language: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5. That means that:

  • The * language should be ignored when it comes to match a redirect condition, as it would always match no matter what.
  • If the Accept-Language header is empty, not present, or only has the value *, the condition will not be considered a match.
  • Values can be defined as language codes (fr, en, it, etc) or full locales (fr-FR, en-US, es-AR). Both should be allowed as matchValue, and if only the language code is used for matching, any locale for that language should resolve a positive match (es will match es-ES, es-AR, es-MX, etc. while en-UK will not match en-US)
  • The quality part should be ignored (q=0.5), as we want to check if the language/locale defined as matchValue is present in any of the languages.

@acelaya acelaya moved this from In Progress to In review in Shlink Feb 26, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Shlink Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant