The Dink Network

How to translate Dink Smallwood into Chinese

January 27th, 10:14 AM
fish.gif
EMP
Peasant He/Him China
 
This is my fist time to log in and speak in the form.I am a Dink fan from China.My English is not good so my words may have a lot of mistakes.Thank you for your listening.
I played this excellent game for the first time ten years ago,and I was absolutely absorbed in it.At that time I did not know English at all,which thoubles me a lot.And I did not understand Dink's adventure at all.That's a pity.
Three years ago I discovered Dink Network,and I download many D-modes.I want to recommend this game to others but it was in English.
Now as a freshman in college,I want to realise one of my childhood dreams-help Dink Smallwood have a Chinese edition.I have a 20 day vocation to do it.After that I have to back to school but I won't give up.I find this community is friendly so I post a message to ask for help.
I open the DinkSmallwoodHD\dink\story and found .c and .d,and I change .c from

void main(void)
{

}

void talk(void)
{
if (&story >= 3)
{
say("Mom's bed is on fire, noooo!", 1);
return;
}
say("Mom's bed.", 1);
}

void hit(void)
{
if (&story >= 3)
{
say("No it's too hot.", 1);
return;
}
say("Eat this, bed!", 1);
}

to

void main(void)
{

}

void talk(void)
{
if (&story >= 3)
{
say("妈妈的床着火了,不!!", 1);
return;
}
say("妈妈的床", 1);
}

void hit(void)
{
if (&story >= 3)
{
say("不,太热了", 1);
return;
}
say("尝尝这个", 1);
}

but it dosen't matter.And I opened a .d file: ido�v�{�;���
How to Change the display into Chinese?I will appreciate it if you can give me some advice.And please tell me how to post the picture on this website so I can covey more clearly.
Thank you
谢谢
January 27th, 12:21 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
The easiest way to do a translation would be to use the resources provided by the Translation Project on their Dink page. This allows you to download the "pot" file and change all the in-game strings in one big file, rather than going through each and every script. This way, the translation becomes automatic for Freedink users without them having to download anything extra, and if you choose to license it in the Public Domain or similar, Seth would be able to use it too.

If you want to do it script-by-script for whatever reason, the original uncompressed .c scripts are available in the "develop" folder if you download 1.08 or earlier versions, or by downloading the Freedink data package. It may be the case that the in-game font won't support Chinese characters though, and they may display as squares.

The only way to post a picture here is to upload onto an external image-hosting site and then link it here.
January 27th, 11:05 PM
fish.gif
EMP
Peasant He/Him China
 
Thank you for your reply!T will get a deeper understand and try it in the following days
January 28th, 05:15 AM
dinkdead.gif
Sounds like a great project, hope it works

Just a thought, I wonder if the encoding of the .c files have to be changed in order to get the characters to show up correctly in Dink? Not sure if it makes a difference.

I have done some work with Japanese text and it won't show up properly in programs like Notepad or Excel unless the encoding is changed to SHIFT-JIS instead of the default Windows-1252/UTF/ASCII/whatever.

