A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

64 řádky
2.4 KiB

  1. import toolforge_i18n
  2. from toolforge_i18n import (
  3. TranslationsConfig, # pyright: ignore[reportPrivateImportUsage]
  4. )
  5. def language_code_to_babel(code: str) -> str:
  6. mediawiki_to_babel = {
  7. "pms": "it", # 2026-09-01: Piedmontese, not supported
  8. }
  9. if code in mediawiki_to_babel:
  10. return mediawiki_to_babel[code]
  11. return toolforge_i18n.language_code_to_babel(code) # pyright: ignore[reportPrivateImportUsage]
  12. config = TranslationsConfig(
  13. variables={
  14. "login-error": ["error_text"],
  15. "settings-updated": ["changes"],
  16. "error-bad-action": ["action"],
  17. "error-invalid-oldid": ["oldid"],
  18. "error-unsupported-uri": ["url_target", "target_title"],
  19. "error-no-data": ["url_target", "target_title"],
  20. "error-timeout": ["url_target", "target_title"],
  21. "error-bad-site": ["project", "lang", "url_site"],
  22. "error-revision-not-found": ["url_revision", "revision_id"],
  23. "error-page-not-found": ["url_page", "page_title"],
  24. "error-search-error": ["error_cause", "url_no_engine"],
  25. "check-results-time": ["time"],
  26. "check-results-time-search": ["time", "num_queries"],
  27. "cached-line": ["tooltip_text", "time_abbr", "gen_time"],
  28. "cached-line-search": ["tooltip_text", "time_abbr", "gen_time", "num_queries"],
  29. "redirected-from": [
  30. "url_redirected_from",
  31. "redirected_from_title",
  32. "url_check_original",
  33. ],
  34. "attribution-warning": ["url_template", "template_title"],
  35. "turnitin-report": ["url_report", "report_id", "url_diff", "report_time"],
  36. "turnitin-source": ["percent", "word_count", "url_source", "source_title"],
  37. "search-ended-early": ["url_retry"],
  38. "urls-hidden": ["num_urls"],
  39. "ago-seconds": ["num"],
  40. "ago-minutes": ["num"],
  41. "ago-hours": ["num"],
  42. "maintained-by": ["url_author"],
  43. "error-description": ["url_issues", "url_new_issue", "url_email"],
  44. "intro-paragraph-1": ["url_copyright", "url_dupdet"],
  45. "intro-paragraph-3": ["url_exclusions"],
  46. "after-login-redirect": ["redirect_url"],
  47. "settings-background-list": ["url_potd_subset", "url_commons", "url_potd"],
  48. },
  49. allowed_html_elements={
  50. "abbr": {"title"},
  51. "b": set(),
  52. "br": set(),
  53. "code": set(),
  54. "i": set(),
  55. "strong": set(),
  56. "em": set(),
  57. },
  58. language_code_to_babel=language_code_to_babel,
  59. )