-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
Widget i18n is skewed by bad HTTP caching #360
Comments
An alternative solution to using Cloudflare Workers could be to send all the translations to the browser and use JavaScript to pick one of them based on NavigatorLanguage. It would be cheaper but less efficient. Edit: this alternative requires JavaScript on the client, whereas a Cloudflare Worker can generate an SVG. |
This is kinda annoying, maybe it should indeed be done client-side. |
that doesn't look right next to the paypal widget. This is with java script enabled. would it not be better to define the default language right in the widget string? Firefox preferred language is english, the website language is the important part though, if that is english, the button should be english, if it is french then the button should be french (regardless of browser preference, or geo location) Translating the website using the google translate widget i get: Somehow I feel that the LibreDonate button should be more of a marketing tool and the librepay or donate button text is sortof a trademark, best not to change it at all (similar to paypal). |
I've fixed this issue by adding a (no-)caching rule to Cloudflare. This solution doesn't scale, but the current rate of requests for widgets seems to be low enough for the webapp and database to handle without any caching. |
CloudFlare only respects
Accept-Encoding
in theVary
header (What headers can I vary the cache on?), we useAccept-Language
.The text was updated successfully, but these errors were encountered: