Module:CS1 translator/data: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 138:
['dateformat'] = 'df',
 
-- enumerated parameters; non-enumerated forms of enumeratedthese parameters; TODO: is there a better way tocreated doby this?build_params_main_t()
['contributormaske'] = 'contributor-mask',
['efternavn'] = 'last',
['fornavn'] = 'first',
['forfatter'] = 'author',
['forfatterlink'] = 'author-link',
['forfattermaske'] = 'author-mask',
['redaktør'] = 'editor',
['redaktørlink'] = 'editor-link',
['redaktørmaske'] = 'editor-mask',
['redaktør-efternavn'] = 'editor-last',
['redaktør-fornavn'] = 'editor-first',
['oversætter'] = 'translator',
['oversætter-efternavn'] = 'translator-last',
['oversætter-fornavn'] = 'translator-first',
['oversætterlink'] = 'translator-link',
['oversættermaske'] = 'translator-mask',
 
-- enumerated parameters
['fornavn#'] = 'first#',
['forfatter#'] = 'author#',
Line 217 ⟶ 199:
['zugriff'] = nil, -- access-date
 
-- enumerated parameters; non-enumerated forforms of enumeratablethese parameters created by build_params_main_t()
['autor'] = 'author',
['herausgeber'] = 'editor',
['übersetzer'] = 'translator',
 
-- enumerated parameters
['autor#'] = 'author#',
['herausgeber#'] = 'editor#',
Line 338 ⟶ 315:
['wikidata'] = nil, -- no cs1|2 equivalent
 
-- enumerated parameters; non-enumerated forms of enumeratedthese parameters; TODO: is there a better way tocreated doby this?build_params_main_t()
['apellido'] = 'last',
['apellido-editor'] = 'editor-last',
['autor'] = 'author',
['enlaceautor'] = 'author-link',
['enlace-autor'] = 'author-link',
['enlace-editor'] = 'editor-link',
['máscaraautor'] = 'author-mask',
['máscara-autor'] = 'author-mask',
['nombre'] = 'first',
['nombre-editor'] = 'editor-first',
 
-- enumerated parameters
['máscaraautor#'] = 'author-mask#',
['máscara-autor#'] = 'author-mask#',
Line 490 ⟶ 455:
['wikisource'] = nil, -- no cs1|2 equivalent; title of the book's wikisource page
 
-- enumerated parameters; non-enumerated forms of enumeratedthese parameters; TODO: is there a better way tocreated doby this?build_params_main_t()
-- ['auteur'] = 'author', -- non-enumerated forms
-- ['directeur'] = nil, -- no cs1|2 equivalent; "If the author assumes the responsibility of director of publication, indicate yes; otherwise, do not use this parameter"
-- ['lien auteur'] = 'author-link',
-- ['nom'] = 'last',
-- ['postnom'] = 'last',
-- ['prenom'] = 'first',
-- ['prénom'] = 'first',
-- ['responsabilité'] = nil, -- no cs1|2 equivalent; "Possible additional liability assumed by the author; if he is a publication directeur1, prefer the directeur1 parameter."
 
-- enumerated parameters
['auteur#'] = 'author#',
['directeur#'] = nil, --no cs1|2 equivalent; "If the author assumes the responsibility of director of publication, indicate yes; otherwise, do not use this parameter"
Line 662 ⟶ 617:
['wktrasmissione'] = 'series-link',
 
-- enumerated parameters; non-enumerated forms of enumeratedthese parameters; TODO: is there a better way tocreated doby this?build_params_main_t()
['autore'] = 'author',
['cognome'] = 'last',
['curatore'] = 'editor',
['curatore-cognome'] = 'editor-last',
['curatore-nome'] = 'editor-first',
['linkautore'] = 'author-link',
['nome'] = 'first',
['wkautore'] = 'author-link',
 
-- enumerated parameters
['autore#'] = 'author#',
['autore-articolo#'] = nil, -- no cs1|2 equivalent: |author-article=?
Line 884 ⟶ 829:
['serie-separator'] = nil, -- no cs1|2 equivalent: |series-separator=
['sesong'] = 'season',
['side'] = true'page',
['sideantall'] = nil, -- not in aliases list: |number-of-pages=?; -- kept for backwards compability, not part of CS1
['sider'] = 'pages',
Line 922 ⟶ 867:
['volum'] = 'volume',
 
