poooi / plugin-translator

Translate package into English
MIT License
0 stars 7 forks source link

On getting data from KC Wikia #14

Closed gakada closed 6 years ago

gakada commented 6 years ago

Hello, I've noticed that this plugin gets its data from KC Wikia by parsing front-end pages. The core data is actually stored in a Lua backend, I have a script that uses MediaWiki API to enumerate those Lua pages and converts them to JSON, so maybe that JSON can be used? Alternatively, there is also https://github.com/KC3Kai/kc3-translations.

KagamiChan commented 6 years ago

I did notice the existence of these data, but fetching them and executing them in lua vm is also complex. By far we only have some difficulties with enemy ship suffixes which needs monkey patch (but we're all doing the similar thing), so I'm not thinking of changing the code.

gakada commented 6 years ago

Well, I'm already converting all that Lua to JSON, the script if fairly simple (something like 100 lines of JS and 50 lines of Lua). I will see if I can generate JSON files just for names, identical to those used in this project, because right now some translations are missing (since some front-end pages are always behind).

Also, can the quests be translated? I see that if I just add translations in the file it somewhat conflicts with the quest plugin (it only adds some translations in tooltips).

KagamiChan commented 6 years ago

IMO since the wikia pages are generated from the backend database, the time lag between these two is not huge. The major factor here is the plugin publishing frequency

For quests we're using JSON structures to store the requirements and rewards, see plugin-quest

gakada commented 6 years ago

It is usually not huge, except for (somewhat abandoned) enemy page, as it can take weeks (if not months) to update, like right now it was last updated in December.

I have plugin-quest installed, but it is

https://cdn.discordapp.com/attachments/176206906141048832/420335119463743498/u.png

(only English string here is one I added via this plugin).

KagamiChan commented 6 years ago

@gakada I realize you're mentioning quest name itself, since the quest name usually fails to imply what the quest is, I personally have no intention to translate them.

gakada commented 6 years ago

Yeah, in other viewers it is not exact translations, but quest codes (wikiwiki/etc.) and short descriptions, like on this screenshot, so you can see what it is without a tooltip.

KagamiChan commented 6 years ago

@gakada to add up the quest name translation could be too long to fit into the quest panel

gakada commented 6 years ago

Like, IMO D2d1: Complete 3 Expe... or Complete 3 Expeditions is better than just untranslated string.

gakada commented 6 years ago

Added _names files here, those are from backend, so should be updated more frequently.

gakada commented 6 years ago

Just realized that some quests have same titles, so replacing those kanji in interface can't be done in this plugin anyway.

gakada commented 6 years ago

Still, running this (have duplicates and missing many quests) gives u