thcrap icon indicating copy to clipboard operation
thcrap copied to clipboard

Translation coverage/progress bars in GUI

Open mokou opened this issue 10 years ago • 2 comments

When we get a GUI and we have thpatch 2.0 non-mediawiki edition, display the progress bars based on the information served from thpatch.net

mokou avatar May 01 '15 06:05 mokou

Basically, you would simply count the number of "translation units" in every file for both the base patch (the Japanese translation in most cases) and the patch in question, then merge both into one file.

Here's some basic code I wrote a year ago to do just that, so this would only need three more things:

  • The possibility to override the expected value for a specific file. Useful for translations that do not want to cover a specific area, or that don't replace all content (British English comes to mind).
  • A nice way of visualizing these values on both Touhou Patch Center and the future GUI. Something like percentage bars arranged in a hierarchical tree view for all the games and their directories to show accurate numbers for every level. And, of course, localized labels for the file names to have nicer descriptions of content ("st01a.msg.jdiff" → "Stage 1 [Reimu A]").

nmlgc avatar May 01 '15 17:05 nmlgc

Updated the code to actually work. To use it:

  • Make sure you downloaded the Japanese patch, or any other patch with 100% coverage, for the game(s) you want to test.
  • Calculate the base values:
python progress.py path/to/thpatch/lang_ja
  • Calculate the values of the patch you want to test (lang_fr in this example):
python progress.py --base path/to/thpatch/lang_ja path/to/thpatch/lang_fr
  • Running the script creates a file named stats.js in the root directory of the patch you run it on.

nmlgc avatar Jul 20 '17 21:07 nmlgc