Animal mobs for Mobs Redo on Minetest https://content.minetest.net/packages/TenPlus1/mobs_animal/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1KB

  1. -- Fallback functions for when `intllib` is not installed.
  2. -- Code released under Unlicense <http://unlicense.org>.
  3. -- Get the latest version of this file at:
  4. -- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
  5. local function format(str, ...)
  6. local args = { ... }
  7. local function repl(escape, open, num, close)
  8. if escape == "" then
  9. local replacement = tostring(args[tonumber(num)])
  10. if open == "" then
  11. replacement = replacement..close
  12. end
  13. return replacement
  14. else
  15. return "@"..open..num..close
  16. end
  17. end
  18. return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
  19. end
  20. local gettext, ngettext
  21. if minetest.get_modpath("intllib") then
  22. if intllib.make_gettext_pair then
  23. -- New method using gettext.
  24. gettext, ngettext = intllib.make_gettext_pair()
  25. else
  26. -- Old method using text files.
  27. gettext = intllib.Getter()
  28. end
  29. end
  30. -- Fill in missing functions.
  31. gettext = gettext or function(msgid, ...)
  32. return format(msgid, ...)
  33. end
  34. ngettext = ngettext or function(msgid, msgid_plural, n, ...)
  35. return format(n==1 and msgid or msgid_plural, ...)
  36. end
  37. return gettext, ngettext