Fate/stay night:Translate scripted files

From Baka-Tsuki
Revision as of 16:21, 4 July 2010 by Bejarid (talk | contribs) (erratum)
Jump to navigation Jump to search

Introduction

This program is make for manipulate scripted files of FSN and make easier the translation.

With it you can:

  • Clean a .ks file from all marks and scripts;
  • Clean a .ks file only from word-wrap marks;
  • Clean a .ks file only from voices scripts;
  • Clean a .ks file only from comments;
  • Replace "double quote" by « French quotation mark »;
  • Redo only word-wrap marks on a cleaned .ks file;
  • Redo marks and scripts on a cleaned .ks file;


  • Clean all .ks files of a directory from all marks and scripts;
  • Clean all .ks files of a directory from voices scripts;
  • Redo marks and scripts on all files in a directory;
  • Word-count all files in a directory.


This program was already use for translate several days in the French version with success.


How to use

Installation

I wrote this program with .Net 4.0 Client Profile so you need Windows (XP or superior) and the .Net Framework up-to-date on your PC. You can download it manually from Microsoft Official Website (41Mo) if you don't use Windows Update.

This tiny program don't need any installation to work, it's just automatically create a configuration file in your %USER%/AppData directory if it can (it's not required for work however).


Clean and Rescript .ks files for translate

The main purpose of this program is for make easy the translation of texts of FSN.

To do so, you have to clean the scripted .ks files of FSN. For that, extract an "original version" of the "scenario" directory of FSN (you can use the Mirror-moon's english version and extract it from patchX) from .xp3 files. To do that, you can use Insani's Extract tool. Or use the example archive at the end of this page.


I will name the extracted directory "Scripted VA" in my example and click on "Clean a directory from All". Select the directory "Scripted VA", click on OK, and create a new directory, in my example I name it "Cleaned VF". Now, you have a directory "Cleaned VF" cleaned from script, and you can translate it directly (but before that take a look at the Tips) and an original Scripted version that you will use later.


So, after the translation you have to rescript all translated files for, after that, reimport them in the game (with the Insani's Repack tool).

To do so, click on "Script a directory" and select the directory "Cleaned VF" as the translated directory, the directory "Scripted VA" as the original directory, and create a new directory, "Scripted VF" in my example.


With some file, you will have an error somewhat the file don't have the same number of lines... Even if it's the rights files! Why? Because the english version of mirrormoon have some trouble with white space in begin of line. Sometime, the white spaces aren't there even if it should be. That will make my soft forget these lines (even if the game can accept that).

So, you have a function "Add Blank Space to a file" for make up this problem, this add white space to the line of text who don't have one. When the "Script a directory" function have an error, it suggest you to use this function on the file in error. Click on Yes and if it have resolve the problem, it will continue. If not, send me the file, I will take a look.


After that, you have your new directory full of scripted translated files, ready to import in the game!

You can also make a unvoiced version of your translation by using the "Clean a directory from Voices", it work exactly like "Clean a directory from All" and should work with the unvoiced installation of Mirror-moon (not really tested yet).

Specifics operations on .ks files

Firstly you have to open a .ks file, for it go in "File" menu and click on "Open".


Now you have several choices:

  • You can clean only one .ks file from all marks and scripts (except some ones, used for Rescript function) for make it more readable.
For that, click on "Edit" -> "Clean a file from All".
  • You can clean a .ks file from word-wrap marks only ([wrap text="..."]) and keep scripts and others of the file. It can be usefull if a file can't be rescripted for some reasons.
For that, click on "Edit" -> "Clean a file from Word-Wrap".
  • You can clean a .ks file from [l][r] tags only and keep scripts and others of the file. It can be usefull if a file can't be rescripted for some reasons.
For that, click on "Edit" -> "Clean a file from LR".
  • You can clean a .ks file from voice scripts only ("@say ...") for make an un-voiced version of your script.
For that, click on "Edit" -> "Clean a file from Voices".
  • You can clean a .ks file from comment only ("// ...").
For that, click on "Edit" -> "Clean a file from Comment".
  • You can add Word-Wrap to the text of a .ks file. It should be use after the "Clean a file from Word-Wrap" function, after you have translate the text. After that, you can import the file in game.
For that, click on "Edit" -> "Add word-wrap to a file".
  • You can add [l][r] tags to the text of a .ks file. It should be use after the "Clean a file from LR" function, after you have translate the text. After that, you can import the file in game.
For that, click on "Edit" -> "Add LR to a file".
  • You can replace the "english quotation mark" by the « french quotation mark ». It should be use on a cleaned file before any rescripting or word-wrapping. After that, you can use it like a standard cleaned file.
For that, click on "Edit" -> "Replace Double Quote by French Quotation Mark".
  • You can add Script and Word-Wrap to the text of a .ks file. It should be use after the "Clean a file from All" function, after you have translate the text. After that, you can import the file in game.
For that, click on "Edit" -> "Add Word-Wrap and Script to a cleaned file".


  • You also have a function for word-count all files in a directory (and its sub-directories). It will not count script or line without word (like "-----" or "...").
For that, click on "Directory" -> "Word-Count a Directory" and select the directory of your choice.


If you have any question, request or bug, please PM me on the baka-tsuki forum.

--Bejarid 22:22, 22 March 2009 (UTC)


Tips

In end of line, the [l] mark is to make a pause (until player press a button to have the next line) and the [r] mark is to make a new line.

This two is use together the most of time, but you can use only one of them, for exemple the [r] mark is usefull to make a better presentation for a quotation.


By default this software use the Unicode encoding for open and save KS files, the same the english version use and the one required for the game to work on non japanese Windows, but the original game and the trial (who need AppLocal to work on a occidental Windows) use the Shift-JIS encoding.

You can open and save files with this japanese encoding by adding the following lines in the "user.config" file that you can found in the %USER%/AppData/BakaTsuki/FSNCleaner[something]/3.X.0.0 folder.

  • For opening
 <setting name="OpenEncoding" serializeAs="String">
   <value>Shift-JIS</value>
 </setting>
  • For saving
 <setting name="SaveEncoding" serializeAs="String">
   <value>Shift-JIS</value>
 </setting>

Just delete the lines, or replace the value by "Unicode", for return to the Unicode encoding.

Change log

V1.X : Developpement releases.

V2.0 : Initial release with Clean & Rescript functions.
V2.1 : Add function for French quotation marks.
V2.2 : Resolve a bug on Drag & Drop.
V2.3 : Increase performance for display large text files, and for Rescript functions.
V2.4 : Resolve a bug on "Add LR" function (and Rescript functions) when the file don't finish by a transistion page (for example, the first file of day1).
V2.5 : Add function for word-count a directory.
V2.8+ : On CodePlex.

Download links

Direct Download on CodePlex : Executable | Example | Source code