server icon indicating copy to clipboard operation
server copied to clipboard

Replace ban text with localizable message

Open Askaholic opened this issue 4 years ago • 11 comments

Issuehunt badges

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)

Become a backer now!

Or submit a pull request to get the deposits!

Tips

Askaholic avatar Aug 03 '20 18:08 Askaholic

@askaholic has funded $5.00 to this issue.


issuehunt-oss[bot] avatar Sep 14 '20 19:09 issuehunt-oss[bot]

Hey @Askaholic, could I try fixing this issue or do you already have someone lined up to work on it?

cb0806151 avatar Sep 18 '20 15:09 cb0806151

Yea go for it, note that it will also require a PR to https://github.com/FAForever/downlords-faf-client

Askaholic avatar Sep 18 '20 16:09 Askaholic

@Askaholic Are you and the team using a Linux OS when developing this application? Running into some issues that seem windows-based

cb0806151 avatar Sep 19 '20 14:09 cb0806151

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.

Askaholic avatar Sep 19 '20 16:09 Askaholic

I can confirm I was able to get it working had to use docker desktop and WSL

Sheikah45 avatar Sep 19 '20 17:09 Sheikah45

@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

cb0806151 avatar Sep 19 '20 21:09 cb0806151

No worries, just let me know if you want to work on it in the future!

Askaholic avatar Sep 21 '20 01:09 Askaholic

Is this still open? I could take this up.

rajdeep-biswas avatar Jun 08 '21 14:06 rajdeep-biswas

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

Askaholic avatar Jun 12 '21 19:06 Askaholic

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.

lnxpy avatar Nov 26 '21 03:11 lnxpy