Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(pt-br): replace interwiki macros with markdown links #13922

Merged
merged 3 commits into from
Jul 9, 2023

Conversation

yin1999
Copy link
Member

@yin1999 yin1999 commented Jun 24, 2023

Description

replace interwiki macros with markdown links

I've used a script to replace most of them:

import * as fs from 'fs';
import * as path from 'path';

const root = 'files/pt-br/';

async function walk(dir, callback) {
	const files = fs.readdirSync(dir, { withFileTypes: true });
	for (const file of files) {
		const filepath = path.join(dir, file.name);
		if (file.isDirectory()) {
			walk(filepath, callback);
		} else if (file.name.endsWith('.md')) {
			await callback(filepath);
		}
	}
}

function safeUrl(url) {
	if (url.includes('(') || url.includes(')')) {
		return `<${url}>`;
	}
	return url;
}

async function resolve(filepath) {
	const content = fs.readFileSync(filepath, 'utf8');
	const re = /\{\{\s*interwiki\s*\(['"]wikipedia['"]\s*,\s*['"]([^'"]+)['"]\s*\)\s*\}\}/ig;
	// replace all occurrences
	const names = [];
	content.replace(re, (match, name) => {
		// check whether the wikipedia page exists
		names.push(name);
	});
	if (names.length == 0) {
		return;
	}
	const replaces = [];
	for (const name of names) {
		try {
			let lang = 'en'; // could replace this with 'pt' to resolve some "correct" interwiki macro calls
			let apiUrl = `https://${lang}.wikipedia.org/w/api.php?action=query&titles=${encodeURIComponent(name)}&prop=langlinks&lllimit=500&format=json` // could replace `pt` with `en` to get translations when not existed in `pt`
			const response = await fetch(apiUrl);
			if (!response.ok || response.status != 200) {
				throw new Error(`HTTP ${response.status}`);
			} else {
				const json = await response.json();
				const pages = json.query.pages;
				const page = pages[Object.keys(pages)[0]];
				if (page.hasOwnProperty('missing')) {
					throw new Error(`Page not found`);
				}
				let title = page.title;
				if (lang !== 'pt') {
					for (const langlink of (page.langlinks || [])) {
						if (langlink.lang == 'pt') {
							title = langlink['*'];
							lang = 'pt';
							break;
						}
					}
				}
				replaces.push([name, `https://${lang}.wikipedia.org/wiki/${title.replace(/ /g, '_')}`]);
			}
		} catch (e) {
			console.error(`Error resolving file ${filepath}: ${e.message}`);
			replaces.push([null, null]);
		}
	}
	const newContent = content.replace(re, (match) => {
		const [name, url] = replaces.shift();
		if (!name) {
			return match;
		}
		return `[${name}](${safeUrl(url)})`;
	})
	if (newContent == content) {
		return;
	}
	fs.writeFileSync(filepath, newContent);
}

await walk(root, resolve);

Related issues and pull requests

Part of #7287

@github-actions github-actions bot added the l10n-pt-br Issues related to Brazilian Portuguese label Jun 24, 2023
@yin1999 yin1999 marked this pull request as ready for review June 24, 2023 13:01
@yin1999 yin1999 requested a review from a team as a code owner June 24, 2023 13:01
@yin1999 yin1999 requested review from nathipg and removed request for a team June 24, 2023 13:01
@yin1999 yin1999 mentioned this pull request Jun 24, 2023
9 tasks
@yin1999 yin1999 linked an issue Jun 24, 2023 that may be closed by this pull request
9 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Jun 24, 2023

Preview URLs (102 pages)
Flaws (365)

Note! 33 documents with no flaws that don't need to be listed. 🎉

URL: /pt-BR/docs/orphaned/Glossary/jQuery
Title: jQuery
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/Biblioteca does not exist
    • /pt-BR/docs/Glossary/Eventos does not exist

URL: /pt-BR/docs/Glossary/Opera_Browser
Title: Navegador Opera
Flaw count: 4

  • macros:
    • /pt-BR/docs/Glossary/navegador does not exist
    • /pt-BR/docs/Glossary/Blink does not exist but fell back to /en-US/docs/Glossary/Blink
    • /pt-BR/docs/Glossary/Presto does not exist but fell back to /en-US/docs/Glossary/Presto
  • broken_links:
    • Is currently http:// but can become https://

URL: /pt-BR/docs/Glossary/Apple_Safari
Title: Apple Safari
Flaw count: 5

  • macros:
    • /pt-BR/docs/Glossary/navegador does not exist
  • broken_links:
    • Is currently http:// but can become https://
    • Is currently http:// but can become https://
    • Is currently http:// but can become https://
    • Is currently http:// but can become https://

URL: /pt-BR/docs/Glossary/Value
Title: Valor
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/Vari%C3%A1vel does not exist
    • /pt-BR/docs/Glossary/Object_reference does not exist but fell back to /en-US/docs/Glossary/Object_reference

URL: /pt-BR/docs/Glossary/PHP
Title: PHP
Flaw count: 1

  • broken_links:
    • Can't resolve /pt-BR/docs/Glossario/PHP

URL: /pt-BR/docs/Glossary/Browser
Title: Navegador
Flaw count: 6

  • macros:
    • /pt-BR/docs/Glossary/World_Wide_Web does not exist but fell back to /en-US/docs/Glossary/World_Wide_Web
    • /pt-BR/docs/Glossary/hyperlink does not exist but fell back to /en-US/docs/Glossary/Hyperlink
  • broken_links:
    • Is currently http:// but can become https://
    • Is currently http:// but can become https://
    • Is currently http:// but can become https://
    • Is currently http:// but can become https://

URL: /pt-BR/docs/Glossary/HTTP
Title: HTTP
Flaw count: 3

  • macros:
    • /pt-BR/docs/Glossary/protocolo does not exist
    • /pt-BR/docs/Glossary/World_Wide_Web does not exist but fell back to /en-US/docs/Glossary/World_Wide_Web
    • /pt-BR/docs/Glossary/SSL does not exist but fell back to /en-US/docs/Glossary/SSL

URL: /pt-BR/docs/Glossary/Number
Title: Number
Flaw count: 1

  • broken_links:
    • Anchor not lowercase

URL: /pt-BR/docs/Glossary/Server
Title: Servidor
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/protocolo does not exist
  • broken_links:
    • Can't resolve /en-US/Learn/What_is_a_web_server

URL: /pt-BR/docs/Glossary/API
Title: API
Flaw count: 1

  • macros:
    • /pt-BR/docs/Glossary/method does not exist but fell back to /en-US/docs/Glossary/Method

URL: /pt-BR/docs/Glossary/Alpha
Title: Alpha (canal alfa)
Flaw count: 1

  • broken_links:
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/OTA
Title: OTA
Flaw count: 1

  • broken_links:
    • Can't resolve /pt-BR/Firefox_OS/Construindo_e_instalando_o_Firefox_OS/Criando_e_aplicando_pacotes_de_atualizacao_Firefox_OS

URL: /pt-BR/docs/Glossary/CORS
Title: CORS
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/Header does not exist but fell back to /en-US/docs/Glossary/HTTP_header
  • broken_links:
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/Domain_name
Title: Nome de domínio
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/TLD does not exist but fell back to /en-US/docs/Glossary/TLD
  • broken_links:
    • Can't resolve /en-US/Learn/Understanding_domain_names

URL: /pt-BR/docs/Glossary/Variable
Title: Variável
Flaw count: 1

  • broken_links:
    • Anchor not lowercase

URL: /pt-BR/docs/Glossary/W3C
Title: W3C
Flaw count: 1

  • macros:
    • /pt-BR/docs/Glossary/World_Wide_Web does not exist but fell back to /en-US/docs/Glossary/World_Wide_Web

URL: /pt-BR/docs/Glossary/WebSockets
Title: WebSockets
Flaw count: 5

  • macros:
    • /pt-BR/docs/Glossary/protocolo does not exist
    • /pt-BR/docs/Glossary/servidor does not exist
    • /pt-BR/docs/Glossary/Navegador does not exist
  • broken_links:
    • Can use the English (en-US) link as a fallback
    • Can't resolve /pt-BR/docs/WebSockets/Writing_WebSocket_servers

URL: /pt-BR/docs/Glossary/Caret
Title: caret
Flaw count: 9

  • macros:
    • /pt-BR/docs/Web/CSS/caret-color does not exist but fell back to /en-US/docs/Web/CSS/caret-color
  • broken_links:
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • and 3 more flaws omitted

URL: /pt-BR/docs/Glossary/Object
Title: Objeto
Flaw count: 1

  • broken_links:
    • Anchor not lowercase

URL: /pt-BR/docs/Glossary/URI
Title: URI
Flaw count: 4

  • macros:
    • /pt-BR/docs/Glossary/URN does not exist but fell back to /en-US/docs/Glossary/URN
  • broken_links:
    • Is currently http:// but can become https://
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/Argument
Title: Argumento
Flaw count: 4

  • macros:
    • /pt-BR/docs/Glossary/valor does not exist
    • /pt-BR/docs/Glossary/primitivo does not exist
    • /pt-BR/docs/Glossary/objeto does not exist
    • /pt-BR/docs/Glossary/fun%C3%A7%C3%A3o does not exist

URL: /pt-BR/docs/Glossary/Graceful_degradation
Title: Degradação graciosa
Flaw count: 5

  • macros:
    • /pt-BR/docs/Glossary/Progressive_enhancement does not exist but fell back to /en-US/docs/Glossary/Progressive_Enhancement
    • /pt-BR/docs/Glossary/Progressive_enhancement does not exist but fell back to /en-US/docs/Glossary/Progressive_Enhancement
  • broken_links:
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/Semantics
Title: Semântica
Flaw count: 5

  • macros:
    • /pt-BR/docs/Web/HTML/Element/h1 does not exist but fell back to /en-US/docs/Web/HTML/Element/Heading_Elements
    • /pt-BR/docs/Web/HTML/Element/h1 does not exist but fell back to /en-US/docs/Web/HTML/Element/Heading_Elements
  • broken_links:
    • Can use the English (en-US) link as a fallback
    • Anchor not lowercase
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/Scope
Title: Escopo
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/execute does not exist
    • /pt-BR/docs/Glossary/valor does not exist

URL: /pt-BR/docs/Glossary/Three_js
Title: Three js
Flaw count: 3

  • macros:
    • /pt-BR/docs/Glossary/WebGL does not exist but fell back to /en-US/docs/Glossary/WebGL
    • /pt-BR/docs/Glossary/navegador does not exist
  • broken_links:
    • Is currently http:// but can become https://

URL: /pt-BR/docs/Glossary/HTTPS
Title: HTTPS
Flaw count: 1

  • macros:
    • /pt-BR/docs/Glossary/SSL does not exist but fell back to /en-US/docs/Glossary/SSL

URL: /pt-BR/docs/Glossary/Endianness
Title: Endianness
Flaw count: 1

  • broken_links:
    • Can't resolve /pt-BR/docs/Web/JavaScript/Typed_arrays

URL: /pt-BR/docs/Glossary/TLS
Title: TLS
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/Digital_certificate does not exist but fell back to /en-US/docs/Glossary/Digital_certificate
  • broken_links:
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/Recursion
Title: Recursão
Flaw count: 1

  • broken_links:
    • Anchor not lowercase

URL: /pt-BR/docs/Glossary/IPv6
Title: IPv6
Flaw count: 1

  • macros:
    • /pt-BR/docs/Glossary/Endere%C3%A7o_IP does not exist

URL: /pt-BR/docs/Glossary/Abstraction
Title: Abstração
Flaw count: 1

  • macros:
    • /pt-BR/docs/Glossary/programa%C3%A7%C3%A3o_de_computadores does not exist

URL: /pt-BR/docs/Glossary/DOM
Title: DOM
Flaw count: 5

  • macros:
    • /pt-BR/docs/Glossary/navegador does not exist
    • /pt-BR/docs/Glossary/elemento does not exist
    • /pt-BR/docs/Glossary/World_Wide_Web does not exist but fell back to /en-US/docs/Glossary/World_Wide_Web
    • /pt-BR/docs/Glossary/navegador does not exist
  • broken_links:
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/Domain
Title: Domínio
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/DNS does not exist but fell back to /en-US/docs/Glossary/DNS
    • /pt-BR/docs/Glossary/World_Wide_Web does not exist but fell back to /en-US/docs/Glossary/World_Wide_Web

URL: /pt-BR/docs/Glossary/CSS
Title: CSS
Flaw count: 3

  • macros:
    • /pt-BR/docs/Glossary/CSS_Property does not exist but fell back to /en-US/docs/Glossary/Property/CSS
    • /pt-BR/docs/Glossary/selector does not exist
  • broken_links:
    • Can't resolve /pt-BR/docs/Aprender/CSS

URL: /pt-BR/docs/Glossary/AJAX
Title: AJAX
Flaw count: 1

  • broken_links:
    • Can't resolve /pt-BR/docs/AJAX

URL: /pt-BR/docs/Glossary/Node.js
Title: Node.js
Flaw count: 1

  • macros:
    • /pt-BR/docs/Glossary/Servidor does not exist

URL: /pt-BR/docs/Glossary/Array
Title: Array
Flaw count: 3

  • macros:
    • /pt-BR/docs/Glossary/primitivo does not exist
    • /pt-BR/docs/Glossary/objeto does not exist
    • /pt-BR/docs/Glossary/Method does not exist but fell back to /en-US/docs/Glossary/Method

URL: /pt-BR/docs/Glossary/HTML
Title: HTML
Flaw count: 5

  • macros:
    • /pt-BR/docs/Glossary/hipertexto does not exist
    • /pt-BR/docs/Glossary/World_Wide_Web does not exist but fell back to /en-US/docs/Glossary/World_Wide_Web
    • /pt-BR/docs/Glossary/IETF does not exist but fell back to /en-US/docs/Glossary/IETF
    • /pt-BR/docs/Glossary/HTML5 does not exist but fell back to /en-US/docs/Glossary/HTML5
  • broken_links:
    • Can't resolve /pt-BR/docs/Aprender/HTML

URL: /pt-BR/docs/Glossary/IIFE
Title: IIFE
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/Design_Pattern does not exist
  • broken_links:
    • Can't resolve /pt-BR/docs/Web/JavaScript/A_re-introduction_to_JavaScript#Functions

URL: /pt-BR/docs/Glossary/IPv4
Title: IPv4
Flaw count: 1

  • macros:
    • /pt-BR/docs/Glossary/protocolo does not exist

URL: /pt-BR/docs/Glossary/SEO
Title: SEO - Otimização dos Mecanismos de Buscas
Flaw count: 1

  • macros:
    • /pt-BR/docs/Glossary/Crawler does not exist but fell back to /en-US/docs/Glossary/Crawler

URL: /pt-BR/docs/Glossary/Viewport
Title: Viewport
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/Visual_Viewport does not exist but fell back to /en-US/docs/Glossary/Visual_Viewport
  • broken_links:
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/Accessibility
Title: Acessibilidade
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/WAI does not exist but fell back to /en-US/docs/Glossary/WAI
  • broken_links:
    • Is currently http:// but can become https://

URL: /pt-BR/docs/Glossary/JavaScript
Title: JavaScript
Flaw count: 4

  • macros:
    • /pt-BR/docs/Glossary/canvas does not exist but fell back to /en-US/docs/Glossary/Canvas
    • /pt-BR/docs/Glossary/Microsoft_Internet_Explorer does not exist but fell back to /en-US/docs/Glossary/Microsoft_Internet_Explorer
    • /pt-BR/docs/Glossary/Web_Sockets does not exist but fell back to /en-US/docs/Glossary/WebSockets
  • broken_links:
    • Is currently http:// but can become https://

URL: /pt-BR/docs/Glossary/Property/JavaScript
Title: Propriedade (JavaScript)
Flaw count: 3

  • macros:
    • /pt-BR/docs/Glossary/method does not exist but fell back to /en-US/docs/Glossary/Method
    • /pt-BR/docs/Glossary/object_reference does not exist but fell back to /en-US/docs/Glossary/Object_reference
  • broken_links:
    • Can't resolve /pt-BR/docs/Aprender/JavaScript/Objetos

URL: /pt-BR/docs/Glossary/ASCII
Title: ASCII
Flaw count: 1

  • broken_links:
    • Can't resolve /pt-BR/docs/Glossario/UTF-8

URL: /pt-BR/docs/Glossary/URL
Title: URL
Flaw count: 3

  • macros:
    • /pt-BR/docs/Glossary/FTP does not exist but fell back to /en-US/docs/Glossary/FTP
    • /pt-BR/docs/Glossary/SMTP does not exist but fell back to /en-US/docs/Glossary/SMTP
  • broken_links:
    • Can't resolve /en-US/Learn/Understanding_URLs

URL: /pt-BR/docs/Glossary/String
Title: String
Flaw count: 1

  • broken_links:
    • Anchor not lowercase

URL: /pt-BR/docs/Glossary/Cache
Title: Cache
Flaw count: 1

  • broken_links:
    • Can't resolve /pt-BR/docs/Glossario/CSS

URL: /pt-BR/docs/Glossary/BigInt
Title: BigInt
Flaw count: 1

  • broken_links:
    • Anchor not lowercase

URL: /pt-BR/docs/Glossary/UTF-8
Title: UTF-8
Flaw count: 3

  • broken_links:
    • Can't resolve /pt-BR/docs/Glossario/character_encoding
    • Can't resolve /pt-BR/docs/Glossario/ASCII
    • Is currently http:// but can become https://

URL: /pt-BR/docs/Glossary/Identifier
Title: Identificador (Identifier)
Flaw count: 3

  • macros:
    • /pt-BR/docs/Glossary/vari%C3%A1vel does not exist
    • /pt-BR/docs/Glossary/fun%C3%A7%C3%A3o does not exist
    • /pt-BR/docs/Glossary/propriedade does not exist

URL: /pt-BR/docs/Glossary/OOP
Title: OOP
Flaw count: 2

  • broken_links:
    • Can't resolve /pt-BR/docs/Web/JavaScript/Guide/Details_of_the_Object_Model#Class-based_vs._prototype-based_languages
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/Gecko
Title: Gecko
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/Firefox_OS does not exist but fell back to /en-US/docs/Glossary/Firefox_OS
  • broken_links:
    • Can't resolve /pt-BR/docs/Mozilla/Gecko

URL: /pt-BR/docs/Glossary/ECMA
Title: ECMA
Flaw count: 3

  • macros:
    • /pt-BR/docs/Glossary/ECMAScript does not exist but fell back to /en-US/docs/Glossary/ECMAScript
  • broken_links:
    • Is currently http:// but can become https://
    • Is currently http:// but can become https://

URL: /pt-BR/docs/Glossary/SDP
Title: SDP
Flaw count: 5

  • macros:
    • /pt-BR/docs/Glossary/P2P does not exist but fell back to /en-US/docs/Glossary/P2P
    • /pt-BR/docs/Glossary/codec does not exist but fell back to /en-US/docs/Glossary/Codec
    • /pt-BR/docs/Glossary/RTP does not exist but fell back to /en-US/docs/Glossary/RTP
    • /pt-BR/docs/Glossary/RTSP does not exist but fell back to /en-US/docs/Glossary/RTSP
  • broken_links:
    • Can use the English (en-US) link as a fallback

URL: /pt-BR/docs/Glossary/SVG
Title: SVG
Flaw count: 2

  • macros:
    • /pt-BR/docs/Glossary/Microsoft_Internet_Explorer does not exist but fell back to /en-US/docs/Glossary/Microsoft_Internet_Explorer
    • /pt-BR/docs/Glossary/responsive_design does not exist but fell back to /en-US/docs/Glossary/Responsive_web_design

URL: /pt-BR/docs/Learn/HTML/Multimedia_and_embedding/Other_embedding_technologies
Title: Do objeto ao iframe - outras tecnologias de incorporação
Flaw count: 154

  • macros:
    • /pt-BR/docs/Learn/HTML/Introduction_to_HTML/Marking_up_a_letter does not exist but fell back to /en-US/docs/Learn/HTML/Introduction_to_HTML/Marking_up_a_letter
    • /pt-BR/docs/Learn/HTML/Introduction_to_HTML/Structuring_a_page_of_content does not exist but fell back to /en-US/docs/Learn/HTML/Introduction_to_HTML/Structuring_a_page_of_content
    • /pt-BR/docs/Learn/HTML/Multimedia_and_embedding/Mozilla_splash_page does not exist but fell back to /en-US/docs/Learn/HTML/Multimedia_and_embedding/Mozilla_splash_page
    • /pt-BR/docs/Learn/HTML/Tables/Advanced does not exist but fell back to /en-US/docs/Learn/HTML/Tables/Advanced
    • /pt-BR/docs/Learn/HTML/Tables/Structuring_planet_data does not exist but fell back to /en-US/docs/Learn/HTML/Tables/Structuring_planet_data
    • and 122 more flaws omitted
  • broken_links:
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • No need for the pathname in anchor links if it's the same page
    • Can use the English (en-US) link as a fallback
    • and 21 more flaws omitted
  • translation_differences:
    • Differences in the important macros (1 in common of 3 possible)

URL: /pt-BR/docs/Web/HTTP/Headers/Referrer-Policy
Title: Referrer-Policy
Flaw count: 12

  • macros:
    • /pt-BR/docs/Glossary/Response_header does not exist but fell back to /en-US/docs/Glossary/Response_header
    • /pt-BR/docs/Glossary/path does not exist
    • /pt-BR/docs/Glossary/querystring does not exist
    • /pt-BR/docs/Glossary/Same-origin_policy does not exist but fell back to /en-US/docs/Glossary/Same-origin_policy
    • Calling the Compat macro with any arguments is deprecated; instead use the 'browser-compat' front-matter key.
    • and 1 more flaws omitted
  • broken_links:
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
  • translation_differences:
    • Differences in the important macros (1 in common of 4 possible)

URL: /pt-BR/docs/Web/HTTP/Headers/Referer
Title: Referer
Flaw count: 3

  • macros:
    • Calling the Compat macro with any arguments is deprecated; instead use the 'browser-compat' front-matter key.
  • broken_links:
    • Can use the English (en-US) link as a fallback
  • translation_differences:
    • Differences in the important macros (1 in common of 4 possible)

URL: /pt-BR/docs/Web/HTTP/Status/502
Title: 502 Bad Gateway
Flaw count: 2

  • macros:
    • Calling the Compat macro with any arguments is deprecated; instead use the 'browser-compat' front-matter key.
  • translation_differences:
    • Differences in the important macros (1 in common of 4 possible)

URL: /pt-BR/docs/Web/HTTP/Status/418
Title: 418 I'm a teapot
Flaw count: 2

  • macros:
    • Calling the Compat macro with any arguments is deprecated; instead use the 'browser-compat' front-matter key.
  • translation_differences:
    • Differences in the important macros (1 in common of 4 possible)

URL: /pt-BR/docs/Web/HTTP/Status/451
Title: 451 Unavailable For Legal Reasons
Flaw count: 2

  • macros:
    • Calling the Compat macro with any arguments is deprecated; instead use the 'browser-compat' front-matter key.
  • translation_differences:
    • Differences in the important macros (1 in common of 4 possible)

URL: /pt-BR/docs/Web/HTTP/Status/504
Title: 504 Gateway Timeout
Flaw count: 2

  • macros:
    • Calling the Compat macro with any arguments is deprecated; instead use the 'browser-compat' front-matter key.
  • translation_differences:
    • Differences in the important macros (1 in common of 4 possible)

URL: /pt-BR/docs/Web/HTTP/Status/404
Title: 404 Not Found
Flaw count: 3

  • macros:
    • Calling the Compat macro with any arguments is deprecated; instead use the 'browser-compat' front-matter key.
  • broken_links:
    • Can't resolve /pt-BR/404
  • translation_differences:
    • Differences in the important macros (1 in common of 4 possible)

URL: /pt-BR/docs/Web/API/Element/innerHTML
Title: Element.innerHTML
Flaw count: 7

  • macros:
    • /pt-BR/docs/Web/HTML/Element/noembed does not exist but fell back to /en-US/docs/Web/HTML/Element/noembed
    • This macro has been deprecated, and should be removed.
    • This macro has been deprecated, and should be removed.
  • broken_links:
    • Can use the English (en-US) link as a fallback
    • Is currently http:// but can become https://
    • Is currently http:// but can become https://
  • translation_differences:
    • Differences in the important macros (1 in common of 4 possible)

URL: /pt-BR/docs/Web/HTML/microformats
Title: Microformatos
Flaw count: 18

  • macros:
    • /pt-BR/docs/Web/HTML/Attributes/accept does not exist but fell back to /en-US/docs/Web/HTML/Attributes/accept
    • /pt-BR/docs/Web/HTML/Attributes/autocomplete does not exist but fell back to /en-US/docs/Web/HTML/Attributes/autocomplete
    • /pt-BR/docs/Web/HTML/Attributes/capture does not exist but fell back to /en-US/docs/Web/HTML/Attributes/capture
    • /pt-BR/docs/Web/HTML/Attributes/crossorigin does not exist but fell back to /en-US/docs/Web/HTML/Attributes/crossorigin
    • /pt-BR/docs/Web/HTML/Attributes/disabled does not exist but fell back to /en-US/docs/Web/HTML/Attributes/disabled
    • and 13 more flaws omitted

URL: /pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Math/cos
Title: Math.cos()
Flaw count: 10

  • macros:
    • This macro has been deprecated, and should be removed.
    • This macro has been deprecated, and should be removed.
    • This macro has been deprecated, and should be removed.
    • This macro has been deprecated, and should be removed.
    • This macro has been deprecated, and should be removed.
    • and 4 more flaws omitted
  • translation_differences:
    • Differences in the important macros (1 in common of 4 possible)

URL: /pt-BR/docs/Web/JavaScript/Reference/Global_Objects/String/length
Title: String.length
Flaw count: 8

  • macros:
    • This macro has been deprecated, and should be removed.
    • This macro has been deprecated, and should be removed.
    • This macro has been deprecated, and should be removed.
    • This macro has been deprecated, and should be removed.
    • This macro has been deprecated, and should be removed.
    • and 2 more flaws omitted
  • translation_differences:
    • Differences in the important macros (0 in common of 4 possible)
External URLs (98)

URL: /pt-BR/docs/orphaned/Glossary/jQuery
Title: jQuery


URL: /pt-BR/docs/conflicting/Web/JavaScript/Reference/Global_Objects/Symbol
Title: Symbol


URL: /pt-BR/docs/Glossary/Opera_Browser
Title: Navegador Opera


URL: /pt-BR/docs/Glossary/Apple_Safari
Title: Apple Safari


URL: /pt-BR/docs/Glossary/Vendor_Prefix
Title: Prefixos vendor


URL: /pt-BR/docs/Glossary/Value
Title: Valor


URL: /pt-BR/docs/Glossary/PHP
Title: PHP


URL: /pt-BR/docs/Glossary/Browser
Title: Navegador


URL: /pt-BR/docs/Glossary/HTTP
Title: HTTP


URL: /pt-BR/docs/Glossary/Number
Title: Number


URL: /pt-BR/docs/Glossary/Server
Title: Servidor


URL: /pt-BR/docs/Glossary/API
Title: API


URL: /pt-BR/docs/Glossary/Alpha
Title: Alpha (canal alfa)


URL: /pt-BR/docs/Glossary/OpenGL
Title: OpenGL


URL: /pt-BR/docs/Glossary/Prototype
Title: Prototype


URL: /pt-BR/docs/Glossary/OTA
Title: OTA


URL: /pt-BR/docs/Glossary/CORS
Title: CORS


URL: /pt-BR/docs/Glossary/Bandwidth
Title: Bandwidth


URL: /pt-BR/docs/Glossary/HSTS
Title: HSTS


URL: /pt-BR/docs/Glossary/Callback_function
Title: Função Callback


URL: /pt-BR/docs/Glossary/W3C
Title: W3C


URL: /pt-BR/docs/Glossary/CRUD
Title: CRUD


URL: /pt-BR/docs/Glossary/Wrapper
Title: Wrapper


URL: /pt-BR/docs/Glossary/WebSockets
Title: WebSockets


URL: /pt-BR/docs/Glossary/Tag
Title: Tag


URL: /pt-BR/docs/Glossary/Caret
Title: caret


URL: /pt-BR/docs/Glossary/Operand
Title: Operando


URL: /pt-BR/docs/Glossary/URI
Title: URI


URL: /pt-BR/docs/Glossary/JPEG
Title: JPEG


URL: /pt-BR/docs/Glossary/Graceful_degradation
Title: Degradação graciosa


URL: /pt-BR/docs/Glossary/Metadata
Title: Metadata


URL: /pt-BR/docs/Glossary/TCP
Title: TCP


URL: /pt-BR/docs/Glossary/Semantics
Title: Semântica


URL: /pt-BR/docs/Glossary/Three_js
Title: Three js


URL: /pt-BR/docs/Glossary/HTTPS
Title: HTTPS


URL: /pt-BR/docs/Glossary/TLS
Title: TLS


URL: /pt-BR/docs/Glossary/Character
Title: Caractere


URL: /pt-BR/docs/Glossary/Port
Title: Port


URL: /pt-BR/docs/Glossary/HTTP_2
Title: HTTP/2


URL: /pt-BR/docs/Glossary/Arpanet
Title: Arpanet


URL: /pt-BR/docs/Glossary/Call_stack
Title: Call stack (Pilha de chamadas)


URL: /pt-BR/docs/Glossary/SGML
Title: SGML


URL: /pt-BR/docs/Glossary/IPv6
Title: IPv6


URL: /pt-BR/docs/Glossary/DOM
Title: DOM


URL: /pt-BR/docs/Glossary/Domain
Title: Domínio


URL: /pt-BR/docs/Glossary/CSS
Title: CSS


URL: /pt-BR/docs/Glossary/AJAX
Title: AJAX


URL: /pt-BR/docs/Glossary/Node.js
Title: Node.js


URL: /pt-BR/docs/Glossary/HTML
Title: HTML


URL: /pt-BR/docs/Glossary/IIFE
Title: IIFE


URL: /pt-BR/docs/Glossary/XMLHttpRequest
Title: XHR (XMLHttpRequest)


URL: /pt-BR/docs/Glossary/IPv4
Title: IPv4


URL: /pt-BR/docs/Glossary/SEO
Title: SEO - Otimização dos Mecanismos de Buscas


URL: /pt-BR/docs/Glossary/Operator
Title: Operador


URL: /pt-BR/docs/Glossary/Viewport
Title: Viewport


URL: /pt-BR/docs/Glossary/Accessibility
Title: Acessibilidade


URL: /pt-BR/docs/Glossary/JavaScript
Title: JavaScript


URL: /pt-BR/docs/Glossary/REST
Title: REST


URL: /pt-BR/docs/Glossary/ASCII
Title: ASCII


URL: /pt-BR/docs/Glossary/URL
Title: URL


URL: /pt-BR/docs/Glossary/String
Title: String


URL: /pt-BR/docs/Glossary/Cache
Title: Cache


URL: /pt-BR/docs/Glossary/BigInt
Title: BigInt


URL: /pt-BR/docs/Glossary/UTF-8
Title: UTF-8


URL: /pt-BR/docs/Glossary/Identifier
Title: Identificador (Identifier)


URL: /pt-BR/docs/Glossary/Python
Title: Python


URL: /pt-BR/docs/Glossary/Keyword
Title: Palavra-chave


URL: /pt-BR/docs/Glossary/Gecko
Title: Gecko


URL: /pt-BR/docs/Glossary/ECMA
Title: ECMA


URL: /pt-BR/docs/Glossary/WHATWG
Title: WHATWG


URL: /pt-BR/docs/Glossary/SDP
Title: SDP


URL: /pt-BR/docs/Glossary/SVG
Title: SVG


URL: /pt-BR/docs/Learn/HTML/Multimedia_and_embedding/Other_embedding_technologies
Title: Do objeto ao iframe - outras tecnologias de incorporação


URL: /pt-BR/docs/Web/HTTP/Headers/Referrer-Policy
Title: Referrer-Policy


URL: /pt-BR/docs/Web/HTTP/Headers/Referer
Title: Referer


URL: /pt-BR/docs/Web/HTTP/Status/502
Title: 502 Bad Gateway


URL: /pt-BR/docs/Web/HTTP/Status/418
Title: 418 I'm a teapot


URL: /pt-BR/docs/Web/HTTP/Status/451
Title: 451 Unavailable For Legal Reasons


URL: /pt-BR/docs/Web/HTTP/Status/504
Title: 504 Gateway Timeout


URL: /pt-BR/docs/Web/HTTP/Status/404
Title: 404 Not Found


URL: /pt-BR/docs/Web/API/Element/innerHTML
Title: Element.innerHTML


URL: /pt-BR/docs/Web/HTML/microformats
Title: Microformatos


URL: /pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Math/cos
Title: Math.cos()


URL: /pt-BR/docs/Web/JavaScript/Reference/Global_Objects/String/length
Title: String.length

(comment last updated: 2023-07-03 01:18:33)

Copy link
Collaborator

@josielrocha josielrocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your help @yin1999!

I made some suggestions. Could you please review them?

@@ -10,7 +10,7 @@ No {{Glossary("JavaScript")}}, **BigInt** é um tipo de dado numérico que repre

### General knowledge

- {{Interwiki("wikipedia", "Data type#Numeric_types", "Numeric types")}} no Wikipedia
- [Numeric types](https://pt.wikipedia.org/wiki/Data_type#Numeric_types) no Wikipedia
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL does not exist in pt-BR

Suggested change
- [Numeric types](https://pt.wikipedia.org/wiki/Data_type#Numeric_types) no Wikipedia
- [Numeric types](https://en.wikipedia.org/wiki/Data_type#Numeric_types) no Wikipedia

3. "developer" é um "sub-domínio", algo que você como dono de um domínio pode definir sozinho. Muitos donos de domínio escolhem ter um subdomínio "www" apontando para o recurso {{Glossary("World_Wide_Web")}}, mas isso não é obrigatório (e tem caído em desuso).

## Saiba mais

- {{interwiki("wikipedia", "Domain_name", "Nome de domínio")}} na Wikipedia
- [Nome de domínio](https://pt.wikipedia.org/wiki/Domain_name) na Wikipedia
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL does not exist in pt-BR

Suggested change
- [Nome de domínio](https://pt.wikipedia.org/wiki/Domain_name) na Wikipedia
- [Nome de domínio](https://en.wikipedia.org/wiki/Domain_name) na Wikipedia

@@ -92,4 +92,4 @@ Estamos usando parênteses duplo `()()` pra chamar também a função retornada.

### Conhecimento geral

- {{Interwiki("wikipedia", "First-class_function", "First-class functions")}} na Wikipedia
- [First-class functions](https://pt.wikipedia.org/wiki/First-class_function) na Wikipedia
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL does not exist in pt-BR

Suggested change
- [First-class functions](https://pt.wikipedia.org/wiki/First-class_function) na Wikipedia
- [First-class functions](https://en.wikipedia.org/wiki/First-class_function) na Wikipedia

@@ -11,7 +11,7 @@ original_slug: Glossario/degradação_graciosa
É uma técnica útil que permite aos desenvolvedores da Web se concentrarem no desenvolvimento dos melhores sites possíveis, uma vez que esses sites são acessados por vários user-agents desconhecidos.
{{Glossary("Progressive enhancement")}} está relacionado, mas é diferente - geralmente visto como na direção oposta à degradação graciosa. Na realidade, ambas as abordagens são válidas e geralmente podem se complementar.

1. {{Interwiki("wikipedia", "Graceful degradation")}} on Wikipedia
1. [Graceful degradation](https://pt.wikipedia.org/wiki/Graceful_degradation) on Wikipedia
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL does not exist in pt-BR

Suggested change
1. [Graceful degradation](https://pt.wikipedia.org/wiki/Graceful_degradation) on Wikipedia
1. [Graceful degradation](https://en.wikipedia.org/wiki/Fault_tolerance) on Wikipedia

@@ -12,4 +12,4 @@ Em outras palavras, ele diz ao navegador que apenas altere o protocolo de HTTP p

- {{HTTPHeader("Strict-Transport-Security")}}
- Artigo OWASP: [HTTP Strict Transport Security](https://www.owasp.org/index.php/HTTP_Strict_Transport_Security)
- Wikipedia: {{interwiki("wikipedia", "HTTP Strict Transport Security")}}
- Wikipedia: [HTTP Strict Transport Security](https://pt.wikipedia.org/wiki/HTTP_Strict_Transport_Security)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL does not exist in pt-BR

Suggested change
- Wikipedia: [HTTP Strict Transport Security](https://pt.wikipedia.org/wiki/HTTP_Strict_Transport_Security)
- Wikipedia: [HTTP Strict Transport Security](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security)

@@ -12,4 +12,4 @@ Por exemplo, as bibliotecas do SDK para AWS são exemplos de wrappers.

### Conhecimento Geral

{{Interwiki("wikipedia", "Wrapper function")}} em Wikipedia
[Wrapper function](https://pt.wikipedia.org/wiki/Wrapper_function) em Wikipedia
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL does not exist in pt-BR

Suggested change
[Wrapper function](https://pt.wikipedia.org/wiki/Wrapper_function) em Wikipedia
[Wrapper function](https://en.wikipedia.org/wiki/Wrapper_function) em Wikipedia

@@ -14,4 +14,4 @@ Isso é o oposto das linguagens denominadas **linguagens de programação estát

### Conhecimento geral

- {{Interwiki("wikipedia", "Linguagem de Programação Dinâmica")}} on Wikipedia
- [Linguagem de Programação Dinâmica](https://pt.wikipedia.org/wiki/Linguagem_de_Programação_Dinâmica) on Wikipedia
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL does not exist. Should we remove it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we could remove this (actually, this document should be removed)

@@ -25,4 +25,4 @@ O código de erro HTTP para o cliente **`418 I'm a teapot`** indica que o servid

## Veja também

- {{interwiki("wikipedia", "Hyper Text Coffee Pot Control Protocol", "Wikipedia: Hyper Text Coffee Pot Control Protocol")}}
- [Wikipedia: Hyper Text Coffee Pot Control Protocol](https://pt.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL does not exist in pt-BR

Suggested change
- [Wikipedia: Hyper Text Coffee Pot Control Protocol](https://pt.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol)
- [Wikipedia: Hyper Text Coffee Pot Control Protocol](https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol)

@@ -7,7 +7,7 @@ slug: Web/HTTP/Status/504

O código de resposta de erro HTTP **`504 Gateway Timeout`** indica que o servidor, enquanto atuando como gateway ou proxy, não conseguiu responder em tempo.

Um {{interwiki("wikipedia", "Gateway_(telecommunications)", "Gateway")}} pode referir-se a diferentes elementos de rede e um erro 504 geralmente é algo que você não pode consertar, mas solicitar uma correção no servidor web ou proxy no qual você está tentando acessar.
Um [Gateway](<https://pt.wikipedia.org/wiki/Gateway_(telecommunications)>) pode referir-se a diferentes elementos de rede e um erro 504 geralmente é algo que você não pode consertar, mas solicitar uma correção no servidor web ou proxy no qual você está tentando acessar.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Um [Gateway](<https://pt.wikipedia.org/wiki/Gateway_(telecommunications)>) pode referir-se a diferentes elementos de rede e um erro 504 geralmente é algo que você não pode consertar, mas solicitar uma correção no servidor web ou proxy no qual você está tentando acessar.
Um [Gateway](<https://pt.wikipedia.org/wiki/Gateway>) pode referir-se a diferentes elementos de rede e um erro 504 geralmente é algo que você não pode consertar, mas solicitar uma correção no servidor web ou proxy no qual você está tentando acessar.

@@ -7,7 +7,7 @@ slug: Web/HTTP/Status/502

O código de erro HTTP **`502 Bad Gateway`** retornado pelo servidor indica que ele, enquanto atuando como um servidor intermediário (_gateway_ ou _proxy_), recebeu uma resposta inválida do servidor para o qual a requisição foi encaminhada (_upstream server_).

> **Nota:**Um {{interwiki("wikipedia", "Gateway_(telecommunications)", "<em>Gateway</em>")}} pode se referir a coisas diferentes na rede e um erro 502 geralmente não é algo que você possa corrigir, mas requer uma correção por parte do servidor web ou dos proxies através dos quais você está tentando obter acesso.
> **Nota:**Um [<em>Gateway</em>](<https://pt.wikipedia.org/wiki/Gateway_(telecommunications)>) pode se referir a coisas diferentes na rede e um erro 502 geralmente não é algo que você possa corrigir, mas requer uma correção por parte do servidor web ou dos proxies através dos quais você está tentando obter acesso.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> **Nota:**Um [<em>Gateway</em>](<https://pt.wikipedia.org/wiki/Gateway_(telecommunications)>) pode se referir a coisas diferentes na rede e um erro 502 geralmente não é algo que você possa corrigir, mas requer uma correção por parte do servidor web ou dos proxies através dos quais você está tentando obter acesso.
> **Nota:**Um [<em>Gateway</em>](<https://pt.wikipedia.org/wiki/Gateway>) pode se referir a coisas diferentes na rede e um erro 502 geralmente não é algo que você possa corrigir, mas requer uma correção por parte do servidor web ou dos proxies através dos quais você está tentando obter acesso.

@yin1999
Copy link
Member Author

yin1999 commented Jul 3, 2023

I made some suggestions. Could you please review them?

Sorry about this. I didn't check all the urls. I've made a mistake in the script (the api always return 200 even if the page is not existed, I've updated the script to resolve the problem. Hi @josielrocha, could you have a review on those changes :)

@josielrocha josielrocha merged commit 347949d into mdn:main Jul 9, 2023
@yin1999 yin1999 deleted the pt branch July 9, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n-pt-br Issues related to Brazilian Portuguese
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removal of {{Interwiki}} macro
2 participants