-
Notifications
You must be signed in to change notification settings - Fork 481
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
add Translation::GenerateName() #5175
Conversation
@@ -953,6 +953,10 @@ can be omitted. | |||
|
|||
Convert a ``df.language_name`` (or only the last name part) to string. | |||
|
|||
* ``dfhack.GenerateName(name,language,type,major_selector,minor_selector)`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be feasible to provide an additional signature of dfhack.GenerateName(name, language, type)
that chooses appropriate selectors based on the language_name_type
? I can write the LuaApi glue if you write the cpp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no single set of rules for how the major/minor selectors are chosen - sometimes they're taken from the global list and sometimes some are taken from the entity definition, and sometimes it uses the major/minor selectors and sometimes it uses the major selector both times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a naming suggestion on Discord. Not sure if it's worth implementing here or not.
I've felt for a long time that we ought to move this stuff to a dfhack.translation module, to match C++
we could alias the olddfhack.TranslateName = dfhack.translation.translateName
or something like that, and make the case in the new API consistent with the other APIs
Could you resolve the changelist conflicts? It seems like I can't push updates to your branch |
captured in #5180 |
Also available from Lua as "dfhack.generateName(...)"
I've confirmed that the function works correctly from C++ (the StrangeMood plugin successfully generated the artifact name "Mosusthilség", "Roomtarnished"), and it also seems to function correctly from Lua if you provide the correct parameters (I ran |
Also available from Lua as "dfhack.generateName(...)"
Fixes: #5166