-- enumerated parameters; non-enumerated formforms of enumeratedthese parameters created by build_params_main_t()
['etternavn'] = 'last',
['forfatter'] = 'author',
['forfatter-etternavn'] = 'author-surname',
['forfatter-fornavn'] = 'author-given',
['forfatterlenke'] = 'author-link',
['forfatter-lenke'] = 'author-link',
['fornavn'] = 'first#',
['intervjuer'] = true,
['oversetter'] = 'translator',
['oversetter-fornavn'] = 'translator-first',
['oversetter-etternavn'] = 'translator-last',
['oversetter-lenke'] = 'translator-link',
['oversetter-maske'] = 'translator-mask',
['redaktør'] = 'editor',
['redaktøretternavn'] = 'editor-last',
['redaktør-etternavn'] = 'editor-last',
['redaktørfornavn'] = 'editor-first',
['redaktør-fornavn'] = 'editor-first',
['redaktørlenke'] = 'editor-link',
['redaktør-lenke'] = 'editor-link',
['redaktørmerke'] = nil, -- not in aliases list
['redaktør-merke'] = nil, -- not in aliases list
-- enumerated parameters
['etternavn#'] = 'last#',
['forfatter#'] = 'author#',
Line 1,040 ⟶ 961:
['adres czasopisma'] = nil, -- no cs1|2 equivalent; 'journal url'
 
-- enumerated parameters; non-enumerated formforms of enumeratedthese parameters created by build_params_main_t()
['autor'] = 'author',
['autor r'] = 'contributor', -- 'chapter' author; 'contributor' here to distingush from |autor= (|author=); from {{Cytuj książkę}}
['autor r link'] = 'contributor-link', -- 'chapter' author link
['autor link'] = 'author-link',
['imię'] = 'first',
['imię r'] = 'contributor-first', -- 'chapter' author; 'contributor' here to distingush from |imię= (|first=); from {{Cytuj książkę}}
['język'] = 'language', -- special case |language=
['nazwisko'] = 'last',
['nazwisko r'] = 'contributor-last', -- 'chapter' author; 'contributor' here to distingush from |nazwisko= (|last=); from {{Cytuj książkę}}
['redaktor'] = 'editor',
 
-- enumerated parameters
['autor#'] = 'author#',
['autor link#'] = 'author-link#',
Line 1,378 ⟶ 1,287:
 
 
-- enumerated parameters; non-enumerated forms of enumeratedthese parameters; TODO: is there a better way tocreated doby this?build_params_main_t()
['apelido'] = 'last',
['apellido'] = 'last',
['apellidos'] = nil, -- no cs1|2 equivalent: plural |lasts=
['authormask'] = 'author-mask',
['authormask'] = 'author-mask',
['autor'] = 'author',
['autor-mascara'] = 'author-mask',
['autorlink'] = 'author-link',
['cognome'] = 'last',
['contribuidor-primeiro'] = 'contributor-first',
['contribuidor-ultimo'] = 'contributor-last',
['contribuidor-link'] = 'contributor-link',
['contribuidor-mascara'] = 'contributor-mask',
['contribuidor-primeiro'] = 'contributor-first',
['contributor-ultimo'] = 'contributor-last',
['editorlink'] = 'editor-link',
['editormask'] = 'editor-mask',
['editor-mascara'] = 'editor-mask',
['editor-nome'] = 'editor-first',
['editor-sobrenome'] = 'editor-last',
['editorlink'] = 'editor-link',
['editormask'] = 'editor-mask',
['entrevistado'] = 'interviewer',
['entrevistadolink'] = 'interviewer-link',
['entrevistador'] = 'interviewer',
['nombre'] = 'first',
['nome'] = 'first',
['prenome'] = 'first',
['primeiro'] = 'first',
['sobrenome'] = 'last',
['subjectlink'] = 'subject-link',
['sujeito'] = 'subject-last',
['sujeitolink'] = 'subject-link',
['tradutor'] = 'translator',
['tradutor-link'] = 'translator-link',
['tradutor-mascara'] = 'translator-mask',
['tradutor-primeiro'] = 'translator-first',
['tradutor-ultimo'] = 'translator-last',
['tradutor-link'] = 'translator-link',
['tradutor-mascara'] = 'translator-mask',
['tradutor-primeiro'] = 'translator-first',
['tradutor-ultimo'] = 'translator-last',
['ultimo'] = 'last',
['último'] = 'last',
 
-- enumerated parameters
['apelido#'] = 'last#',
['apellido#'] = 'last#',
Line 1,546 ⟶ 1,409:
['website'] = 'url', -- different from en.wiki
 
-- enumerated parameters; non-enumerated forms of these parameters created by build_params_main_t()
['efternamn'] = 'last',
['författare'] = 'author',
['författarlänk'] = 'author-link',
['förnamn'] = 'first',
['redaktörlänk'] = 'editor-link',
['redaktör-efternamn'] = 'editor-last',
['redaktör-förnamn'] = 'editor-first',
 
