Support Ruby syntax?
Opened this issue · 3 comments
Deleted user commented
Ruby has a slightly different syntax for named parameters in sprintf:
sprintf("This is a %{named}s parameter", { named: "beautiful" })
It uses %{...}
rather than %(...)
(which is already supported by sprintf.js).
@alexei Do you think the Ruby syntax could be added to sprintf.js? That would allow us moving code lines between frontend and backend more easily.
In case you approve adding it, I'd be happy to provide a pull request.
alexei commented
The re is rather cryptic so a test is warranted
Deleted user commented
@alexei Thank you for the feedback!
The re is rather cryptic so a test is warranted
Yes, I agree. 😄
I hope to work on this within the next two weeks but we are still discussing whether introducing sprintf.js as dependency is reasonable in https://gitlab.com/gitlab-org/gitlab-ce/issues/37992.