Saints Row 2 JP Strings Tools v0.3 (Extracts and builds Japanese le_strings files)

Saints Row 2 JP Strings Tools v0.3
Created by nclok1405 ◆VScYHamhfU

This tool is based on the program codes from ThomasJepp.SaintsRow
Copyright (c) 2013-2016, Thomas Jepp
All rights reserved.
https://www.saintsrowmods.com/forum...saints-row-iv-and-gat-out-of-hell-tools.3188/
https://github.com/saintsrowmods/ThomasJepp.SaintsRow
Please see "ThomasJepp.SaintsRow license.txt" for more information.

Download: sr2jpstrtools_v0.3.zip

=== Description ===
This tool extracts and builds strings from Japanese language files of Saints Row 2.

ThomasJepp.SaintsRow.ExtractStrings.exe cannot properly extract Japanese strings because
Saints Row 2 uses its own Japanese encoding which doesn't match with anything like UTF-8 or Shift-JIS.

sr2_jp_character_table.tbl is the character mapping file used on extract and build of strings.
Unknown characters are decoded as \uXXXX, where XXXX are "code point" of the character.

To extract and build the string files follow the following steps:
1. Copy "static_JP.le_strings" to this tool's folder. "static_JP.le_strings" is available from Gentlemen of the Row's optional_mod_stuff\modified folder.
2. Double-click "sr2jpstrextract.exe". A file named "static_JP.txt" will be produced. (Alternatively, if you use "extract_sorted_static_JP.cmd" instead, you'll get a sorted version of the strings.)
3. To build a modified "static_JP.le_strings" from the "static_JP.txt", double-click sr2jpstrbuild.exe. (Use "build_sorted_static_JP.cmd" to produce the internally-CRC-sorted version)

To extract and build "voice_script_JP.le_strings" and "platform_PC_JP.le_strings" (both available from the same "modified" folder of GotR) you can use the provided *.cmd batch files.

Technical note: I used g++ compiler from MinGW 4.9.2 with the following options:
g++ -std=c++11 -Os -static -lstdc++ -lgcc -lwinpthread sr2jpstrextract.cpp
g++ -std=c++11 -Os -static -lstdc++ -lgcc -lwinpthread sr2jpstrbuild.cpp

=== Changelog ===
v0.3 (April 15, 2019)
* Added an ability to sort the strings as "-s" option for both tools. The sorting is based on the text tags for extraction and CRC for building. The internal order of the le_strings file will not be the same as the original, but as far as I can tell the game doesn't care about the internal strings order.
* Added a warning message about duplicated text tags when building a le_strings file.

v0.2.1 (April 15, 2019)
* Added all remaining Japanese characters to the table. (The executables are unchanged so they show v0.2 as the version)

v0.2 (January 26, 2019)
* Added text tags support.
* Slightly update the character table.

v0.1 (January 22, 2019)
* Initial Release

=== 日本語での説明 (Description in Japanese) ===
このツールはSaints Row 2の日本語言語ファイルからテキストの抽出・改造を行います。

Saints Row 2はUTF-8やShift-JIS等と異なる独自の日本語文字コード体系を用いており
ThomasJepp.SaintsRow.ExtractStrings.exeでは正常なテキストの抽出を行うことができません。

sr2_jp_character_table.tblは抽出時と改造時に使われる文字マッピングファイルです。
不明な文字は\uXXXXの形式で出力されます。このXXXXの部分に「文字番号」が入ります。

テキストの抽出と、改造したテキストデータを基に言語ファイルを作るには、以下の手順に従ってください:
1. 言語ファイル"static_JP.le_strings"をこのツールのフォルダにコピーしてください。"static_JP.le_strings"はGentlemen of the Row Modの optional_mod_stuff\modified ファルダにあります。
2. "sr2jpstrextract.exe"をダブルクリックしてください。"static_JP.txt"というファイルが作られます。("extract_sorted_static_JP.cmd"を使用した場合はソート済みのファイルが作られます)
3. 改造した"static_JP.txt"を基に、改造した"static_JP.le_strings"を作るには、"sr2jpstrbuild.exe"をダブルクリックしてください。("build_sorted_static_JP.cmd"を使用した場合は内部の文字列をCRC順でソートしたファイルが作られます)

"voice_script_JP.le_strings"と"platform_PC_JP.le_strings"を抽出・改造するには、同梱のcmdバッチファイル群を使ってください。どちらのle_stringsファイルも、GotRのmodifiedフォルダ内にあります。

技術的情報: このツールはMinGW 4.9.2のg++コンパイラで以下のコマンドラインオプションを使ってコンパイルしました。
g++ -std=c++11 -Os -static -lstdc++ -lgcc -lwinpthread sr2jpstrextract.cpp
g++ -std=c++11 -Os -static -lstdc++ -lgcc -lwinpthread sr2jpstrbuild.cpp

=== 更新履歴 ===
v0.3 (2019/04/15)
* 両方のツールにソート機能を追加しました(-s オプション)。抽出時はテキストタグ名、構築時はCRCを基準にソートしてファイルを作ります。le_strings内部の文字列の順番はオリジナルのものと同一にはなりませんが、私が試した限りではゲーム側は文字列の内部的な順番は特に気にしていないようです。
* le_stringsの構築時、同じテキストタグが複数見つかった場合は警告メッセージを出すようにしました。

v0.2.1 (2019/04/15)
* 文字マッピングファイルに残りの文字を追加 (実行ファイルは変化なしなので表示されるバージョンはv0.2のままです)

v0.2 (2019/01/26)
* 「テキストタグ」サポートを追加
* 文字マッピングファイルを少しアップデート

v0.1 (2019/01/22)
* 初リリース
 

Attachments

  • sr2jpstrtools_v0.1.zip
    750.4 KB · Views: 461
  • sr2jpstrtools_v0.2.zip
    799.9 KB · Views: 485
  • sr2jpstrtools_v0.2.1.zip
    800.3 KB · Views: 402
  • sr2jpstrtools_v0.3.zip
    830.2 KB · Views: 753
Last edited:
Back
Top