Jump to content

Recommended Posts

On 9/29/2025 at 1:36 PM, seraph780 said:

How would I go about adding a setting to change my mod's language to a different one? I'm not too sure where I'd put the translations for things like the select screen or item names, and what else I might need to add to make it show up

I was able to find an easy way to translate my mod, but I now have a weird problem 😕

ST1.png.9e3dadac9e04cecddd483da889cba883.png

Everything that has a string in modmain.lua is set up like this, and while it worked for 99% of my mod's text, it's specifically the quotes that for some reason just don't appear

ST2.png.1e07b22fa6b775bc5af519e756c31053.pngST3.png.02e711535b04e34a2c885aa4bfee2341.png

Side by side of my mod's selection screen vs wormwood

What's going on here?

2 minutes ago, seraph780 said:

Nope, the quote is still invisible on the select screen

Maybe that font doesn't support those characters. Do you know if there's a mod that supports that type of characters in that specific part?

3 minutes ago, DSTUser said:

Is that Sebastian solace from the hit game roblox pressure

yes........... 😛😛

1 minute ago, FerniFrenito said:

Maybe that font doesn't support those characters. Do you know if there's a mod that supports that type of characters in that specific part?

I know the quotes for chinese mods work, but for some reason it won't work for me 😥

7 minutes ago, seraph780 said:

yes........... 😛😛

I know the quotes for chinese mods work, but for some reason it won't work for me 😥

If the text still isn't displayed when you remove the quotes, I assume it's not a problem with the quotes, but with the text. Normally, when a font doesn't support a character, it uses "?" or its "id," so to speak, to simplify matters. However, since "Don't Starve Together" doesn't use fonts, but rather bitmaps, when it doesn't find a character, it may just display an empty box.

I'm analyzing mods that have Chinese characters to see what could be going on.

  • Like 1

Putting this here for other people:

The way I added another language to my mod is first by going to modinfo.lua and writing

configuration_options = {
	{
		name = "setting_name",
		label = "Language1/Language2",
		options = {
			{description = "EN", data = 1},
			{description = "JP", data = 0},
		},
		default = 1, --Defaults to English
	},

}

Then, in modmain.lua below "Assets" and above the select screen strings: TUNING.SETTING_NAME = GetModConfigData("setting_name")

For the text you want to translate, you would do something like this (example from my code):

-- The character select screen lines
if TUNING.SOLACELANG == 1 then
STRINGS.CHARACTER_TITLES.solace = "The Saboteur"
STRINGS.CHARACTER_NAMES.solace = "Sebastian Solace"
STRINGS.CHARACTER_DESCRIPTIONS.solace = "*Urbanshade experiment\n*Merchant\n*Strained"
STRINGS.CHARACTER_QUOTES.solace = "\"Stock up while you can.\""
STRINGS.CHARACTER_SURVIVABILITY.solace = "Slim"
else
STRINGS.CHARACTER_TITLES.solace = "妨業員"
STRINGS.CHARACTER_NAMES.solace = "セバスチャン ソラス"
STRINGS.CHARACTER_DESCRIPTIONS.solace = "*アーバンシェードの人体実験\n*商人\n*緊張"
STRINGS.CHARACTER_QUOTES.solace = "\"できるうちに\n買いだめしておきましょ。\""
STRINGS.CHARACTER_SURVIVABILITY.solace = "スリム"
end

Where you put "if TUNING.SETTING_NAME == 1 then

(Language 1 strings here)

else

(Language 2 strings here)

end

To translate speech lines, just make a copy of your already existing one and add your translations, then in modmain.lua just call that file like this:

-- Custom speech strings
if TUNING.SETTING_NAME == 1 then
STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_your_character"
else
STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_your_character_language2"
end

 

(Found out with the help of FerniFrenito):

If you get a similar error with the quotes where it doesn't show up, add a line break or space somewhere in your string (Like\nthis)

--Quote won't appear because it's too long
STRINGS.CHARACTER_QUOTES.solace = "\"できるうちに買いだめしておきました。\""

--Quote now shows up
STRINGS.CHARACTER_QUOTES.solace = "\"できるうちに\n買いだめしておきましょ。\""

 

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...