-- enumerated parameters
['efternamn#'] = 'last#',
['författare#'] = 'author#',
Line 1,739 ⟶ 1,593:
['zaman'] = 'time',
 
-- enumerated parameters; non-enumerated forms of enumeratedthese parameters; TODO: is there a better way tocreated doby this?build_params_main_t()
['ad'] = 'first',
['çevirmen-ad'] = 'translator-first',
['çevirmen'] = 'translator',
['çevirmen-bağ'] = 'translator-link',
['çevirmen-bağı'] = 'translator-link',
['çevirmen-maske'] = 'translator-mask',
['çevirmen-maskesi'] = 'translator-mask',
['çevirmen-soyadı'] = 'translator-last',
['editör'] = 'editor',
['editör-ad'] ='editor-first',
['editör-bağ'] = 'editor-link',
['editör-bağı'] = 'editor-link',
['editör-ilk'] = 'editor-first',
['editör-maske'] = 'editor-mask',
['editör-maskesi'] = 'editor-mask',
['editör-son'] = 'editor-last',
['editör-soyadı'] = 'editor-last',
['görüşmeci'] = 'interviewer',
['görüşmeci-ad'] = 'interviewer-first',
['görüşmeci-bağ'] = 'interviewer-link',
['görüşmeci-bağlantı'] = 'interviewer-link',
['görüşmeci-maske'] = 'interviewer-mask',
['görüşmeci-maskesi'] = 'interviewer-mask',
['görüşmeci-soyadı'] = 'interviewer-last',
['ilk'] = 'first',
['katkı-ad'] = 'contributor-first',
['katkı-bağ'] = 'contributor-link',
['katkı-bağı'] = 'contributor-link',
['katkı-maske'] = 'contributor-mask',
['katkı-maskesi'] = 'contributor-mask',
['katkı-soyadı'] = 'contributor-last',
['konu'] = 'subject',
['konubağı'] = 'subject-link',
['özne'] = 'subject',
['öznebağı'] = 'subject-link',
['son'] = 'last',
['soyadı'] = 'last',
['süje'] = 'subject',
['süjebağı'] = 'subject-link',
['yazar'] = 'author',
['yazarbağ'] = 'author-link',
['yazarbağı'] = 'author-link',
['yazarlink'] = 'author-link',
['yazarmaskesi'] = 'author-mask',
['yazar-bağ'] = 'author-link',
['yazar-link'] = 'author-link',
 
-- enumerated parameters
['ad#'] = 'first#',
['çevirmen#-ad'] = 'translator#-first',
Line 2,172 ⟶ 1,978:
}
 
 
--[[--------------------------< B U I L D _ P A R A M S _ M A I N _ T >----------------------------------------
 
assemble the main list of parameters; skip all nil-valued parameter and create non-enumerated parameter names
from the enumerated parameters (those that have '#' somewhere in the parameter name)
 
Does simple error detection and emits a graringly crude error message when:
only one side of ['key'] = value pair has a '#'; when enumerated, both sides require the '#'
the only type allowed for value in a ['key'] = value pair is 'string'; catches things like ['side'] = true (copied from a whitelist)
 
]]
 
local function build_params_main_t ()
local out_t = {}; -- table goes here
for lang, v_t in pairs (params_main_t) do -- for each language table in params_main_t{}
out_t[lang] = {}; -- create a table in out_t for <lang>
for k, v in pairs (v_t) do -- for each parameter in the language table
if 'string' ~= type (v) then
if k:find ('#', 1, true) then -- does the parmeter have the enumerator character '#'
error (lang .. ' ' .. k .. ' value not a string'); -- glaring error message because non-string values not allowed
out_t[lang][k:gsub('#', '')] = v:gsub('#', ''); -- add a non-enumerate version of the parameter to the output
elseend
if v then -- if the parameter has a non-nil translation (not a special, not a parameter without cs1|2 equivalent)
out_t[lang][k] = v;
if (k:find ('#', 1, true) and not v:find ('#', 1, true)) or
(not k:find ('#', 1, true) and v:find ('#', 1, true))then
error (lang .. '[' .. k .. ']: '.. v .. ' missing \'#\''); -- glaring error message because '#' required on both sides
else
if k:find ('#', 1, true) then -- does the parmeter name have the enumerator character '#'?
out_t[lang][k:gsub('#', '')] = v:gsub('#', ''); -- add a non-enumerated version of the parameter to the output
end
out_t[lang][k] = v; -- add the parameter to the output; may be an enumerated param or not
end
end
end
end
return out_t; -- and done
end
 
Line 2,195 ⟶ 2,022:
params_identifiers_t = params_identifiers_t,
params_language_t = params_language_t,
params_main_t = build_params_main_t(), --params_main_t,
params_misc_dates_t = params_misc_dates_t,
}