The multilingual

You can have the string resources as an asset data .

This system can change string resources depending on your application locale.

However , it is not essential on the window system .

When creating an asset data of the character data , using the MS-Excel.

We have prepared the tool for outputting binary data for the resource data from the Excel data.

C# Object for using the output data is are prepared as follows.

  • CMessageDataSheetMgr

  • CMessageDataSheet

The excel format of string resources

The excel file format is shown in the following figure .

_images/messagedata.png

[ORIGIN]

It parses the data on the basis of the column named [ORIGIN].

It is necessary to place it on the location where the data begins.

The same line as the [ORIGIN] will be commented. It does not affect the data output .

[D],[R]

[D] [R] of the B4 columns and C4 column select to whether or not to output data for what the version. When individual column is blank , that line will suppress the data output.

  • [D] is the debug version

  • [R] is the release version

Character of D and R can be set freely. Whether or not to output any data by the argument can be selected. If you want to add new version, add the line.

ID

ID of D3 column is specify the string resource ID by the MulID.[D][R] of D4 represents that it is necessary for both the debug version and release version.

Since access to the character resources using the ID,It is required for all versions.

JP,EN

E3, F3 column of JP, EN is the locale name of string resources. Data is output as follows .

  • messagedata.JP.bin

  • messagedata.EN.bin

You can add any columns.

When your application locale is JP,[D][R] of E4 represents to outputting E column’s data in both the release and debug.

On the other hand , [D] of F4 represents to outputting in the debug version only.

Sheet name [WNDW]

Sheet names are encoded in FiveCC.

There is a need to put the sheet name of up to 5 alphanumeric characters .

You can access the string resource by the argument of the sheet name and ID.

How to convert from Excel data to string resource data

You can use messagedata.exe or messagedata.py.

Installation please refer to here .

This converter is written in python (2.6 or later) .

It has imported the openpyxl to read Excel data .

If you want to convert to the exe file from this python script , You are possible to use the pyinstaller.

[ How to Use ] messagedata.exe or messagedata.py

messagedata [-v version] Excel file name [output file name]

  • -v version

It outputs the data of the string set in version. By default, it has become D.

  • Excel file name

Specify the Excel file .

  • output file name

When it is omitted , it generates from the Excel file name .

messagedata -v R messagedata.xlsx caption

output file names:
  messagedata.JP.bin
  messagedata.EN.bin
  etc

Asset bundling

This is the procedure of asset bundling that is provided as standard .

There is also a method which load a data as binary.

Select the [Tools]->[KsSoft]->[Export Binary Data] from the menu.

_images/exportbinary.png

If you want to add the locale data, add in the KsSoftConfig .