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

Widget i18n is skewed by bad HTTP caching #360

Closed
Changaco opened this issue Jun 20, 2016 · 5 comments
Closed

Widget i18n is skewed by bad HTTP caching #360

Changaco opened this issue Jun 20, 2016 · 5 comments
Labels
bug malfunctions which should be corrected as soon as possible i18n internationalization

Comments

@Changaco
Copy link
Member

CloudFlare only respects Accept-Encoding in the Vary header (What headers can I vary the cache on?), we use Accept-Language.

@Changaco Changaco added bug malfunctions which should be corrected as soon as possible i18n internationalization labels Jun 20, 2016
@Changaco
Copy link
Member Author

@Changaco
Copy link
Member Author

Changaco commented Jun 15, 2020

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.

@Avamander
Copy link

This is kinda annoying, maybe it should indeed be done client-side.

@CaptainMorgan12
Copy link

CaptainMorgan12 commented Dec 13, 2023

Screenshot from 2023-12-13 14-35-25

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:

Screenshot from 2023-12-13 14-43-03

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).

@Changaco
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug malfunctions which should be corrected as soon as possible i18n internationalization
Development

No branches or pull requests

3 participants