Manual:Interwiki/es

This page is a translated version of the page Manual:Interwiki and the translation is 42% complete.
Outdated translations are marked like this.

Los enlaces interwiki son enlaces a páginas de otros proyectos que utilizan un estilo de enlace interno con prefijo.

Los enlaces interwiki permiten enlazar a, por ejemplo, páginas de Wikipedia, Wikibooks, Wikinews, etc. o a su propio proyecto wiki en distintos idiomas. (Véase Manual:Familia Wiki .)

Un enlace como [[Wikipedia:Main Page]] aparecerá así: Wikipedia:Main Page y lo redirigirá a la página principal de Wikipedia.

Enlaces interwiki a otros proyectos

API de tabla y consulta

Los enlaces interwiki se almacenan en la tabla interwiki de la base de datos de MediaWiki. Puede recuperar la lista interwiki de la propiedad interwikimap de la API de meta consulta siteinfo , en otras palabras, haciendo una solicitud de API como api.php?action=query&meta=siteinfo&siprop=interwikimap

Por defecto

Varios proyectos de Wikimedia (y otros) están listos para la vinculación interwiki de forma predeterminada, por lo que puede usarlos sin editar su base de datos.

Los siguientes son algunos ejemplos de prefijos interwiki que están disponibles de forma predeterminada (Wikipedia también está disponible, 1.10 y posteriores):

prefijo URL de destino ejemplo de uso
commons https://commons.wikimedia.org/wiki/ [[commons:MediaWiki]]
mediazilla http://bugzilla.wikimedia.org/ [[mediazilla:1209]]
metawikimedia (antes de la versión 1.23: metawikipedia) https://meta.wikimedia.org/wiki/ [[metawikimedia:Main Page]]

La lista completa de prefijos interwiki predeterminados está disponible en maintenance/interwiki.list

Consulte m:Help:Interwiki linking para obtener información completa sobre cómo enlazar desde/hacia proyectos de Wikimedia.

En algunas instalaciones, ninguno de estos está preinstalado. Pruebe [[metawikipedia:Main Page]] en este caso.

Adición de un nuevo sitio web para enlaces interwiki

  • Los enlaces de Interwiki se establecen en la tabla interwiki de la base de datos.
  • Para modificarlos, deberá editar la base de datos, como se muestra a continuación.

Se recomienda utilizar la extensión "Interwiki", que facilita el proceso.

Como Wikipedia no está configurada de forma predeterminada antes de la versión 1.10, es posible que desee agregarla (y otros proyectos que desee).

Los ejemplos siguientes muestran cómo configurar w: como un enlace a la Wikipedia en inglés.

La idea es insertar una línea del formulario:

('prefix', 'URL format string', 1, 0)

into the interwiki table.

Single line

Advanced users may use a single command line, as follows:

  • MySQL y PostgreSQL
Versiones de MediaWiki:
1.10 – 1.16
INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans) VALUES ('w', 'https://en.wikipedia.org/wiki/$1', 1, 0);

Newer MediaWiki versions require some extra fields such as iw_wikiid:

INSERT INTO interwiki (iw_prefix, iw_url, iw_api, iw_local, iw_trans, iw_wikiid) 
VALUES ('w', 'https://en.wikipedia.org/wiki/$1', 'https://en.wikipedia.org/w/api.php', 0, 1, '');

Exportar, añadir y volver a importar

Alternatively, you can use the following multi-step process, which exports the interwiki table, adds a line, then re-imports it:

  • Export the database table interwiki
  • add to the end of the table a line of the following form (using English wikipedia as an example):
('w', 'https://en.wikipedia.org/wiki/$1', 1, 0);
In the above code, the semicolon ';' as seen, MUST be at the end of the table. At the end of any other line within that table Only has ','.
  • Import the database table interwiki

To test

To test configuration:

  • Go to your site,
  • create an article, with the following content:
  • [[w:Wikipedia:Village pump|]]
  • This should display a link to the 'Village pump' page on en.Wikipedia.org (the url https://en.wikipedia.org/wiki/Wikipedia:Village_pump)

Field documentation

Further information: Manual:Interwiki table


  Consejo para administradores de Wiki: Several help pages link to MediaWiki.org's Manual namespace. To make these links work on your local wiki, add an interwiki link with iw_prefix=manual and iw_url=http://www.mediawiki.org/wiki/Manual:$1


  Consejo para administradores de Wiki: $wgTranscludeCacheExpiry in your LocalSettings.php should be set if changes in the transcluded wiki are done. Alternatively, you can flush the table transcache on your local wiki.


Enlaces interwiki a otros idiomas

 
Enlaces interwiki a otros idiomas

If you have installed a Wiki family , you can link from an article in English to an article in German (if you have a German project, too). You can set up MediaWiki to show those links in the sidebar, just below the toolbox.

In your filesystem, there is a subfolder of your MediaWiki installation, called "languages". Go there and have a look at Names.php as it contains a list of known languages and their prefixes. E.g. you want to add your German project, search Names.php for "Deutsch" and note the prefix "de".

If you know the "right" prefix, edit your database by adding a new line to table interwiki:

iw_prefix language-prefix (e.g. "de" for German), which is listed in Names.php
iw_url URL to your wiki-project (e.g. http://de.example.org/index.php/$1)
iw_local same as above "Adding More"
iw_trans same as above "Adding More"

Now, you can link an article to the same in other languages. Adding [[de:Hauptseite]] on your English Main_Page will create a link "Deutsch" below the toolbox, which leads to the Main_Page of the German wiki (Hauptseite).

Note, that this link is shown in Sidebar's section, only, and not inside of the article. If you want to create a link inside of the text, you have to add a colon previous to the prefix: [[:de:Hauptseite]] or set $wgInterwikiMagic to false.

Exportar la tabla interwiki desde un wiki

The following JavaScript code performs the API query to retrieve the interwiki map of an existing wiki, then displays the SQL INSERT statements to fill the interwiki table on a new wiki. You run it for example by injecting the code through your browser's developer tools, or by placing it inside Special:MyPage/skinname.js and previewing.

function ExtractInterwikiMapTable() {
	$.getJSON(mw.config.get('wgScriptPath') + '/api.php?action=query&meta=siteinfo&siprop=interwikimap&format=json', function(data) {
		var iw_prefix, iw_url, iw_local, iw_api, re_escape = /(')/g, result = '';
		for (var i = 0, iwm = data.query.interwikimap; i < iwm.length; i++) {
			iw_prefix = "'" + iwm[i].prefix.replace(re_escape, '\\$1') + "'";
			iw_url = "'" + iwm[i].url.replace(re_escape, '\\$1') + "'";
			iw_local = (typeof iwm[i].local == 'string') ? '1' : '0';
			iw_api = "'" + (iwm[i].iw_api || '').replace(re_escape, '\\$1') + "'";
			result += 'INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans, iw_api) VALUES ('+iw_prefix+', '+iw_url+', '+iw_local+', 0, '+iw_api+');\n'
		}
		$('<textarea style="width:800px;height:400px;"/>').val(result).appendTo(document.body);
	});
}

$(ExtractInterwikiMapTable);

Véase también