Don't know what the default is for Chinese, but I assume it's the default on your PC anyway which might make it easier to convert the original scripts if necessary.
January 28th, 05:25 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
No, it all comes down to the font, which in the case of Freedink (Liberation Sans) only shows up as squares. I have no idea what Seth uses and if it has the necessary glyphs or not. If you were to change the encoding, the file wouldn't be read at all.
January 28th, 05:53 AM
dinkdead.gif
Hmm. Would need to change the font in that case (can't remember the command offhand) but that's tricky if you need to do it for the original game and not a D-Mod...
January 28th, 07:49 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
Initfont is finnicky at the best of times and works differently between Freedink and other Dinks, and even changes its behaviour across operating systems to the point where I wouldn't consider it a worthwhile proposal. Yeoldedink natively supports changing the typeface, and seems to work okay with Noto Sans SC except for the fact it looks somewhat awful, albeit tolerable enough. Unfortunately there are few typefaces that have all the Unicode glyph sets that are halfway-decent to look at and even fewer that would fit well in Dink.
January 29th, 05:21 AM
dinkdead.gif
"Initfont is finnicky at the best of times and works differently between Freedink and other Dinks, and even changes its behaviour across operating systems to the point where I wouldn't consider it a worthwhile proposal."

Not good news... I was planning on using this in my D-Mod to have different fonts for certain characters.

Is there at least a way to use it safely so that it falls back to the default font instead of just showing squares or something, in the case where a font's not supported?

(Sorry for the slight thread hijack)
January 29th, 07:57 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
Of the three major Dinks, only <=1.08 and Freedink actually support initfont in any capacity, as Seth appears to use the RTFONT loader that is part of ProtonSDK. After briefly searching the 1.07 source and looking past the commented-out references to Comic Sans MS, it appears to use CreateFontIndirect which will search for system-installed fonts and may substitute one from the same family if what's specified can't be located.

Freedink on the other hand, searches for typefaces in multiple ways. On Windows, it will search through the system fonts path and append .ttf to your initfont invocation without performing the substitution that CreateFontIndirect might, so as to directly find an exact matching TTF path. Otherwise, on other operating systems, it uses Fontconfig which will scan through its font cache of system-installed fonts and find the closest matching typeface, and will perform substitution or pick a random one if you specify a font family in your invocation, not dissimilar to CreateFontIndirect in its lenience. Beuc had Fontconfig switched off for Windows builds, but even with it on, it appears to be set to never trigger on Windows, with specific system path searching the only thing available there.

Anyway, after looking at all of this I will make the next release of yeoldedink enable Fontconfig lookups on Windows as well as look alongside map.dat etc for ttf files, as that's always how I assumed it should be implemented, rather than trying to get users to install TTFs. A failed initfont invocation just won't do anything and will leave everything as it is.
January 29th, 09:24 AM
dinkdead.gif
Ok... bear with me here. So, in short, is this correct:

If the font is correctly installed as a system font, it should work fine.
If it's not installed, behaviour varies, it might pick a similar one or it might just use the default, either way nothing will break.

It will never look in the D-Mod folder for the font.

The above only applies to <=1.08 and Freedink.

On DinkHD, it doesn't do anything? No idea how system fonts even work on Android/iOS...
January 29th, 10:48 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
As an example, I have Liberation Sans installed properly in the font database. If it's not installed in the system font database, nothing happens. If I were to run initfont("Liberation Sans") on GNU/Linux or macOS it will search for it using Fontconfig and load it through its database. If it can't find Liberation Sans, it may substitute Open Sans, or another sans serif typeface. The same invocation would fail on Windows as the filename of it that I have here is LiberationSans-Regular.ttf in which case initfont("LiberationSans-Regular") would have to be used to achieve the same effect there, and won't ever perform substitution. This invocation would probably also work on GNU/Linux and macOS as Fontconfig is fairly smart. If someone had a different release of Liberation Sans that they'd installed on Windows which had a different filename such as "Liberation-Sans.ttf", it would fail completely, but might be substituted on GNU/Linux or macOS.

I have no idea what 1.08 would do in regards to name vs file and haven't touched it in years, but the reference suggests name instead of file suggesting the first invocation would be suitable there. Ultimately you're going to have to test it out and see what works and what doesn't, check debug.txt etc. Do keep in mind that only TTFs will work, no OTFs, and that bold will be automatically applied to anything you load.

As you can see, there's a reason why nobody uses initfont as anything more than a minor optional graphical enhancement, such as in Slipdink's Crowns of Stone.
January 31st, 08:17 PM
fish.gif
EMP
Peasant He/Him China
 
I found someone had done translate work in version 1.08.He translated dink smallwood v1.08 and Mystery Island.
Chinese idition
February 2nd, 03:28 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
I tried downloading but don't have the necessary Baidu account to do so. I'd be curious to find out what's in there, as the screenshots depict a DOSBox fork being used to run it, despite Dink being developed for Windows...
February 2nd, 05:25 AM
fish.gif
EMP
Peasant He/Him China
 
This is what Baidu is.I also think Baidu is unconvinent.It has special download channel and indicate to buy VIP .And the dinknet seems cannot post screenshot or files.If you recommend another network to post file,I will try to post this Chinese idition on it.
February 2nd, 06:14 AM
death.gif
RangerLord
Peasant He/Him Hungary bloop
The nation above all 
I guess you could upload it as a file. From the TDN menu: Contribute -> New file.
February 2nd, 06:55 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
I would suggest the same except that some of those files are gigantic and might be too large for the form, though it's worth an attempt anyway. I suspect the translator has made a full Windows 95 environment in DOSBox as the distribution method here.
February 2nd, 12:18 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
I tried downloading but don't have the necessary Baidu account to do so. I'd be curious to find out what's in there, as the screenshots depict a DOSBox fork being used to run it, despite Dink being developed for Windows...

It is possible to install Windows 3.1/95/98 into DOSBox btw but it works with specific forks.

Dare i say DOSBox Staging is the best one next to DOSBox-X
February 3rd, 04:48 AM
fish.gif
EMP
Peasant He/Him China
 
thank your tips.I have posted files on it. please wait