GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.89k stars 271 forks source link

[i18n] Replace CommandUtils.prettyPrint with ListFormatter from ICU4J #990

Closed Pr0methean closed 5 years ago

Pr0methean commented 5 years ago

Only applies to /banlist right now, but will apply to all commands that use CommandUtils.prettyPrint once the rest are converted to extend GlowVanillaCommand.

smartboyathome commented 5 years ago

It looks like ICU4J is distributed under a license I hadn't looked into much before, the Unicode License. I did a little digging, but couldn't find much information on it. Mind spending a bit of time to make sure it is compatible with our project?

Pr0methean commented 5 years ago

According to https://www.gnu.org/licenses/license-list.en.html#Unicode it's indeed compatible with LGPL and GPL.

aramperes commented 5 years ago

ICU4J is a 12MB library. Is it worth adding this dependency for a single feature (pretty list formatting), and would there be a simple way to implement it ourselves?

Pr0methean commented 5 years ago

We could extract the list patterns from the CLDR at build time (runtime wouldn't help, since the ZIP file we'd need is 20MB), but that'd be complicated to implement. We'll likely eventually be using ICU4J for more than just list formatting anyway. Why not add Proguard to our build process to remove unused library code?

Pr0methean commented 5 years ago

An alternative would be to drop the word "and" and use a comma-separated list, which I think works in all languages.