-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Translation updater: Add support for function call without parantheses #14574
Conversation
Note:
I haven't had a success in combining all of those so that the order matches the occurrences in the file. |
Modified devtest/chest/chest.lua local S = minetest.get_translator("chest")
minetest.register_node("chest:chest", {
description = S"Chest" .. "\n" ..
"32 inventory slots", results in
However, only "Chest" should be translated. |
This is a special case in Lua: function call with single parameter.
894541a
to
c56ce80
Compare
I moved matching strings for single parameter call before strings concatenations. This results in string order change:
I also rebased this PR. Ordering strings based on their occurrences in the file will be harder since there are text changes due to string concatenations after matching function call without parentheses and before matching function call with parentheses. |
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.
Works
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
(feel free to go ahead and merge this now) |
Goal of the PR
This PR adds support for Lua function call without parentheses (single parameter function call).
How does the PR work?
This PR adds two patterns for Lua function call without parentheses, both for
"single/double-quote"
and for[[multiline]]
.Does it resolve any reported issue?
This PR tries to fix #14494.
If not a bug fix, why is this PR needed? What usecases does it solve?
See the linked issue and https://www.lua.org/pil/5.html for informations about single argument call.
To do
This PR is Ready for Review.
How to test
S
(and its variants) and without parentheses.