[wesnoth-commits] [wesnoth/wesnoth] 30240a: For consistency, rename tstr:format -> tstr:vforma...

Celtic Minstrel noreply at github.com
Thu Dec 5 03:28:12 UTC 2019


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 30240aa7cda41bd5c1a660f17c67e76a9b9ab2cd
      https://github.com/wesnoth/wesnoth/commit/30240aa7cda41bd5c1a660f17c67e76a9b9ab2cd
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2019-12-04 (Wed, 04 Dec 2019)

  Changed paths:
    M src/scripting/lua_common.cpp
    M src/scripting/lua_kernel_base.cpp

  Log Message:
  -----------
  For consistency, rename tstr:format -> tstr:vformat, and add tstr:format as an alias to string.format

In order for the latter to work, string.format was overridden as follows (but implemented in the C API):

local old_format = string.format
function string.format(str, ...)
	if type(str) == 'userdata' and getmetatable(str) == 'translatable string' then str = tostring(str) end
	return old_format(str, ...)
end





More information about the Commits mailing list