fbpx
วิกิพีเดีย

มอดูล:Autotranslate

คู่มือการใช้งานมอดูล[สร้าง]
 --[[  __ __ _ _ _ _ _ _ _   | \/ | ___ __| |_ _| | ___ _ / \ _ _| |_ ___ | |_ _ __ __ _ _ __ ___| | __ _| |_ ___   | |\/| |/ _ \ / _` | | | | |/ _ (_) / _ \| | | | __/ _ \| __| '__/ _` | '_ \/ __| |/ _` | __/ _ \  | | | | (_) | (_| | |_| | | __/_ / ___ \ |_| | || (_) | |_| | | (_| | | | \__ \ | (_| | || __/  |_| |_|\___/ \__,_|\__,_|_|\___(_)_/ \_\__,_|\__\___/ \__|_| \__,_|_| |_|___/_|\__,_|\__\___|    Authors and maintainers: * User:Zolo - original version * User:Jarekt  ]]  -- local function to help normalize input arguments local function normalize_input_args(input_args, output_args)  for name, value in pairs( input_args ) do  if value ~= '' then -- nuke empty strings  if type(name)=='string' then name=string.lower(name) end -- convert to lower case  output_args[name] = value  end  end  return output_args end  -- initialize object to be returned local p = {}  --[[ autotranslate   This function is the core part of the Autotranslate template.    Usage from a template: {{#invoke:autotranslate|autotranslate|base=|lang= }}   Parameters:  frame.args.base - base page name  frame.args.lang - desired language (often user's native language)   Error Handling:  ]] function p.autotranslate(frame)   -- switch to lowercase parameters to make them case independent  local args = {}  args = normalize_input_args(frame:getParent().args, args)  args = normalize_input_args(frame.args, args)   -- get language fallback list  if not args.lang or not mw.language.isSupportedLanguage(args.lang) then  args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language   end  local langList = mw.language.getFallbacksFor(args.lang)  table.insert(langList,1,args.lang)   -- find base page  local base = args.base  args.base = nil  assert(base and #base>0, 'Base page not provided for autotranslate' )  if not mw.ustring.find(base,':') then -- if base page does not indicate namespace  base = 'Template:' .. base -- than assume it is a template   end   -- find base template language subpage  local page = args.default -- default page if provided or nil otherwise  for _, language in ipairs(langList) do  if mw.title.new(base .. '/' .. language).exists then  page = base .. '/' .. language -- returns only the page  break  end  end  assert(page, string.format('No fallback page found for autotranslate (base=[[%s]], lang=%s)', base, args.lang))   -- Transclude {{page |....}} with template arguments the same as the ones passed to {{autotranslate}} template.  return frame:expandTemplate{ title = page, args = args} end  return p 

มอด, autotranslate, อการใช, งานมอด, สร, าง, ณอาจจะต, องการสร, างค, อการใช, งานของมอด, ลน, เข, ยนสามารถทำการทดลองได, กระบะทราย, สร, าง, ดลอก, และช, ดทดสอบ, สร, าง, ของมอด, ลน, โปรดเพ, มหมวดหม, ไปท, หน, าย, อย, หน, าย, อยของมอด, ลน, authors, maintainers, user, z. khumuxkarichnganmxdul srang khunxaccatxngkarsrangkhumuxkarichngankhxngmxdulniphuekhiynsamarththakarthdlxngidthikrabathray srang khdlxk aelachudthdsxb srang khxngmxdulnioprdephimhmwdhmuipthihnayxy doc hnayxykhxngmxdulni Authors and maintainers User Zolo original version User Jarekt local function to help normalize input arguments local function normalize input args input args output args for name value in pairs input args do if value then nuke empty strings if type name string then name string lower name end convert to lower case output args name value end end return output args end initialize object to be returned local p autotranslate This function is the core part of the Autotranslate template Usage from a template invoke autotranslate autotranslate base lang Parameters frame args base base page name frame args lang desired language often user s native language Error Handling function p autotranslate frame switch to lowercase parameters to make them case independent local args args normalize input args frame getParent args args args normalize input args frame args args get language fallback list if not args lang or not mw language isSupportedLanguage args lang then args lang frame callParserFunction int lang get user s chosen language end local langList mw language getFallbacksFor args lang table insert langList 1 args lang find base page local base args base args base nil assert base and base gt 0 Base page not provided for autotranslate if not mw ustring find base then if base page does not indicate namespace base Template base than assume it is a template end find base template language subpage local page args default default page if provided or nil otherwise for language in ipairs langList do if mw title new base language exists then page base language returns only the page break end end assert page string format No fallback page found for autotranslate base s lang s base args lang Transclude page with template arguments the same as the ones passed to autotranslate template return frame expandTemplate title page args args end return p ekhathungcak https th wikipedia org w index php title mxdul Autotranslate amp oldid 8075739, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม