Author Topic: [Feature suggestion] (DONE) Translation Editor (Browser tool)  (Read 316 times)

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Okay, I'll start by saying that if I had the skills to do this, I would do it myself.
So I'm just putting the idea here, in case anyone with the skills, time and will, can do it.

Problem: As anyone who ever have dealt with translations knows, it's very easy to break the translation file. And fixing it again takes forever. So I thought that if we could eliminate the possibility of messing the original lines, then it would make both the translator and the dev really happy.  (nod)

Suggestion: Create an editor for trs files. External to AGS. Maybe call it AGSTRanslationEditor.exe (or AGSTRSEditor.exe). But it should be an exe that does not need AGSEditor or any AGS stuff. So in reallity it's just a program that can load and save text files with the extension trs.

Features:
- Load trs file
- Save trs file
- Spellcheck (optional if too complicated)
- Text display for original line - not editable!
- Text box to enter translated line.
- Button/Arrows for next and previous line.
- Eventually box to jump to line number. (like you have translated 200 out of 500 lines, just jump to line 200 and continue)
- Box/help displaying the trs warning about characters and such (optional)

That's about it. Basically just a text editor oriented specifically to handle a trs file.

Distribution: Packed with AGS Editor and as Standalone.
« Last Edit: 22 Jan 2020, 07:03 by Cassiebsg »
There are those who believe that life here began out there...

tzachs

  • Mittens Vassal
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    • tzachs worked on one or more games that won an AGS Award!
    •  
    • tzachs worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #1 on: 17 Jan 2020, 05:15 »
I made a small web app that I think meets most of your requirements: https://tzachshabtay.github.io/ags-trs-editor/

I never worked with trs files myself, and I guessed at the format, so if it doesn't work for you, send me your file so I can fix it.

Quote
- Box/help displaying the trs warning about characters and such (optional)
I didn't know what that means so I didn't do it.

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #2 on: 17 Jan 2020, 11:24 »
A web app sounds like a good idea, unfortunately I don't know how to use it.  :-[
When I follow you link all I get is a blue top bar with the name of the app, a load icon and the link to the source.
Rest of the page is just blank.  ???

Clicking the Load opens windows explorer and asks me to upload a file? I tried choosing a trs file but all I got was an empty page.
As for the source I woudn't even know where to begin to use it.

The text warning is the first few lines of any trs file.
Quote
// AGS TRANSLATION SOURCE FILE
// Format is alternating lines with original game text and replacement
// text. If you don't want to translate a line, just leave the following
// line blank. Lines starting with '//' are comments - DO NOT translate
// them. Special characters such as [ and %%s symbolise things within the
// game, so should be left in an appropriate place in the message.
//
// ** Translation settings are below
// ** Leave them as "DEFAULT" to use the game settings
// The normal font to use - DEFAULT or font number
//#NormalFont=DEFAULT
// The speech font to use - DEFAULT or font number
//#SpeechFont=DEFAULT
// Text direction - DEFAULT, LEFT or RIGHT
//#TextDirection=DEFAULT
// 
// ** REMEMBER, WRITE YOUR TRANSLATION IN THE EMPTY LINES, DO
// ** NOT CHANGE THE EXISTING TEXT.

Uhm, after posting this I just noticed something which I always assumed wasn't changeable. So going to do a few tests on the trs file.

As for the format for trs file is just a text in UTF-8 encoding.

If you need some trs to test (these are for the Indiana Jones and the relic of the Viking demo):

Original trs: https://www.mediafire.com/file/3vg9hz9uhkm5kha/New.trs/file

Trs with Italian translation: https://www.mediafire.com/file/5q05tlso7y2ji3b/ITA.trs/file

« Last Edit: 17 Jan 2020, 11:26 by Cassiebsg »
There are those who believe that life here began out there...

tzachs

  • Mittens Vassal
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    • tzachs worked on one or more games that won an AGS Award!
    •  
    • tzachs worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #3 on: 18 Jan 2020, 06:05 »
Thanks for the sample files, it should work now if you want to try again.

(Yes, you should click the load icon and select a trs file).

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #4 on: 18 Jan 2020, 10:57 »
Thanks, I can nos see "Please Load trs file".
But when I do load it, all I get is still an empty page. And I have set all scripts on.  :-\

Maybe it just doesn't work with my browser? Firefox 59.0.3 (64 Bits)
There are those who believe that life here began out there...

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #5 on: 18 Jan 2020, 11:18 »
Seems to work OK for me (Firefox 72.0.1). Click on the upload file cloud icon, select Cassie's trs, and it shows a list of all the original lines with the ability to enter translations.

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #6 on: 18 Jan 2020, 17:28 »
I decide to post it on the cog7 (Indiana Jones and the Seven Cities of Gold) forum to get feedback from those translating the demo.

Here's one comment (http://binarylegends.net/forum/index.php/topic,981.msg8509.html#msg8509)
Quote
The editor seems to work but I have one big feature request: I cannot search for strings in the whole file. I assume the web server streams the content, so searching is limited to the part which currently is transmitted. And line numbering would be great.
There are those who believe that life here began out there...

tzachs

  • Mittens Vassal
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    • tzachs worked on one or more games that won an AGS Award!
    •  
    • tzachs worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #7 on: 19 Jan 2020, 06:50 »
But when I do load it, all I get is still an empty page.
Hmm, can you try opening the console and see if there are any errors there?
https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console

