Skip to content

Localization Support#279

Draft
AbbyRead wants to merge 36 commits intoChefZander:masterfrom
AbbyRead:localization-support
Draft

Localization Support#279
AbbyRead wants to merge 36 commits intoChefZander:masterfrom
AbbyRead:localization-support

Conversation

@AbbyRead
Copy link
Copy Markdown
Contributor

I've gone through the game looking for player-facing strings (item names/descriptions and chat messages mostly), and I've wrapped those in S() and PS() where applicable. I've also added locale directories and a script to create translation templates from all the occurrences of those wrappers.

@AbbyRead
Copy link
Copy Markdown
Contributor Author

I have this as a draft right now because I haven't actually added any translations, and because I haven't done anything yet about the questbook markdown content parsing.

Copy link
Copy Markdown
Contributor

@TheEt1234 TheEt1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure that you like doing these kinds of changes? this is a lot of repetitive work for not much in return imo

translations may make it harder to change sbz, and i don't know if it would be possible to verify if they are accurate/good

i think a bad translation < english, maybe i am biased

@@ -0,0 +1,413 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's literally just what gets generated by the gettext. I just had to get some sleep, so I left it that way for now.

if #new_desc > 1 then
for i = 2, #new_desc do
new_desc[i] = core.colorize("#777", new_desc[i])
if not new_desc[i]:find('\027') then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? and does this work properly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there were errors popping up because this was trying to colorize translated text that was already colorized. I sort of naively just made a condition to avoid doing that. This is an instance where I think you're right in that it's going to be somewhat more complicated to have translation support in the mix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there were errors popping up because this was trying to colorize translated text that was already colorized. I sort of naively just made a condition to avoid doing that.

oh, ok (i thought this was checking for checking if there are any translations and not coloring if there are)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, you can still color translated text. You kind of want to get as close as possible to the pure strings when you wrap with S() and PS() though, I believe. You can have translations with format specifiers embedded in them, but I imagine it can start to get weird and unnecessary at some point.

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
Copy link
Copy Markdown
Contributor

@TheEt1234 TheEt1234 Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i see its for all the files, you should probably change these comments idk translation stuff

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! I'll need to be a little careful though and reference the copyright mds.

@@ -1,3 +1,5 @@
local S = core.get_translator(core.get_current_modname())
Copy link
Copy Markdown
Contributor

@TheEt1234 TheEt1234 Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if you didn't touch sbz_logic or sbz_logic_devices as i would get lots of merge conflicts from this (im completely rewriting it)

but its fine, you can do it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. That makes sense.

@AbbyRead
Copy link
Copy Markdown
Contributor Author

are you sure that you like doing these kinds of changes? this is a lot of repetitive work for not much in return imo

translations may make it harder to change sbz, and i don't know if it would be possible to verify if they are accurate/good

i think a bad translation < english, maybe i am biased

Yeah, I'm sure. I imagine it's like those people who make ships in a bottle feel. It's so tedious and precise, and there's so little possible fanfare at the end of it that it seems like you'd have to be not right in the head to do it.

But I like it. I like knowing that I've contributed in a way that might not otherwise ever happen (or at least not to the degree I want to push toward). When I believe in something like this, I want other people to see it in its best light. Knowing that I've done everything I can is enough for me to be able to walk away and feel proud. Doesn't matter if other people see it. I see it.

That being said, there's still burn-out to contend with. If this were an actual job where I got paid and was expected to push through, I would have to. Like with the sound design that I'm taking a break from currently. But I have the luxury of largely choosing whatever I want to work on at any given time. So, I'm okay.

@AbbyRead
Copy link
Copy Markdown
Contributor Author

Regarding translation support being harder, I think it's just bitter medicine (like forcing Zander to learn git 😜). It's going to widen the player base though and make some of the existing players more comfortable.

This is largely just me virtue signaling at the moment, but I really do think localization and accessibility should be closer to the top in importance on all projects. I'd like to meet the challenge of it.

Verifying good translation will be difficult, but there are already methods of doing a first pass on that, like having anyone familiar with the language give it a once-over or translating it back to English with a translation engine and looking for stuff that sounds wacky.

I think as long as we're not intentionally or unintentionally making these translations as bad as they can possibly be though, we don't have a very high bar to cross. imo, it will be better to have something as opposed to nothing. If we don't even start, we aren't going to get people chiming in about fixes.

And so long as we get the process done thoroughly and thoughtfully enough, the fix shouldn't have to be "scrap the whole thing and start over". But if it is, that's something we'll learn from. And I would want to. Because I think it's important.

@ChefZander
Copy link
Copy Markdown
Owner

Maybe having a Weblate would be good as well? I've seen it on other projects.

@AbbyRead
Copy link
Copy Markdown
Contributor Author

Maybe having a Weblate would be good as well? I've seen it on other projects.

Like something to automatically create the translations as a continuous integration type of thing?

I don't want to do anything too hands off, but I'm not opposed to using generated translations as very-first step to touch up on and quality check thoroughly after.

@TheEt1234
Copy link
Copy Markdown
Contributor

idea: we could use weblate and codeberg https://translate.codeberg.org/

@TheEt1234
Copy link
Copy Markdown
Contributor

i like how the aes luanti server is listed first in there lol

@AbbyRead
Copy link
Copy Markdown
Contributor Author

Oh, so weblate is like an interface for contributing?

@TheEt1234
Copy link
Copy Markdown
Contributor

I think so

@AbbyRead
Copy link
Copy Markdown
Contributor Author

Super hot take, but I would prefer not leaving major languages mostly or entirely untranslated in hopes that some day someone comes along wanting to contribute anything. We have technology to speed things along to a point at which it can be of a serviceable quality, even if things here and there aren't 100% good or 100% accurate to what was intended in the source language.

I would absolutely love to have full translations by human beings with good firsthand knowledge of the to and from languages; I just don't know that we can expect that in every case. And I think it disenfranchises people worse to not have anything or just scraps here and there for months to years. The weblate interface looks great, but it sort of takes a stand about maintenance and quality assurance that we as developers on this project I don't think have all signed up for. We seem to like things pretty good.

Correct me if I'm wrong here. Because if we have the manpower and willingness to back up a serious attempt at QA on translations, I would be extatic. Otherwise, I would recommend we settle for as good as we can do with what people and resources are available to us (until more comes along later, hopefully).

AbbyRead added 10 commits March 27, 2026 15:54
Doing this because lots of stuff is moving and shifting over on frog's fork.
Doing this because lots of stuff is moving and shifting over on frog's fork.
Extracts parse_md_file as a private helper that returns quest data rather than registering it directly, making both easier to extend later.  It'll just fall back to English on missing file instead of crashing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants