Módulo:Citas: Diferenzas entre revisións

Contido eliminado Contido engadido
Banjo (conversa | contribucións)
m cats DOIs inactivos
Banjo (conversa | contribucións)
m tradución de comentarios en progreso
Liña 1:
 
local z = {
error_categories = {}; -- forCategorías categorizingde citations that contain errorserros
error_ids = {};
message_tail = {};
maintenance_cats = {}; -- forCategorías categorizingde citationsmantemento that(Non aren't erroneous per se, but could use a little workusadas)
properties_cats = {}; -- forCategorías categorizingde citationspropiedades based(Non on certain properties, language of source for instanceusadas)
}
 
--[[--------------------------< F O R W A R D D E C L A R A T I O N SDECLARACIÓNS >--------------------------------------
]]
local dates, year_date_check -- functionsfuncións inen ModuleMódulo:CitationCitas/CS1/Date_validationValidaciónDatas (Non usado)
 
local cfg = {}; -- tabletáboa ofde configurationtáboas tablesde thatconfiguración aredefinidas defined inen Módulo:Citas/Configuration
local whitelist = {}; -- talbetáboa ofde tablestáboas listingde validparámetros templateválidos parameterdefinidos names; defined inen Módulo:Citas/Whitelist
 
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
 
Devolve verdadeiro se o argumento está definido, falso se nón. Un argumento está definido cando existe (non nulo) ou cando non é unha cadea vacía
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
Función global xa que se chama dende este módulo e dende ValidaciónDatas
This function is global because it is called from both this module and from Date validation
 
]]
Liña 27:
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
 
First setComprobar variable or nilou ifasignar nonenulo
 
]]
Liña 42:
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
 
Buscar unha agulla nun pallar (busca nunha matriz)
Whether needle is in haystack
 
]]
Liña 60:
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
 
Poboar con argumentos numerados nunha cadea usando unha táboa de argumentos
Populates numbered arguments in a message string using an argument table.
 
]]
Liña 70:
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
 
WrapsEngade errorcódigo messagescss withaos cssmensaxes markupde accordingerros tosegundo theo stateestado ofde "hidden".
 
]]
Liña 79:
--[[--------------------------< S E T _ E R R O R >--------------------------------------------------------------
 
Define unha condición de erro e devolve a mensaxe correspondente. A visualización da mensaxe de erro na saída é
Sets an error condition and returns the appropriate error message. The actual placement of the error message in the output is
responsabilidade da función que chama a esta
the responsibility of the calling function.
 
]]
Liña 118:
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
 
AddsEngade aunha categorycategoría toá z.maintenance_cats using(non names from the configuration file with additional text if any.usada)
 
]]
Liña 128:
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
 
AddsEngade aunha categorycategoría toá z.properties_cats using(non names from the configuration file with additional text if any.usada)
 
 
]]
 
local function add_prop_cat (key, arguments)
table.insert( z.properties_cats, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
end
 
]]
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
 
Determina se un enderezo URL é válido
Determines whether a URL string is valid.
 
Só comproba se a cadea ten un prefixo URI. Non determina se o esquema URI é válido ou se está ben formado.
At present the only check is whether the string appears to be prefixed with a URI scheme. It is not determined whether
the URI scheme is valid or whether the URL is otherwise well formed.
 
]]
Liña 151 ⟶ 150:
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
 
ProtectsProtexe aunha stringcadea thatá willque bese wrappedlle inengadirá wikio italiccódigo markupde cursiva '' ... ''
 
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
 
]]
Liña 173 ⟶ 168:
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
 
Secuencias de escape para contido usado en descricións URL
Escape sequences for content that will be used for URL descriptions
 
]]
Liña 190 ⟶ 185:
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
 
AppliesAplica stylingestilo toa variousvarios parametersparámetros. O Suppliedestilo stringdepende isda wrapped using aconfiguración message_list. O configurationtexto takingadicional onetómase
argument;de protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
 
]]
Liña 208 ⟶ 202:
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
 
Formatea unha ligazón externa con comprobación de erro
Format an external link with error checking
 
]]
Liña 230 ⟶ 224:
--[[--------------------------< E X T E R N A L _ L I N K _ I D >----------------------------------------------
 
Formatea unha ligazón externa de estilo wiki
Formats a wiki style external link
 
]]
Liña 247 ⟶ 241:
 
--[[
Categoriza e marca mensaxe de erro cando contén parámetros desbotados.
Categorize and emit an error message when the citation contains one or more deprecated parameters. Because deprecated parameters (currently |month=,
Só asigna unha mensaxe de erro sen ter en conta o número de parámetros desbotados que se inclúan
|coauthor=, and |coauthors=) aren't related to each other and because these parameters may be concatenated into the variables used by |date= and |author#= (and aliases)
details of which parameter caused the error message are not provided. Only one error message is emitted regardless of the number of deprecated parameters in the citation.
]]
local function deprecated_parameter(name)
Liña 341 ⟶ 334:
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
 
Concatena |título= e |título-translit= tras engadir as etiquetas <bdi> ao último.
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script value has been
wrapped in <bdi> tags.
]]
 
Liña 380 ⟶ 372:
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
 
Escolle un parámetro que combine dende unha lista de parámetros.
Chooses one matching parameter from a list of parameters to consider
Xera un erro se existe máis dun parametro que combine
Generates an error if more than one match is present.
 
]]
Liña 441 ⟶ 433:
--[[--------------------------< F O R M A T _ C H A P T E R _ T I T L E >--------------------------------------
 
Formatea os parámetros de capítulos: |capítulo=, |capítulo-trad= e |url-capítulo= nun meta-parámetro
Format the three chapter parameters: |chapter=, |trans-chapter=, and |chapter-url= into a single Chapter meta-
parameter (chapter_url_source used for error messages).
 
]]
Liña 522 ⟶ 513:
 
--[[
LooksBusca foro anome parameter'sdo nameparámetro in thena whitelist.
 
ParametersOs inparámetros thena whitelist canpoden haveter threetres valuesvalores:
true - activeactivo, supported parameterssoportado
false - deprecateddesbotado, supported parameterssoportado
nil - unsupportednon parameterssoportado
]]
 
Liña 613 ⟶ 604:
--[[--------------------------< C H E C K _ I S B N >------------------------------------------------------------
 
Determina se unha cadea ISBN é válida
Determines whether an ISBN string is valid
 
]]