Stardew-Profits icon indicating copy to clipboard operation
Stardew-Profits copied to clipboard

[Feature] Adding i18n support.

Open ShanderB opened this issue 9 months ago • 3 comments

I intend to refactor few things, but the current state is working. We had a problem that we have a half second where the i18n fields are empty. Need to fix this.

I was using the Stardew Profits and notice that we don't have any type of translation. We could use the Chrome web translation but usually is weird, and if you don't use Chrome, fuck you. Then i started to work on this and my girlfriend started to play Stardew Vallew, i mentioned Stardew Profits and she was disappointing because she uses Firefox and don't speaks English. So here i am translating the code.

I NEED FEW SUGGESTIONS

First one: i was wondering if it's a good idea to add the selected language to the URL.

If i change anything in the table, it modify the URL. If i send the URL to anyone, they will see exactly what i'm seeing.

  • It's a good idea to add the selected langue to the URL?

Second: Also, i intend to add a tool tip to all sections. I have no clue what few options intend to do, so adding this tool tip should help anyone.

Something like:

Table field "Current Day:". If you hover, a tool tip pop up with "This option means that you need to write the day you want to start to count", or something like "This is your current day inside de game". eLYLh 68747470733a2f2f67746d7330332e616c6963646e2e636f6d2f7470732f69332f5442314e5155534870585858586155584658586c5171795a5858582d313331322d3537322e706e67 image

Some examples.

Third: i am not completely aware how to fix a problem. If we have the i18n, when we load the page we see all the fields empty for half of a second. This is annoying for me.

I'm thinking to add some loader spinners, or prevent the page to load while the code populate all the fields. At least locally, preventing the page to load is pretty fast, so the user shouldn't notice.

ShanderB avatar May 01 '24 13:05 ShanderB

I have absolutely no experience with this i18n, in fact it's the first time I hear about it, so I am afraid I cannot help you much here, and you will be mostly on your own when implementing this.

You mentioned it causing issues with loading. If it in any way impedes the performance and speed of the website, I will not be able to accept this.

I also just wanted to add that Firefox does support translation.

Thorinair avatar May 01 '24 13:05 Thorinair

image Here is an example of Firefox natively translating the website. Yes, some things like buttons slightly break, but I cannot imagine them not breaking when using i18n either.

Thorinair avatar May 01 '24 13:05 Thorinair

Sure, no problem. I'll keep working on this. I'll do my best.

When i finish, you decide if it should be merged!

ShanderB avatar May 01 '24 18:05 ShanderB

Got to bored but it's almost complete. We got only a bug to fix. When selecting a language and selecting something in the table, the language change it back to English. Few more lines to translate (since last your update) and it's done. I'll keep the fork so if in few months i got the strength, i open a new PR. The fork have a Github page with the changes.

ShanderB avatar Jun 21 '24 13:06 ShanderB