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

Suggestion: Localized item display names #11

Closed
Akiranya opened this issue Aug 31, 2021 · 4 comments · Fixed by #14
Closed

Suggestion: Localized item display names #11

Akiranya opened this issue Aug 31, 2021 · 4 comments · Fixed by #14
Assignees
Labels
enhancement New feature or request

Comments

@Akiranya
Copy link
Contributor

Akiranya commented Aug 31, 2021

Hi there!

I'm here again to come up with a suggestion ;)

As the title. Currently the resource information on the town/nation's screen is only in English:

Resources:
Daily Production: 64 Oak Log, 32 Emerald
Available For Collection: 64 Oak Log, 32 Emerald

I am not a native speaker and unfortunately not all players in my server can read the English names of all materials.

So the localized resource display names would really help those players :D

I am also a plugin developer and fortunately the easiest solution is to use a plugin called "LanguageUtils" to do the translation automatically. Here is the repo: https://github.com/NyaaCat/LanguageUtils and here is the usage example: https://github.com/MascusJeoraly/LangUtilsExample

@Akiranya Akiranya changed the title Suggestion: Localized item display name Suggestion: Localized item display names Aug 31, 2021
@Goosius1 Goosius1 added the enhancement New feature or request label Aug 31, 2021
@Goosius1 Goosius1 self-assigned this Aug 31, 2021
@Goosius1
Copy link
Collaborator

Goosius1 commented Sep 1, 2021

Hi, this library is great!, but I have some questions about it:

  1. For servers to get this to work, will they have to drop the jar into their plugin folders?
  2. Or should maven just pull it in?
  3. Or should I build it inside TownyResources ?
  4. If 3 .... then can the size be reduced?. It is currently 4 megabytes, which is almost twice as large as Towny

@Akiranya
Copy link
Contributor Author

Akiranya commented Sep 1, 2021

  1. Yes they do
  2. Need to add it to maven pom.xml of this project as a dependency so that IDE can recognise it and TownyResources can be compiled
  3. No. It's a plugin and it doesn't need to be shaded it into TownyResources to make a "fat" jar. If implemented smartly, only those who need this feature have to put LanguageUtil jar into their plugin folder.

As a developer, I understand that we always want a slim jar instead of fat one and want to reduce the extra stuff that a server admin has to install on their servers as much as possible. Making something optional really optional is always the best decision :)

I think there are basically two cases for this feature:

  1. The server admin and their players are mainly English native speakers and they dont need this feature at all
  2. The server admin and their players are NOT mainly English native speakers and they need this feature (like the players on my server)

My recommedation would be: If the server admin has put the LanguageUtil jar into their plugin folder, then TownyResources will use LanguageUtils to get the display names of materials. Otherwise, TownyResources will just directly get the display names.

If this feature were implemented this way, then those who want this feature could simply install LanguageUtils and those who don't could simlpy use the TownyResource the way as before.

@Goosius1
Copy link
Collaborator

Goosius1 commented Sep 1, 2021

Ok I think I get it, thanks for the info!. We'll go with your recommendation, makes sense!

@Goosius1
Copy link
Collaborator

Goosius1 commented Sep 1, 2021

Nearly done...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants