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
Addon titles and descriptions made translatable #4984
Conversation
Modified the `translation` tag in the addon structure and made the translated names shown in the corresponding locale on the client side. See the related pull-request for more information.
It's needed for the stored translation info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the server-side changes and some of the backend client-side changes. The UI parts touch on stuff that's a bit beyond my area of expertise at the moment.
Suggested by @shikadiqueen in the review.
I think I made all the requested changes. Also tested them with my pet server, everything looks fine so far. |
One of the travis jobs is failing: https://travis-ci.com/github/wesnoth/wesnoth/jobs/358117144#L707 |
(Hopefully)
Fixed it, @Pentarctagon. |
Changed the pointers to references where possible. Some variable type fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick read-over since Iris already did a fuller review. Everything looks alright.
Backport of wesnoth#4984 to 1.14
Backport of #4984 to 1.14
Addon titles and descriptions made translatable
Hello, wesnoth devs!
The international wesnoth players had long been troubled by not being able to see what the addon is about without installing it or using external tools. So I decided to make it possible to see addon titles and descriptions in the addon manager.
I've done through
[translation]
tag modification because sending .mo file for the entire campaign is unnecesearily, and .mo and .po workflow just for .pbl file is redundant.The feature is done on the
master
branch, but I'd like backporting it to 1.14 in after it's tested.The original tag contains only the
language
attribute, the new one has the following structure. (If the declaration is abscent, but the .mo file is present, it'll be added withsupported=yes
attribute.):To upload the description translation insert it into the .pbl file.
The example .pbl file
Notice: My testing addon also has a .mo file for the Japanese translation which isn't declared in this file. But you'll see it in the server database with
supported=yes
.The deal with the
supported
attribute is to protect against an edge case when the translation is declared without the .mo file (as pointed out by Iris (@shikadiqueen) and against duplicate translations.The server stores the addon info as usual except for the appended
translation
tags.The server.cfg from my testing addon server
The client side will check if the translation exists for the current locale and will use the translated title (the original title is shown slightly below the title for players who had known the addon by the English name) and the translated description in that case.
Also, I made possible to search both for the original and the translated strings in the manager.
Demos
Pictures
The changes are fully backwards compatible with the old server/client.
Addons on my pet server.
Chinese translation is rendered fine too.
Uploadable addons are also translated and the search is possible.
Known issue
The addon's name may not be fully shown in the dependecies window if it's very long. (According to Iris and Vultraz, its the fault of the gui even without the translation, so it belongs to another issue).