Quote
The editor seems to work but I have one big feature request: I cannot search for strings in the whole file. I assume the web server streams the content, so searching is limited to the part which currently is transmitted. And line numbering would be great.
I added search and line numbering (there's currently a known issue though that if you search it screws up the navigation buttons, I'll fix that hopefully tomorrow).
Just as FYI: it's not that the web server is streaming the content, the client has all of the information, it just doesn't render it because that would be too slow, so the browser can't find it on its own.

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #8 on: 19 Jan 2020, 22:15 »
This error seems to be reported: TypeError: this.props.from.trimStart is not a function (23 errors of this kind)
The CSS pane also throws a bunch of errors:
- Unknown property ‘-moz-osx-font-smoothing’. Declaration dropped.
- Expected media feature name but found ‘prefers-reduced-motion’.
- Unknown property ‘flip’.  Declaration dropped.
- Expected media feature name but found ‘hover’.
- Error in parsing value for ‘animation’.  Declaration dropped.
- Error in parsing value for ‘animation-name’.  Declaration dropped.
- Unknown pseudo-class or pseudo-element ‘-webkit-input-placeholder’.  Ruleset ignored due to bad selector.
- Unknown pseudo-class or pseudo-element ‘-ms-input-placeholder’.  Ruleset ignored due to bad selector.
(others similar to the above)

But since it works for Snarky, it just means it doesn't like my old browser. Not your fault.  ;)
There are those who believe that life here began out there...

tzachs

  • Mittens Vassal
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    • tzachs worked on one or more games that won an AGS Award!
    •  
    • tzachs worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #9 on: 21 Jan 2020, 03:30 »
Quote
This error seems to be reported: TypeError: this.props.from.trimStart is not a function (23 errors of this kind)
Ah, seems trimStart was only introduced in Firefox 61. I fixed it (and I downloaded firefox 59 to see that it works on it after the fix).
I also fixed the other issue I mentioned before.

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #10 on: 21 Jan 2020, 11:51 »
Oh, cool! It works now!  :-D
Sorry that I use an old browser... but it's like every time Firefox updates the browser they ruin something I love in it and take control from me to their own automatic crap. And I don't like relinquishing certain things.

Edit:
I do feel this text should be added somewhere:
- If you don't want to translate a line, just leave the following line blank.
- Lines starting with '//' are comments - DO NOT translate them.
- Special characters such as [ and %%s symbolise things within the game, so should be left in an appropriate place in the message.

Maybe they could be added  in the empty space after the search box? Or maybe under the buttons in the blue frame? Or a frame for it self at the top?

But also, very cool that it runs on the browser, since I have spell check on my browser, that solves that problem (at least for me, no idea how spell checking works in other browsers).  :-D

So, from my original request, the only thing missing is the ability to jump to a line, by typing 808 and jumping to line 808.
Thanks again for doing it, I can see a lot of devs and translators being happy with the tool and saving them countless hours of headache trying to find that character that ruined the formating by accident.  (nod)

Edit2:
I tried and saved the file, to compile it. It saves as ags.trs, maybe it could ask to enter file name? Not a big deal though. it's easy to change the file name afterwards.
Also noted it adds an empty line at the top of the file. I tested compiling it with the empty line and the translation seems to work fine with it. So not a big deal, if it's too much work to remove it.

Again, super work! Maybe ready to be posted for others in here to know and start using it?  (not sure how many read the Engine Development forum).
« Last Edit: 21 Jan 2020, 13:42 by Cassiebsg »
There are those who believe that life here began out there...

tzachs

  • Mittens Vassal
  • AGS Baker
  • Parking Goat- games that goats like!
    • I can help with translating
    • tzachs worked on one or more games that won an AGS Award!
    •  
    • tzachs worked on one or more games that was nominated for an AGS Award!
Re: [Feature suggestion] Translation Editor (Standalone exe)
« Reply #11 on: 22 Jan 2020, 05:20 »
Sorry that I use an old browser... but it's like every time Firefox updates the browser they ruin something I love in it and take control from me to their own automatic crap. And I don't like relinquishing certain things.
I figured it was something like that. But actually it's not that old, March 2018 is still reasonable, I feel.

I do feel this text should be added somewhere:
- If you don't want to translate a line, just leave the following line blank.
- Lines starting with '//' are comments - DO NOT translate them.
- Special characters such as [ and %%s symbolise things within the game, so should be left in an appropriate place in the message.
Ok, added the text, with the exception of the comments line. I think it's irrelevant in the context of the editor, the comments will not be displayed so you won't be able to edit them either way.

But also, very cool that it runs on the browser, since I have spell check on my browser, that solves that problem (at least for me, no idea how spell checking works in other browsers).  :-D
Yes, that's one of the reasons I figured web would be a good fit (also undo/redo without effort). The spellcheck kind-of-works on chrome, but it's a hit or miss.
Also not sure how the spellcheck works for other languages which are not in your browser's preference. It might be possible to improve the experience (maybe there could be a language selector that sets the spellcheck for that language or something like that - I don't know if that will help).

So, from my original request, the only thing missing is the ability to jump to a line, by typing 808 and jumping to line 808.
Added.

Thanks again for doing it, I can see a lot of devs and translators being happy with the tool and saving them countless hours of headache trying to find that character that ruined the formating by accident.  (nod)
:)


I tried and saved the file, to compile it. It saves as ags.trs, maybe it could ask to enter file name? Not a big deal though. it's easy to change the file name afterwards.
This depends on the browser. Chrome does ask you to enter a filename.

Also noted it adds an empty line at the top of the file. I tested compiling it with the empty line and the translation seems to work fine with it. So not a big deal, if it's too much work to remove it.
Fixed.

Again, super work! Maybe ready to be posted for others in here to know and start using it?  (not sure how many read the Engine Development forum).
Thanks! And feel free to spread the news!

1. This is super cool!

2. I don't know in the forums where to post tools (since they aren't modules or plug-ins), but am curious about it too!
« Last Edit: 22 Jan 2020, 10:43 by eri0o »