server
server copied to clipboard
Replace ban text with localizable message
The server should not be sending any strings that get rendered in the client, because these strings are in English and we can't be sure that the user on the other end has their client set to English (in fact a majority of people probably knows English only as a second language, or does not know it very well at all). In fact issue #444 already covers this, but I'm making another ticket just for this message because changing it would allow us to drop the humanize
dependency.
Here is a link to the message: https://github.com/FAForever/server/blob/e4ca993a9b7ea8123c64f6917bf9edd05f69b0ce/server/lobbyconnection.py#L1094
It should be replaced with something like:
{
"command": "banned",
"expires_at": <ISO timestamp>
}
See #183 for inspiration, but note that we should be sending ISO timestamps (in UTC) and not timedeltas.
IssueHunt Summary
Backers (Total: $5.00)
-
askaholic ($5.00)
Become a backer now!
Or submit a pull request to get the deposits!
Tips
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on IssueHunt to raise funds.
@askaholic has funded $5.00 to this issue.
- Submit pull request via IssueHunt to receive this reward.
- Want to contribute? Chip in to this issue via IssueHunt.
- Checkout the IssueHunt Issue Explorer to see more funded issues.
- Need help from developers? Add your repository on IssueHunt to raise funds.
Hey @Askaholic, could I try fixing this issue or do you already have someone lined up to work on it?
Yea go for it, note that it will also require a PR to https://github.com/FAForever/downlords-faf-client
@Askaholic Are you and the team using a Linux OS when developing this application? Running into some issues that seem windows-based
Yea I’ve only run the server on Linux, but I think @Sheikah45 was able to get it working on Windows. If you’re on the FAF discord you can also PM me there.
I can confirm I was able to get it working had to use docker desktop and WSL
@Askaholic I wasn't originally aware that this was going to need to be handled with linux, and WSL is being uncooperative with my machine. I can set up a linux OS on a spare laptop I have to fix this, but that would take quite a while; because of that, I think it'd be best if I recuse myself from fixing this issue. I should have done further research into it before volunteering and apologize for the time of yours that I have wasted
No worries, just let me know if you want to work on it in the future!
Is this still open? I could take this up.
@therajdeepbiswas Yea for sure! I should edit the issue because I think we should make it a bit simpler than I originally described. I think the right approach would be to just add an i18n key to the message in addition to the English text.
{
"command": "notice",
"style": "error",
"text": "You are banned from FAF for 1 month",
"i18n_key": "login.error.banned",
"i18n_args": ["<ISO timestamp"]
}
I'm not entirely sure how the args stuff would work, that would be something to figure out.
Is there any custom language configuration in the project that users can choose their preferred language?? Like any CLI tool for set-up? As @Askaholic mentioned in his comment right up there, I also prefer you use built-in internationalization (I18N) and localization (L10N) services in order to translate all stuff. All you need there is equivalent.