i18n.luadoc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ---[[
  2. LuCI translation library.
  3. ]]
  4. module "luci.i18n"
  5. ---[[
  6. Clear the translation table.
  7. @class function
  8. @name clear
  9. ]]
  10. ---[[
  11. Load a translation and copy its data into the translation table.
  12. @class function
  13. @name load
  14. @param file Language file
  15. @param lang Two-letter language code
  16. @param force Force reload even if already loaded (optional)
  17. @return Success status
  18. ]]
  19. ---[[
  20. Load a translation file using the default translation language.
  21. Alternatively load the translation of the fallback language.
  22. @class function
  23. @name loadc
  24. @param file Language file
  25. @param force Force reload even if already loaded (optional)
  26. ]]
  27. ---[[
  28. Set the context default translation language.
  29. @class function
  30. @name setlanguage
  31. @param lang Two-letter language code
  32. ]]
  33. ---[[
  34. Return the translated value for a specific translation key.
  35. @class function
  36. @name translate
  37. @param key Default translation text
  38. @return Translated string
  39. ]]
  40. ---[[
  41. Return the translated value for a specific translation key and use it as sprintf pattern.
  42. @class function
  43. @name translatef
  44. @param key Default translation text
  45. @param ... Format parameters
  46. @return Translated and formatted string
  47. ]]
  48. ---[[
  49. Return the translated value for a specific translation key
  50. and ensure that the returned value is a Lua string value.
  51. This is the same as calling <code>tostring(translate(...))</code>
  52. @class function
  53. @name string
  54. @param key Default translation text
  55. @return Translated string
  56. ]]
  57. ---[[
  58. Return the translated value for a specific translation key and use it as sprintf pattern.
  59. Ensure that the returned value is a Lua string value.
  60. This is the same as calling <code>tostring(translatef(...))</code>
  61. @class function
  62. @name stringf
  63. @param key Default translation text
  64. @param ... Format parameters
  65. @return Translated and formatted string
  66. ]]