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
Implement macro to feature-test translations in ActionWML #7658
base: master
Are you sure you want to change the base?
Conversation
Almost all of the macro is Lua body. Why not have it as Lua function then? |
What should the Lua API look like? |
As core macro it would also need documentation comment which describes what it does and how to use it. If you have that available it could also be starting point to decide whether to use wml tag, wml macro, or Lua function. |
7552a7c
to
c325749
Compare
Hints are one thing, but I don't think this can be used for dialogue. The flow of conversation won't make sense if some lines are randomly omitted. |
My current preference would be something like I could also make use of it in WC where there are ( for example in the "found a hero" dialogue) Multiple strings for specific heroes and a fallback string for units that don't have a specific dialogue. With something like this, i could make it use the fallback in case that the unit specific variant is not translated (which is afaik currently the case in some languages) |
Some pieces of dialogue are in fact hints that could be omitted, such as Delfador's in #7291 (granted, that PR poses larger challenges than that piece of advice, but this is a step forward for similar, albeit less complex, cases.) |
I'm not saying there's no cases, just that this isn't something that can be used for just anything.
I like that model, but I think I'd prefer to invert it – something like |
I also think that inverting it makese sense but, i found it quite hard to come up with a function name doesnt sound like like "is this a tstring or a normal string" check. |
If you want to know whether or not it's a t_string, you use We might also need |
Is this 1.17 API?
Thanks. Useful remarks for the crash course on t_strings I just got myself into.
Returning true from non-localizable strings would be misleading. An exception should probably be raised instead. Unless I am severely misunderstanding something. Like, surely there's a reason for this? Lines 336 to 338 in c44cc27
|
Feels like it should be a new ConditionalActionsWML tag, which would allow checking multiple strings to have a coherent conversation:
My main question is, what ends up in the .po file? Will old strings become ghosts that still look as if they should be translated, even though they would no longer be used when the new strings are translated? That wouldn't be a problem for translations that had reached 100%, but it would add workload to translations that were catching up. Slightly worse would be when the ghosts are only there for the For WC, if it can change which hero is found then it will need multiplayer safety. |
Yes – in 1.16 you would need to check
I think the reason for the code you posted is that a string beginning with UNTRANSLATABLE_PART is an indication that there will be a TRANSLATABLE_PART later on. If the entire thing is untranslatable, it doesn't start with UNTRANSLATABLE_PART, I think.
I'm not sure… is it really okay for such a function to raise an exception? If it does though there definitely needs to be another function to detect whether it will raise an exception.
It probably shouldn't, but then you also need to specify the textdomain in the tag. |
All strings tagged with
That would depend on when it's decided to drop these feature tests. I don't think they should be permanently left in the code. But if people are interested LTS-ing them, then dropping any fallbacks future translation catalogs would be a necessity.
Not sure what you mean. The entire point of feature-testing would be checking for them and then using them. Just checking for them but not using them at all would be just asking for trouble. Certainly, anything can be misused, but that sort of abuse cannot be allowed for mainline campaigns.
Indeed, one of the reasons why I proposed this as a macro is so that there is no Similarly, because of maintenance cost, if there were a
Feature-testing should be done in the definition site. Checking in other random places whether an unknown
That's
An alternative would be
Fairly sure the WC case involves changing messages about hero encounters, not heros themselves. |
That still specifies a textdomain, as |
Αctually, I don't think the current build workflow would accomodate this. If they are ignored from new catalogs, they will be directly dropped as soon as the build process runs Also, fallbacks tend to be very generic and pose translation challenges, so I think a
Right. It needs to be specified somewhere, but |
I've been looking at other engines' approach to i18n, and found that Ren'Py its own system, along with great documentation system. Instead of translating msgids to strings, it translates "say msgid" to a function name, and calls it if it exists. The called function can then say zero, one, or many strings. It can also contain code, with an example converting a number to Roman numerals.
Agreed, but if they're a few lines away from each other then someone can update the ones that are displayed to the user and fail to notice that they're leaving ghosts. |
There are concerns about new English dialogues and/or hints popping up in the middle of otherwise fully-translated campaigns, so this provides a standard way to check whether given sentences are already translated.