-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace current CSV translation system with gettext #347
Comments
I might try to start this tomorrow. This might be kinda hard step since I'm not familiar with your codebase. |
This should be given its own section in CONTRIBUTING.md |
After some initial digging I found, that, apparently, first step going to be actually hard, lol Some issues related to actual bugs in Godot. You have some checkboxes (for example, settings window for inputs) and they all just instanced from single checkbox scene, so using gettext from script there not an option, unless every checkbox will get it's own script. I think it's probably not good idea to refer to setting in checkboxes as exported string, rather then checkboxes own script. But also auto-translate not going to be kicked in (because Godot can collect text from nodes with auto-translate set to true) because this bug: godotengine/godot#79144; Apparently, there bug that prevent gettext from collecting text from instanced scenes, like your checkboxes. There also problem with tab container (I don't like it in overall, at least for that weird feature that it will collect name for tab from it's child, instead of being able to specify it in more normal way). Every tab child node should get it's own script with it's own tr function that gettext will be able to collect it. Probably, some class that tab will inherit. And in overall translations in every part of program implemented very differently, which is not good, even if we put gettext aside. Some nodes translates themself, while some nodes translate other nodes instead. Some rely on "auto-translate" property, while others simple translate from scripts. Conversion most likely will require reworking entire parts of some components, which I'm not sure if you going to be happy with this and this might require much more time then I initially thought. So, what do you say? |
Sadly, implementing game/program with gettext better when you starting from scratch, not when you already have entire codebase build around idea of csv. That's also why I'm trying to tell to developers that they need to consider moving to gettext as earlier as possible. (In future, consider using gettext from scratch, please.) So this proposal might need to wait until some parts of codebase might get refactored a bit. |
I think you should first focus on drafting out what the "For translators" section in CONTRIBUTING.md would be, because it will ultimately be the deciding factor on whether your work is accepted or not. I want to objectively weigh the pros and cons. The thing is, after thinking about it, from what I know right now, I'm leaning towards no. So I want to know what the workflow would be for translators before having you do massive amounts of work that I may ultimately reject.
The features you listed sound good, but I'm doubtful that they will justify the downsides mentioned above.
Besides that, the answer to almost every "Why is X done like this" question is "Because it solved an immediate problem". GodSVG is not even in beta, I can't worry about clean code when even the most fundamental systems are still getting refactored. It's a gradual process. I also don't see why signals connecting in the editor would be bad or confusing. |
I'll open pull request later then. But I still want to provide some counter (and maybe slightly offtopic) points anyway.
(I was talking about that thing: https://poedit.net/download/, it is free and open source. I think I misspelled several times yesterday. Instead of "POEdit" I write "POEditor, which is not related things. POEditor is actually web translation tool, like weblate. Sorry about that.) First, you absolutely can edit and work with both csv and po files using nothing but text editor. Instead of using something like libreoffice (that you need to download in 99% of cases manually, unless you use some Linux distro that provides libreoffice out of box): So, ultimately, you need to have some special program to work with translation anyway, Be it gettext files or csv or ini. Also, don't forget that translators already need to download Godot and know git just to even download and open your project. That's where standarization shines! Even small projects. I often don't have time to keep up with every program that I translate. I just open pot and update my po. After that I immediately know what changed. And I don't need to check git logs, check releases, anything! In case of non gettext system, YOU as developer need to take care of this. Making sure that you removed deprecated strings and all of this, while in gettext, you simple generate new pot file once in while (same can do your translators, it's easy to do in godot itself). it's just making things less prone to "Ah, I forget that string, damn!". And while this might not have yet happened with you, it was happening in project that I was editing text in several times in several languages (they were using script file from their game engine, like gdscript, lol.).
It's pretty default way to work with translations.
I list it as upside because it is forcing you try to make your translations more predictable, where exactly you apply them, when and how. Making it more consistent and predictable. (For example, that's why I'm not biggest fan of auto-translation property) Applying them all over the place might become very problematic once refactor might required.
There several problems with that. And second, AAA game devs very conservative in their translation choices and often translation tools and workflow for their games - sucks. Around 2 months ago, I finished translation (not for AAA game, but translation experience was pretty close) for one game with almost ~3k strings (maybe close to 2-2.5) and author used ini file instead (which is also doesn't include any localization features aswell). Do I need to tell, that it wasn't very good experience? Even finding strings that wasn't translated was painful. (gettext tools actually do provide ways to count this kinda of information). I can't even imagine managing games with 10k and more strings with this kinda of systems!
Welp, that's fair
Problem here, that IF you need pluralization, then it's become problematic with csv or something like that (remember that every language have it's own rules regarding plural forms. For example, csv never had any standards regarding this. And Godot doesn't even have it's own way to pluralize with csv yet: godotengine/godot-proposals#1291 (but there ssems to be ready pr for that, but it was left pretty untouched for almost 4 years...)
Context in gettext it's just not simple hint tags, they have technical purpose. (and, being able to sort strings by their context is big improvements for workflow. For example, sort strings by settings tab, e.g: "Visual options", "Input options", etc.) And problem here that from your language everything might looks right, while from my language point I might have bad time.
Well, it's only true if you actually familiar with codebase. Most people who might want to contribute translations or help with it won't able to easily find anything. Or just glance context in which this string might be used.
It's mostly management features for USERS. gettext makes this easy for you and users, because when you have gettext setup, you never really touch translation files ever again. You just add script or scenes (adding scene to pot system will add it's dependencies aswell) that need to be translated and write translations
That's why exactly you should use pseudolocalization should be used tho, even with csv file, just in case.
Mostly because it's harder to track where each node connects which signal to which function. Connecting signals in node's own node script makes it easier to track where signals and to whom emits. |
Okay, if this is openable in a basic text editor and in simple programs, then I don't think the downsides I brought up are as valid. I do still think the extra dependencies are a notable downside though, as currently the barrier for contributing is really low because there's only Git (unavoidable) and Godot (a very simple download and most people who find the project already have it). Libreoffice or other spreadsheet tools are usually around by default too, so I disagree with that point. So yeah, I'd appreciate writing a draft paragraph for "CONTRIBUTING.md" for translators, i.e. outlining the steps you need to take if your PR includes some new strings, or if you want to do translations. This will decide if I'll accept or reject the idea. (that is, I'd accept a PR implementing this, but I'm not planning to work on it personally yet, I think there are bigger priorities at the moment) |
There still many people who might use this program but without knowing what "Godot" is. And I wouldn't call Godot simple download, considering tit weight slightly over 100mbs, aswell configuring git on windows is more PITA then it should be, while spreadsheet of choice might as well be not available or support for displaying csv might require some input for user to display it correctly (some slightly older version of Microsoft Excel can't even recognize csv without additional manipulations, which already more problematic then opening format with 100% supported software, such as Poedit which weight less then 30mb and available for all majority platforms without any strings attached) Also, WIP version of contribution guide is done, now I need to create pull. |
This is relevant, it would address the grievances with the translation system if it gets merged timely. |
This is kind of big step, but manageable one.
gettext currently most widely used system for translating software and games.
It has many nice features that every translator will appreciate! But might be less obvious then something like csv file.
What should be done:
The text was updated successfully, but these errors were encountered: