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

Improved number formatting, with a couple of other fixes #1467

Merged
merged 3 commits into from
Mar 8, 2021

Conversation

warjort
Copy link
Contributor

@warjort warjort commented Feb 14, 2021

What:
Improved number formatting to include thousands seperators according to locale.

How solved:
Changed %d in the language file to %,d

Outcome:
Does some of #1323

Additional info:
While doing this I discovered a few places where %d was used when it should have been using %s or %f

I also found that the code for slot widget in the crafting table used gregtech.item_list.item_stored while the language file was gregtech.item_list.items_stored, I changed the language file.

There are some places like the multiblock boiler or the gt util hand command that use minecraft's TextComponentTransalation api. This doesn't work with %,d so I didn't change these. Other places that use this api in the code, format numbers using %s.

I haven't touched the russian or chinese translations. They will not have the thousands seperators until somebody that speaks those languages does the same excercise.

Possible compatibility issue:
If one of the addon mods is reusing some of these translations, it may break their display if they have the same misuse as the %s and %f issue I fixed.

@warjort
Copy link
Contributor Author

warjort commented Feb 14, 2021

One other change I did inadvertantly but decided to keep for the purposes of comment is that the GT tools attack damage and digging speed now show the first decimal. e.g. before it might show Attack Damage: 7, now it will show Attack Damage: 7.2

I don't know if the decimals are actually used by minecraft?

@LAGIdiot
Copy link
Member

I have tagged this as open for discussion. As I would like to hear opinion of others. Please don't turn this to hate fest...

@warjort also don't leave comments of what was changed to what in code we can see that from git history

@warjort
Copy link
Contributor Author

warjort commented Feb 16, 2021

@warjort also don't leave comments of what was changed to what in code we can see that from git history

But translators don't necessarily know how to read git diffs. The ==> is for them.

@warjort
Copy link
Contributor Author

warjort commented Feb 16, 2021

Take a look at #1484 if you want to see what the %,d looks like.

@LAGIdiot
Copy link
Member

We are not using any translator services. So knowledge how to use git is required. Which means they should be able to use diff too.

@LAGIdiot
Copy link
Member

LAGIdiot commented Mar 7, 2021

I am pinging this one from Discord so we can get discussion going

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants