MiguelAngelLV introduced a new plugin based on the Steam Store Onebox to display Steam profile banners using the steamsignature.com API. The plugin converts standard Steam profile URLs into a formatted banner with an image and an “Add Friend” button. Initially, the banner defaulted to Spanish, but the author sought advice on implementing auto-detection for the user’s language. fearlessfrog suggested adding a configurable site setting (steam_signature_language) to allow administrators to select the language via the plugin’s configuration menu, rather than relying on unreliable client-side headers. MiguelAngelLV implemented this suggestion and also added custom CSS to hide the click counter. Alankrit_Choudh and erlend_sh encouraged the author to submit a Pull Request to the main discourse/onebox repository to make the feature available to all users. MiguelAngelLV agreed but asked for guidance on where to place custom CSS styles within the Onebox project. Additionally, marcospreviato asked how to increase the profile box width, to which the author replied that the size is fixed by the external image source. Finally, repz reported intermittent failures, which MiguelAngelLV attributed to instability in the external Steam Signature server.
For now, show the data in spanish, but changing the url of image change the language. I would like add “auto” language, but I don’t kwow how. Pull Request are wellcome.
I don’t think there is anything in the Onebox engine that tells you server locale info that would allow you to form that URL dependent on default site language. The alternative would be something from the client like Accept-Language headers on the request, but they aren’t always reliable or 1 to 1 mapping. Defaulting to Spanish isn’t ideal for some.
How about using a config settings list, and let the plugin set-up in the plug config menu UI choose the languages that steamsignature.com support? I think the spoiler plugin has a nice clean and simply config example here:
[quote=“MiguelAngelLV, post:6, topic:35792”]
One box is a project? Do you want that I make a PR to a other project?
[/quote]Yes please! He is referring to this: