CINXE.COM

Checks and fixups - Weblate 5.8.2 documentation

<!doctype html> <html class="no-js" lang="en" data-content_root="../"> <head><meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1"/> <meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta property="og:title" content="Checks and fixups" /> <meta property="og:type" content="website" /> <meta property="og:url" content="https://docs.weblate.org/en/weblate-5.8.2/admin/checks.html" /> <meta property="og:site_name" content="Weblate" /> <meta property="og:description" content="Custom automatic fixups: You can also implement your own automatic fixup in addition to the standard ones and include them in AUTOFIX_LIST. The automatic fixes are powerful, but can also cause dama..." /> <meta property="og:image:width" content="1146" /> <meta property="og:image:height" content="600" /> <meta property="og:image" content="https://docs.weblate.org/en/weblate-5.8.2/_images/social_previews/summary_admin_checks_fce56781.png" /> <meta property="og:image:alt" content="Custom automatic fixups: You can also implement your own automatic fixup in addition to the standard ones and include them in AUTOFIX_LIST. The automatic fix..." /> <meta name="description" content="Custom automatic fixups: You can also implement your own automatic fixup in addition to the standard ones and include them in AUTOFIX_LIST. The automatic fixes are powerful, but can also cause dama..." /> <meta name="twitter:card" content="summary_large_image" /> <meta property="fb:app_id" content="741121112629028" /> <meta property="fb:page_id" content="371217713079025" /> <meta name="twitter:site" content="@WeblateOrg" /> <link rel="index" title="Index" href="../genindex.html" /><link rel="search" title="Search" href="../search.html" /><link rel="next" title="Automatic suggestions" href="machine.html" /><link rel="prev" title="Translation process" href="translating.html" /> <link rel="canonical" href="https://docs.weblate.org/en/weblate-5.8.2/admin/checks.html" /> <!-- Generated with Sphinx 8.1.3 and Furo 2024.08.06 --> <title>Checks and fixups - Weblate 5.8.2 documentation</title> <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=a746c00c" /> <link rel="stylesheet" type="text/css" href="../_static/styles/furo.css?v=354aac6f" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=4ae1632d" /> <link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="../_static/styles/furo-extensions.css?v=302659d7" /> <link rel="stylesheet" type="text/css" href="https://s.weblate.org/cdn/font-source/source-sans-3.css" /> <link rel="stylesheet" type="text/css" href="https://s.weblate.org/cdn/font-source/source-code-pro.css" /> <style> body { --color-code-background: #f8f8f8; --color-code-foreground: black; --font-stack: "Source Sans 3", sans-serif; --font-stack--monospace: "Source Code Pro", monospace; --color-brand-primary: #1fa385; --color-brand-content: #1fa385; } @media not print { body[data-theme="dark"] { --color-code-background: #202020; --color-code-foreground: #d0d0d0; --font-stack: "Source Sans 3", sans-serif; --font-stack--monospace: "Source Code Pro", monospace; --color-brand-primary: #1fa385; --color-brand-content: #1fa385; } @media (prefers-color-scheme: dark) { body:not([data-theme="light"]) { --color-code-background: #202020; --color-code-foreground: #d0d0d0; --font-stack: "Source Sans 3", sans-serif; --font-stack--monospace: "Source Code Pro", monospace; --color-brand-primary: #1fa385; --color-brand-content: #1fa385; } } } </style><script async type="text/javascript" src="/_/static/javascript/readthedocs-addons.js"></script><meta name="readthedocs-project-slug" content="weblate" /><meta name="readthedocs-version-slug" content="weblate-5.8.2" /><meta name="readthedocs-resolver-filename" content="/admin/checks.html" /><meta name="readthedocs-http-status" content="200" /></head> <body> <script> document.body.dataset.theme = localStorage.getItem("theme") || "auto"; </script> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <symbol id="svg-toc" viewBox="0 0 24 24"> <title>Contents</title> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024"> <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"> <title>Menu</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu"> <line x1="3" y1="12" x2="21" y2="12"></line> <line x1="3" y1="6" x2="21" y2="6"></line> <line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"> <title>Expand</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right"> <polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <symbol id="svg-sun" viewBox="0 0 24 24"> <title>Light mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun"> <circle cx="12" cy="12" r="5"></circle> <line x1="12" y1="1" x2="12" y2="3"></line> <line x1="12" y1="21" x2="12" y2="23"></line> <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line> <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line> <line x1="1" y1="12" x2="3" y2="12"></line> <line x1="21" y1="12" x2="23" y2="12"></line> <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line> <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line> </svg> </symbol> <symbol id="svg-moon" viewBox="0 0 24 24"> <title>Dark mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" /> </svg> </symbol> <symbol id="svg-sun-with-moon" viewBox="0 0 24 24"> <title>Auto light/dark, in light mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-custom-derived-from-feather-sun-and-tabler-moon"> <path style="opacity: 50%" d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"/> <line x1="14.5" y1="3.25" x2="14.5" y2="1.25"/> <line x1="14.5" y1="15.85" x2="14.5" y2="17.85"/> <line x1="10.044" y1="5.094" x2="8.63" y2="3.68"/> <line x1="19" y1="14.05" x2="20.414" y2="15.464"/> <line x1="8.2" y1="9.55" x2="6.2" y2="9.55"/> <line x1="20.8" y1="9.55" x2="22.8" y2="9.55"/> <line x1="10.044" y1="14.006" x2="8.63" y2="15.42"/> <line x1="19" y1="5.05" x2="20.414" y2="3.636"/> <circle cx="14.5" cy="9.55" r="3.6"/> </svg> </symbol> <symbol id="svg-moon-with-sun" viewBox="0 0 24 24"> <title>Auto light/dark, in dark mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-custom-derived-from-feather-sun-and-tabler-moon"> <path d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"/> <line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"/> <line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"/> <line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"/> <line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"/> <line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"/> <line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"/> <line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"/> <line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"/> <circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"/> </svg> </symbol> <symbol id="svg-pencil" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-pencil-code"> <path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" /> <path d="M13.5 6.5l4 4" /> <path d="M20 21l2 -2l-2 -2" /> <path d="M17 17l-2 2l2 2" /> </svg> </symbol> <symbol id="svg-eye" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-eye-code"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /> <path d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008" /> <path d="M20 21l2 -2l-2 -2" /> <path d="M17 17l-2 2l2 2" /> </svg> </symbol> </svg> <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation"> <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc"> <label class="overlay sidebar-overlay" for="__navigation"> <div class="visually-hidden">Hide navigation sidebar</div> </label> <label class="overlay toc-overlay" for="__toc"> <div class="visually-hidden">Hide table of contents sidebar</div> </label> <a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a> <div class="page"> <header class="mobile-header"> <div class="header-left"> <label class="nav-overlay-icon" for="__navigation"> <div class="visually-hidden">Toggle site navigation sidebar</div> <i class="icon"><svg><use href="#svg-menu"></use></svg></i> </label> </div> <div class="header-center"> <a href="../index.html"><div class="brand">Weblate 5.8.2 documentation</div></a> </div> <div class="header-right"> <div class="theme-toggle-container theme-toggle-header"> <button class="theme-toggle"> <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div> <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg> <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg> <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg> <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg> </button> </div> <label class="toc-overlay-icon toc-header-icon" for="__toc"> <div class="visually-hidden">Toggle table of contents sidebar</div> <i class="icon"><svg><use href="#svg-toc"></use></svg></i> </label> </div> </header> <aside class="sidebar-drawer"> <div class="sidebar-container"> <div class="sidebar-sticky"><a class="sidebar-brand" href="../index.html"> <div class="sidebar-logo-container"> <img class="sidebar-logo" src="../_static/logo-128.png" alt="Logo"/> </div> <span class="sidebar-brand-text">Weblate 5.8.2 documentation</span> </a><form class="sidebar-search-container" method="get" action="../search.html" role="search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input type="hidden" name="check_keywords" value="yes"> <input type="hidden" name="area" value="default"> </form> <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree"> <p class="caption" role="heading"><span class="caption-text">User docs</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../user/basic.html">Weblate basics</a></li> <li class="toctree-l1"><a class="reference internal" href="../user/profile.html">Registration and user profile</a></li> <li class="toctree-l1"><a class="reference internal" href="../user/translating.html">Translating using Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="../user/files.html">Downloading and uploading translations</a></li> <li class="toctree-l1"><a class="reference internal" href="../user/glossary.html">Glossary</a></li> <li class="toctree-l1"><a class="reference internal" href="../user/checks.html">Checks and fixups</a></li> <li class="toctree-l1"><a class="reference internal" href="../user/search.html">Searching</a></li> <li class="toctree-l1"><a class="reference internal" href="../workflows.html">Translation workflows</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq.html">Frequently Asked Questions</a></li> <li class="toctree-l1 has-children"><a class="reference internal" href="../formats.html">Supported file formats</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of Supported file formats</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2"><a class="reference internal" href="../formats/android.html">Android string resources</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/apple.html">Apple iOS strings</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/appstore.html">App store metadata files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/arb.html">ARB File</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/csv.html">CSV files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/dtd.html">DTD files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/excel.html">Excel Open XML</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/flatxml.html">Flat XML files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/fluent.html">Fluent format</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/formatjs.html">Format.JS JSON file</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/gettext.html">GNU gettext PO (Portable Object)</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/go-i18n.html">go-i18n JSON files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/gotext.html">gotext JSON files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/gwt.html">GWT properties</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/html.html">HTML files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/i18next.html">i18next JSON files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/idml.html">IDML Format</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/ini.html">INI translations</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/innosetup.html">Inno Setup INI translations</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/java.html">Java properties</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/joomla.html">Joomla translations</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/json.html">JSON files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/laravel.html">Laravel PHP strings</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/markdown.html">Markdown files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/mi18n.html">mi18n lang files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/moko.html">Mobile Kotlin resources</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/odf.html">OpenDocument Format</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/php.html">PHP strings</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/qt.html">Qt Linguist .ts</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/resourcedict.html">ResourceDictionary files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/resx.html">.NET resource files (RESX, RESW)</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/ruby.html">Ruby YAML files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/stringsdict.html">Stringsdict format</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/subtitles.html">Subtitle files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/tbx.html">TermBase eXchange format</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/txt.html">Text files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/webextension.html">WebExtension JSON</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/winrc.html">Windows RC files</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/xliff.html">XLIFF</a></li> <li class="toctree-l2"><a class="reference internal" href="../formats/yaml.html">YAML files</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../vcs.html">Version control integration</a></li> <li class="toctree-l1"><a class="reference internal" href="../api.html">Weblate’s REST API</a></li> <li class="toctree-l1"><a class="reference internal" href="../wlc.html">Weblate Client</a></li> <li class="toctree-l1"><a class="reference internal" href="../python.html">Weblate’s Python API</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Administrator docs</span></p> <ul class="current"> <li class="toctree-l1 has-children"><a class="reference internal" href="install.html">Configuration instructions</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle navigation of Configuration instructions</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2"><a class="reference internal" href="install/docker.html">Installing using Docker</a></li> <li class="toctree-l2"><a class="reference internal" href="install/venv-debian.html">Installing on Debian and Ubuntu</a></li> <li class="toctree-l2"><a class="reference internal" href="install/venv-suse.html">Installing on SUSE and openSUSE</a></li> <li class="toctree-l2"><a class="reference internal" href="install/venv-redhat.html">Installing on RedHat, Fedora and CentOS</a></li> <li class="toctree-l2"><a class="reference internal" href="install/venv-macos.html">Installing on macOS</a></li> <li class="toctree-l2"><a class="reference internal" href="install/source.html">Installing from sources</a></li> <li class="toctree-l2"><a class="reference internal" href="install/openshift.html">Installing on OpenShift</a></li> <li class="toctree-l2"><a class="reference internal" href="install/kubernetes.html">Installing on Kubernetes</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="deployments.html">Weblate deployments</a></li> <li class="toctree-l1"><a class="reference internal" href="upgrade.html">Upgrading Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="backup.html">Backing up and moving Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="auth.html">Authentication</a></li> <li class="toctree-l1"><a class="reference internal" href="auth.html#two-factor-authentication">Two-factor authentication</a></li> <li class="toctree-l1"><a class="reference internal" href="access.html">Access control</a></li> <li class="toctree-l1"><a class="reference internal" href="projects.html">Translation projects</a></li> <li class="toctree-l1"><a class="reference internal" href="languages.html">Language definitions</a></li> <li class="toctree-l1"><a class="reference internal" href="continuous.html">Continuous localization</a></li> <li class="toctree-l1"><a class="reference internal" href="licensing.html">Licensing translations</a></li> <li class="toctree-l1"><a class="reference internal" href="translating.html">Translation process</a></li> <li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Checks and fixups</a></li> <li class="toctree-l1"><a class="reference internal" href="machine.html">Automatic suggestions</a></li> <li class="toctree-l1"><a class="reference internal" href="addons.html">Add-ons</a></li> <li class="toctree-l1"><a class="reference internal" href="memory.html">Translation Memory</a></li> <li class="toctree-l1"><a class="reference internal" href="config.html">Configuration</a></li> <li class="toctree-l1"><a class="reference internal" href="sample.html">Sample configuration</a></li> <li class="toctree-l1"><a class="reference internal" href="management.html">Management commands</a></li> <li class="toctree-l1"><a class="reference internal" href="announcements.html">Announcements</a></li> <li class="toctree-l1"><a class="reference internal" href="componentlists.html">Component Lists</a></li> <li class="toctree-l1"><a class="reference internal" href="optionals.html">Optional Weblate modules</a></li> <li class="toctree-l1"><a class="reference internal" href="customize.html">Customizing Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="admin.html">Management interface</a></li> <li class="toctree-l1"><a class="reference internal" href="support.html">Getting support for Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="../legal.html">Legal documents</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Application developer guide</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../devel/starting.html">Starting with internationalization</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/integration.html">Integrating with Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/gettext.html">Translating software using GNU gettext</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/sphinx.html">Translating documentation using Sphinx</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/html.html">Translating HTML and JavaScript using Weblate CDN</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/thirdparty.html">Localization libraries and packages</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/alerts.html">Translation component alerts</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/community.html">Building a translators community</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/translations.html">Managing translations</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/review.html">Reviewing strings</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/share.html">Promoting the translation</a></li> <li class="toctree-l1"><a class="reference internal" href="../devel/reporting.html">Translation progress reporting</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Contributor docs</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/communication.html">Weblate Contributor Communication Guidelines</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/start.html">Starting contributing code to Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/code.html">Weblate source code</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/debugging.html">Debugging Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/internals.html">Weblate internals</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/addons.html">Developing add-ons</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/frontend.html">Weblate frontend</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/issues.html">Reporting issues in Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/tests.html">Weblate testsuite and continuous integration</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/schemas.html">Data schemas</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/release.html">Releasing Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/security.html">Security and privacy</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/modules.html">Contributing to Weblate modules</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/about.html">About Weblate</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/license.html">License</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/trademark.html">Weblate Trademark Guidelines</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Change history</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="../changes.html">Weblate 5.8.2</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-8-1">Weblate 5.8.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-8">Weblate 5.8</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-7-2">Weblate 5.7.2</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-7-1">Weblate 5.7.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-7">Weblate 5.7</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-6-2">Weblate 5.6.2</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-6-1">Weblate 5.6.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-6">Weblate 5.6</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-5-5">Weblate 5.5.5</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-5-4">Weblate 5.5.4</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-5-3">Weblate 5.5.3</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-5-2">Weblate 5.5.2</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-5-1">Weblate 5.5.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-5">Weblate 5.5</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-4-3">Weblate 5.4.3</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-4-2">Weblate 5.4.2</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-4-1">Weblate 5.4.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-4">Weblate 5.4</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-3-1">Weblate 5.3.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-3">Weblate 5.3</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-2-1">Weblate 5.2.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-2">Weblate 5.2</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-1-1">Weblate 5.1.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-1">Weblate 5.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-0-2">Weblate 5.0.2</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-0-1">Weblate 5.0.1</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes.html#weblate-5-0">Weblate 5.0</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes/v4.html">Weblate 4.x series</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes/v3.html">Weblate 3.x series</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes/v2.html">Weblate 2.x series</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes/v1.html">Weblate 1.x series</a></li> <li class="toctree-l1"><a class="reference internal" href="../changes/v0.html">Weblate 0.x series</a></li> </ul> </div> <div id="furo-sidebar-ad-placement" class="flat" data-ea-publisher="readthedocs" data-ea-type="readthedocs-sidebar" data-ea-manual="true" ></div> </div> </div> </div> </aside> <div class="main"> <div class="content"> <div class="article-container"> <a href="#" class="back-to-top muted-link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path> </svg> <span>Back to top</span> </a> <div class="content-icon-container"> <div class="view-this-page"> <a class="muted-link" href="https://github.com/WeblateOrg/weblate/blob/main/docs/admin/checks.rst?plain=true" title="View this page"> <svg><use href="#svg-eye"></use></svg> <span class="visually-hidden">View this page</span> </a> </div><div class="edit-this-page"> <a class="muted-link" href="https://github.com/WeblateOrg/weblate/edit/main/docs/admin/checks.rst" title="Edit this page"> <svg><use href="#svg-pencil"></use></svg> <span class="visually-hidden">Edit this page</span> </a> </div><div class="theme-toggle-container theme-toggle-content"> <button class="theme-toggle"> <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div> <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg> <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg> <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg> <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg> </button> </div> <label class="toc-overlay-icon toc-content-icon" for="__toc"> <div class="visually-hidden">Toggle table of contents sidebar</div> <i class="icon"><svg><use href="#svg-toc"></use></svg></i> </label> </div> <article role="main" id="furo-main-content"> <section id="checks-and-fixups"> <h1>Checks and fixups<a class="headerlink" href="#checks-and-fixups" title="Link to this heading">¶</a></h1> <section id="custom-automatic-fixups"> <span id="custom-autofix"></span><h2>Custom automatic fixups<a class="headerlink" href="#custom-automatic-fixups" title="Link to this heading">¶</a></h2> <p>You can also implement your own automatic fixup in addition to the standard ones and include them in <a class="reference internal" href="config.html#std-setting-AUTOFIX_LIST"><code class="xref std std-setting docutils literal notranslate"><span class="pre">AUTOFIX_LIST</span></code></a>.</p> <p>The automatic fixes are powerful, but can also cause damage; be careful when writing one.</p> <p>For example, the following automatic fixup would replace every occurrence of the string <code class="docutils literal notranslate"><span class="pre">foo</span></code> in a translation with <code class="docutils literal notranslate"><span class="pre">bar</span></code>:</p> <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Copyright © Michal Čihař &lt;michal@weblate.org&gt;</span> <span class="c1">#</span> <span class="c1"># SPDX-License-Identifier: GPL-3.0-or-later</span> <span class="kn">from</span> <span class="nn">django.utils.translation</span> <span class="kn">import</span> <span class="n">gettext_lazy</span> <span class="kn">from</span> <span class="nn">weblate.trans.autofixes.base</span> <span class="kn">import</span> <span class="n">AutoFix</span> <span class="k">class</span> <span class="nc">ReplaceFooWithBar</span><span class="p">(</span><span class="n">AutoFix</span><span class="p">):</span> <span class="w"> </span><span class="sd">&quot;&quot;&quot;Replace foo with bar.&quot;&quot;&quot;</span> <span class="n">name</span> <span class="o">=</span> <span class="n">gettext_lazy</span><span class="p">(</span><span class="s2">&quot;Foobar&quot;</span><span class="p">)</span> <span class="k">def</span> <span class="nf">fix_single_target</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">target</span><span class="p">,</span> <span class="n">source</span><span class="p">,</span> <span class="n">unit</span><span class="p">):</span> <span class="k">if</span> <span class="s2">&quot;foo&quot;</span> <span class="ow">in</span> <span class="n">target</span><span class="p">:</span> <span class="k">return</span> <span class="n">target</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">&quot;foo&quot;</span><span class="p">,</span> <span class="s2">&quot;bar&quot;</span><span class="p">),</span> <span class="kc">True</span> <span class="k">return</span> <span class="n">target</span><span class="p">,</span> <span class="kc">False</span> </pre></div> </div> <p>To install custom checks, provide a fully-qualified path to the Python class in the <a class="reference internal" href="config.html#std-setting-AUTOFIX_LIST"><code class="xref std std-setting docutils literal notranslate"><span class="pre">AUTOFIX_LIST</span></code></a>, see <a class="reference internal" href="customize.html#custom-check-modules"><span class="std std-ref">Custom quality checks, add-ons and auto-fixes</span></a>.</p> </section> <section id="customizing-behavior-using-flags"> <span id="custom-checks"></span><h2>Customizing behavior using flags<a class="headerlink" href="#customizing-behavior-using-flags" title="Link to this heading">¶</a></h2> <p>You can fine-tune Weblate’s behavior by using flags. The flags provide visual feedback to the translators and help them to improve their translation. The flags are merged from following sources:</p> <ul class="simple"> <li><p>Source string, see <a class="reference internal" href="translating.html#additional"><span class="std std-ref">Additional info on source strings</span></a>.</p></li> <li><p>Per-string flags extracted from the file format, see <a class="reference internal" href="../formats.html#formats"><span class="std std-ref">Supported file formats</span></a>.</p></li> <li><p>Translation flags (currently only <code class="docutils literal notranslate"><span class="pre">read-only</span></code> flag for bilingual source string).</p></li> <li><p>File-format specific flags.</p></li> <li><p><a class="reference internal" href="projects.html#component"><span class="std std-ref">Component configuration</span></a> (<a class="reference internal" href="projects.html#component-check-flags"><span class="std std-ref">Translation flags</span></a>).</p></li> </ul> <p>The flags are comma-separated; if they have parameters, they are separated with colon. You can use quotes to include whitespaces or special characters in the string. For example:</p> <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>placeholders:&quot;special:value&quot;:&quot;other value&quot;, regex:.* </pre></div> </div> <p>Both single and double quotes are accepted, special characters are being escaped using backslash:</p> <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>placeholders:&quot;quoted \&quot;string\&quot;&quot;:&#39;single \&#39;quoted\&#39;&#39; </pre></div> </div> <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>placeholders:r&quot;^#*&quot; </pre></div> </div> <p>To verify that translators do not change the heading of a Markdown document: A failing check will be triggered if the string ‘### Index’ is translated as ‘# Indice’</p> <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>placeholders:r&quot;\]\([^h].*?\)&quot; </pre></div> </div> <p>To ensure that internal links are not being translated (i.e. <cite>[test](../checks)</cite> does not become <cite>[test](../chequeos)</cite>.</p> <p>Here is a list of flags currently accepted:</p> <dl class="simple"> <dt><code class="docutils literal notranslate"><span class="pre">rst-text</span></code></dt><dd><p>Treat a text as an reStructuredText document, affects <a class="reference internal" href="../user/checks.html#check-same"><span class="std std-ref">Unchanged translation</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">dos-eol</span></code></dt><dd><p>Uses DOS end-of-line markers instead of Unix ones (<code class="docutils literal notranslate"><span class="pre">\r\n</span></code> instead of <code class="docutils literal notranslate"><span class="pre">\n</span></code>).</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">read-only</span></code></dt><dd><p>The string is read-only and should not be edited in Weblate, see <a class="reference internal" href="../formats.html#read-only-strings"><span class="std std-ref">Read-only strings</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">terminology</span></code></dt><dd><p>Used in <a class="reference internal" href="../user/glossary.html#glossary"><span class="std std-ref">Glossary</span></a>. Copies the string into all glossary languages so it can be used consistently in all translations. Also useful in combination with <code class="docutils literal notranslate"><span class="pre">read-only</span></code>, for example in product names.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">priority:N</span></code></dt><dd><p>Priority of the string. Higher priority strings are presented first for translation. The default priority is 100, the higher priority a string has, the earlier it is offered for translation.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">max-length:N</span></code></dt><dd><p>Limit the maximal length for a string to N characters, see <a class="reference internal" href="../user/checks.html#check-max-length"><span class="std std-ref">Maximum length of translation</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">xml-text</span></code></dt><dd><p>Treat text as XML document, affects <a class="reference internal" href="../user/checks.html#check-xml-invalid"><span class="std std-ref">XML syntax</span></a> and <a class="reference internal" href="../user/checks.html#check-xml-tags"><span class="std std-ref">XML markup</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">font-family:NAME</span></code></dt><dd><p>Define font-family for rendering checks, see <a class="reference internal" href="#fonts"><span class="std std-ref">Managing fonts</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">font-weight:WEIGHT</span></code></dt><dd><p>Define font-weight for rendering checks, see <a class="reference internal" href="#fonts"><span class="std std-ref">Managing fonts</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">font-size:SIZE</span></code></dt><dd><p>Define font-size for rendering checks, see <a class="reference internal" href="#fonts"><span class="std std-ref">Managing fonts</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">font-spacing:SPACING</span></code></dt><dd><p>Define letter spacing for rendering checks, see <a class="reference internal" href="#fonts"><span class="std std-ref">Managing fonts</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">icu-flags:FLAGS</span></code></dt><dd><p>Define flags for customizing the behavior of the <a class="reference internal" href="../user/checks.html#check-icu-message-format"><span class="std std-ref">ICU MessageFormat</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">icu-tag-prefix:PREFIX</span></code></dt><dd><p>Set a required prefix for XML tags for the <a class="reference internal" href="../user/checks.html#check-icu-message-format"><span class="std std-ref">ICU MessageFormat</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">placeholders:NAME:NAME2:...</span></code></dt><dd><p>Placeholder strings expected in translation, see <a class="reference internal" href="../user/checks.html#check-placeholders"><span class="std std-ref">Placeholders</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">replacements:FROM:TO:FROM2:TO2...</span></code></dt><dd><p>Replacements to perform when checking resulting text parameters (for example in <a class="reference internal" href="../user/checks.html#check-max-size"><span class="std std-ref">Maximum size of translation</span></a> or <a class="reference internal" href="../user/checks.html#check-max-length"><span class="std std-ref">Maximum length of translation</span></a>). The typical use case for this is to expand placeables to ensure that the text fits even with long values, for example: <code class="docutils literal notranslate"><span class="pre">replacements:%s:&quot;John</span> <span class="pre">Doe&quot;</span></code>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">variants:SOURCE</span></code></dt><dd><p>Mark this string as a variant of string with matching source. See <a class="reference internal" href="../devel/translations.html#variants"><span class="std std-ref">String variants</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">regex:REGEX</span></code></dt><dd><p>Regular expression to match translation, see <a class="reference internal" href="../user/checks.html#check-regex"><span class="std std-ref">Regular expression</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">forbidden</span></code></dt><dd><p>Indicates forbidden translation in a glossary, see <a class="reference internal" href="../user/glossary.html#glossary-forbidden"><span class="std std-ref">Forbidden translations</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">strict-same</span></code></dt><dd><p>Make “Unchanged translation” avoid using built-in words blacklist, see <a class="reference internal" href="../user/checks.html#check-same"><span class="std std-ref">Unchanged translation</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">strict-format</span></code></dt><dd><p>Make format checks enforce using format even for plural forms with a single value, see <a class="reference internal" href="../user/checks.html#check-formats"><span class="std std-ref">Formatted strings</span></a>.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">check-glossary</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-check-glossary"><span class="std std-ref">Does not follow glossary</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">angularjs-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-angularjs-format"><span class="std std-ref">AngularJS interpolation string</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">c-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-c-format"><span class="std std-ref">C format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">c-sharp-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-c-sharp-format"><span class="std std-ref">C# format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">es-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-es-format"><span class="std std-ref">ECMAScript template literals</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">i18next-interpolation</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-i18next-interpolation"><span class="std std-ref">i18next interpolation</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">icu-message-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-icu-message-format"><span class="std std-ref">ICU MessageFormat</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">java-printf-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-java-printf-format"><span class="std std-ref">Java format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">java-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-java-format"><span class="std std-ref">Java MessageFormat</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">javascript-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-javascript-format"><span class="std std-ref">JavaScript format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">lua-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-lua-format"><span class="std std-ref">Lua format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">object-pascal-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-object-pascal-format"><span class="std std-ref">Object Pascal format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">percent-placeholders</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-percent-placeholders"><span class="std std-ref">Percent placeholders</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">perl-brace-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-perl-brace-format"><span class="std std-ref">Perl brace format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">perl-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-perl-format"><span class="std std-ref">Perl format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">php-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-php-format"><span class="std std-ref">PHP format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">python-brace-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-python-brace-format"><span class="std std-ref">Python brace format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">python-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-python-format"><span class="std std-ref">Python format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">qt-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-qt-format"><span class="std std-ref">Qt format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">qt-plural-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-qt-plural-format"><span class="std std-ref">Qt plural format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ruby-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-ruby-format"><span class="std std-ref">Ruby format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">scheme-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-scheme-format"><span class="std std-ref">Scheme format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">vue-format</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-vue-format"><span class="std std-ref">Vue I18n formatting</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">md-text</span></code></dt><dd><p>Treat text as a Markdown document, and provide Markdown syntax highlighting on the translation text area. Enables <a class="reference internal" href="../user/checks.html#check-md-link"><span class="std std-ref">Markdown links</span></a>, <a class="reference internal" href="../user/checks.html#check-md-reflink"><span class="std std-ref">Markdown references</span></a>, and <a class="reference internal" href="../user/checks.html#check-md-syntax"><span class="std std-ref">Markdown syntax</span></a> quality checks.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">case-insensitive</span></code></dt><dd><p>Adjust checks behavior to be case-insensitive. Currently affects only <a class="reference internal" href="../user/checks.html#check-placeholders"><span class="std std-ref">Placeholders</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">safe-html</span></code></dt><dd><p>Enable the <a class="reference internal" href="../user/checks.html#check-safe-html"><span class="std std-ref">Unsafe HTML</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">url</span></code></dt><dd><p>The string should consist of only a URL. Enable the <a class="reference internal" href="../user/checks.html#check-url"><span class="std std-ref">URL</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-all-checks</span></code></dt><dd><p>Ignore all quality checks.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-bbcode</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-bbcode"><span class="std std-ref">BBCode markup</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-duplicate</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-duplicate"><span class="std std-ref">Consecutive duplicated words</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-check-glossary</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-check-glossary"><span class="std std-ref">Does not follow glossary</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-double-space</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-double-space"><span class="std std-ref">Double space</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-angularjs-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-angularjs-format"><span class="std std-ref">AngularJS interpolation string</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-c-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-c-format"><span class="std std-ref">C format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-c-sharp-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-c-sharp-format"><span class="std std-ref">C# format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-es-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-es-format"><span class="std std-ref">ECMAScript template literals</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-i18next-interpolation</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-i18next-interpolation"><span class="std std-ref">i18next interpolation</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-icu-message-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-icu-message-format"><span class="std std-ref">ICU MessageFormat</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-java-printf-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-java-printf-format"><span class="std std-ref">Java format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-java-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-java-format"><span class="std std-ref">Java MessageFormat</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-javascript-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-javascript-format"><span class="std std-ref">JavaScript format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-lua-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-lua-format"><span class="std std-ref">Lua format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-object-pascal-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-object-pascal-format"><span class="std std-ref">Object Pascal format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-percent-placeholders</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-percent-placeholders"><span class="std std-ref">Percent placeholders</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-perl-brace-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-perl-brace-format"><span class="std std-ref">Perl brace format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-perl-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-perl-format"><span class="std std-ref">Perl format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-php-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-php-format"><span class="std std-ref">PHP format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-python-brace-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-python-brace-format"><span class="std std-ref">Python brace format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-python-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-python-format"><span class="std std-ref">Python format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-qt-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-qt-format"><span class="std std-ref">Qt format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-qt-plural-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-qt-plural-format"><span class="std std-ref">Qt plural format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-ruby-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-ruby-format"><span class="std std-ref">Ruby format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-scheme-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-scheme-format"><span class="std std-ref">Scheme format</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-vue-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-vue-format"><span class="std std-ref">Vue I18n formatting</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-translated</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-translated"><span class="std std-ref">Has been translated</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-inconsistent</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-inconsistent"><span class="std std-ref">Inconsistent</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-kashida</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-kashida"><span class="std std-ref">Kashida letter used</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-md-link</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-md-link"><span class="std std-ref">Markdown links</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-md-reflink</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-md-reflink"><span class="std std-ref">Markdown references</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-md-syntax</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-md-syntax"><span class="std std-ref">Markdown syntax</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-max-length</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-max-length"><span class="std std-ref">Maximum length of translation</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-max-size</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-max-size"><span class="std std-ref">Maximum size of translation</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-escaped-newline</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-escaped-newline"><span class="std std-ref">Mismatched \n</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-end-colon</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-end-colon"><span class="std std-ref">Mismatched colon</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-end-ellipsis</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-end-ellipsis"><span class="std std-ref">Mismatched ellipsis</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-end-exclamation</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-end-exclamation"><span class="std std-ref">Mismatched exclamation mark</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-end-stop</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-end-stop"><span class="std std-ref">Mismatched full stop</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-end-question</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-end-question"><span class="std std-ref">Mismatched question mark</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-end-semicolon</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-end-semicolon"><span class="std std-ref">Mismatched semicolon</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-newline-count</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-newline-count"><span class="std std-ref">Mismatching line breaks</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-plurals</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-plurals"><span class="std std-ref">Missing plurals</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-placeholders</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-placeholders"><span class="std std-ref">Placeholders</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-punctuation-spacing</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-punctuation-spacing"><span class="std std-ref">Punctuation spacing</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-regex</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-regex"><span class="std std-ref">Regular expression</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-reused</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-reused"><span class="std std-ref">Reused translation</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-same-plurals</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-same-plurals"><span class="std std-ref">Same plurals</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-begin-newline</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-begin-newline"><span class="std std-ref">Starting newline</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-begin-space</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-begin-space"><span class="std std-ref">Starting spaces</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-end-newline</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-end-newline"><span class="std std-ref">Trailing newline</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-end-space</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-end-space"><span class="std std-ref">Trailing space</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-same</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-same"><span class="std std-ref">Unchanged translation</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-safe-html</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-safe-html"><span class="std std-ref">Unsafe HTML</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-url</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-url"><span class="std std-ref">URL</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-xml-tags</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-xml-tags"><span class="std std-ref">XML markup</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-xml-invalid</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-xml-invalid"><span class="std std-ref">XML syntax</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-zero-width-space</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-zero-width-space"><span class="std std-ref">Zero-width space</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-ellipsis</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-ellipsis"><span class="std std-ref">Ellipsis</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-icu-message-format-syntax</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-icu-message-format-syntax"><span class="std std-ref">ICU MessageFormat syntax</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-long-untranslated</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-long-untranslated"><span class="std std-ref">Long untranslated</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-multiple-failures</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-multiple-failures"><span class="std std-ref">Multiple failing checks</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-unnamed-format</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-unnamed-format"><span class="std std-ref">Multiple unnamed variables</span></a> quality check.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">ignore-optional-plural</span></code></dt><dd><p>Skip the <a class="reference internal" href="../user/checks.html#check-optional-plural"><span class="std std-ref">Unpluralised</span></a> quality check.</p> </dd> </dl> <div class="admonition note"> <p class="admonition-title">Note</p> <p>Generally the rule is named <code class="docutils literal notranslate"><span class="pre">ignore-*</span></code> for any check, using its identifier, so you can use this even for your custom checks.</p> </div> <p>These flags are understood both in <a class="reference internal" href="projects.html#component"><span class="std std-ref">Component configuration</span></a> settings, per source string settings and in the translation file itself (for example in GNU gettext).</p> </section> <section id="enforcing-checks"> <span id="id1"></span><h2>Enforcing checks<a class="headerlink" href="#enforcing-checks" title="Link to this heading">¶</a></h2> <p>You can configure a list of checks which can not be ignored by setting <a class="reference internal" href="projects.html#component-enforced-checks"><span class="std std-ref">Enforced checks</span></a> in <a class="reference internal" href="projects.html#component"><span class="std std-ref">Component configuration</span></a>. Each listed check can not be dismissed in the user interface and any string failing this check is marked as <span class="guilabel">Needs editing</span> (see <a class="reference internal" href="../workflows.html#states"><span class="std std-ref">Translation states</span></a>).</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>Turning on check enforcing doesn’t enable it automatically. The check can be turned on by adding the corresponding flag to string or component flags.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="translating.html#additional"><span class="std std-ref">Additional info on source strings</span></a>, <a class="reference internal" href="projects.html#component-check-flags"><span class="std std-ref">Translation flags</span></a></p> </div> </div> </section> <section id="managing-fonts"> <span id="fonts"></span><h2>Managing fonts<a class="headerlink" href="#managing-fonts" title="Link to this heading">¶</a></h2> <div class="admonition hint"> <p class="admonition-title">Hint</p> <p>Fonts uploaded into Weblate are used purely for purposes of the <a class="reference internal" href="../user/checks.html#check-max-size"><span class="std std-ref">Maximum size of translation</span></a> check, they do not have an effect in Weblate user interface.</p> </div> <p>The <a class="reference internal" href="../user/checks.html#check-max-size"><span class="std std-ref">Maximum size of translation</span></a> check used to calculate dimensions of the rendered text needs font to be loaded into Weblate and selected using a translation flag (see <a class="reference internal" href="#custom-checks"><span class="std std-ref">Customizing behavior using flags</span></a>).</p> <p>Weblate font management tool in <span class="guilabel">Fonts</span> under the <span class="guilabel">Manage</span> menu of your translation project provides interface to upload and manage fonts. TrueType or OpenType fonts can be uploaded, set up font-groups and use those in the check.</p> <p>The font-groups allow you to define different fonts for different languages, which is typically needed for non-latin languages:</p> <img alt="../_images/font-group-edit.webp" src="../_images/font-group-edit.webp" /> <p>The font-groups are identified by name, which can not contain whitespace or special characters, so that it can be easily used in the check definition:</p> <img alt="../_images/font-group-list.webp" src="../_images/font-group-list.webp" /> <p>Font-family and style is automatically recognized after uploading them:</p> <img alt="../_images/font-edit.webp" src="../_images/font-edit.webp" /> <p>You can have a number of fonts loaded into Weblate:</p> <img alt="../_images/font-list.webp" src="../_images/font-list.webp" /> <p>To use the fonts for checking the string length, pass it the appropriate flags (see <a class="reference internal" href="#custom-checks"><span class="std std-ref">Customizing behavior using flags</span></a>). You will probably need the following ones:</p> <dl class="simple"> <dt><code class="docutils literal notranslate"><span class="pre">max-size:500</span></code> / <code class="docutils literal notranslate"><span class="pre">max-size:300:5</span></code></dt><dd><p>Defines maximal width in pixels and, optionally, the maximum number of lines (word wrapping is applied).</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">font-family:ubuntu</span></code></dt><dd><p>Defines font group to use by specifying its identifier.</p> </dd> <dt><code class="docutils literal notranslate"><span class="pre">font-size:22</span></code></dt><dd><p>Defines font size in pixels.</p> </dd> </dl> </section> <section id="writing-own-checks"> <span id="own-checks"></span><h2>Writing own checks<a class="headerlink" href="#writing-own-checks" title="Link to this heading">¶</a></h2> <p>A wide range of quality checks are built-in, (see <a class="reference internal" href="../user/checks.html#checks"><span class="std std-ref">Quality checks</span></a>), though they might not cover everything you want to check. The list of performed checks can be adjusted using <a class="reference internal" href="config.html#std-setting-CHECK_LIST"><code class="xref std std-setting docutils literal notranslate"><span class="pre">CHECK_LIST</span></code></a>, and you can also add custom checks.</p> <ol class="arabic simple"> <li><p>Subclass the <cite>weblate.checks.Check</cite></p></li> <li><p>Set a few attributes.</p></li> <li><p>Implement either the <code class="docutils literal notranslate"><span class="pre">check</span></code> (if you want to deal with plurals in your code) or the <code class="docutils literal notranslate"><span class="pre">check_single</span></code> method (which does it for you).</p></li> </ol> <p>Some examples:</p> <p>To install custom checks, provide a fully-qualified path to the Python class in the <a class="reference internal" href="config.html#std-setting-CHECK_LIST"><code class="xref std std-setting docutils literal notranslate"><span class="pre">CHECK_LIST</span></code></a>, see <a class="reference internal" href="customize.html#custom-check-modules"><span class="std std-ref">Custom quality checks, add-ons and auto-fixes</span></a>.</p> <section id="checking-translation-text-does-not-contain-foo"> <h3>Checking translation text does not contain “foo”<a class="headerlink" href="#checking-translation-text-does-not-contain-foo" title="Link to this heading">¶</a></h3> <p>This is a pretty simple check which just checks whether the translation is missing the string “foo”.</p> <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Copyright © Michal Čihař &lt;michal@weblate.org&gt;</span> <span class="c1">#</span> <span class="c1"># SPDX-License-Identifier: GPL-3.0-or-later</span> <span class="sd">&quot;&quot;&quot;Simple quality check example.&quot;&quot;&quot;</span> <span class="kn">from</span> <span class="nn">django.utils.translation</span> <span class="kn">import</span> <span class="n">gettext_lazy</span> <span class="kn">from</span> <span class="nn">weblate.checks.base</span> <span class="kn">import</span> <span class="n">TargetCheck</span> <span class="k">class</span> <span class="nc">FooCheck</span><span class="p">(</span><span class="n">TargetCheck</span><span class="p">):</span> <span class="c1"># Used as identifier for check, should be unique</span> <span class="c1"># Has to be shorter than 50 characters</span> <span class="n">check_id</span> <span class="o">=</span> <span class="s2">&quot;foo&quot;</span> <span class="c1"># Short name used to display failing check</span> <span class="n">name</span> <span class="o">=</span> <span class="n">gettext_lazy</span><span class="p">(</span><span class="s2">&quot;Foo check&quot;</span><span class="p">)</span> <span class="c1"># Description for failing check</span> <span class="n">description</span> <span class="o">=</span> <span class="n">gettext_lazy</span><span class="p">(</span><span class="s2">&quot;Your translation is foo&quot;</span><span class="p">)</span> <span class="c1"># Real check code</span> <span class="k">def</span> <span class="nf">check_single</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">source</span><span class="p">,</span> <span class="n">target</span><span class="p">,</span> <span class="n">unit</span><span class="p">):</span> <span class="k">return</span> <span class="s2">&quot;foo&quot;</span> <span class="ow">in</span> <span class="n">target</span> </pre></div> </div> </section> <section id="checking-that-czech-translation-text-plurals-differ"> <h3>Checking that Czech translation text plurals differ<a class="headerlink" href="#checking-that-czech-translation-text-plurals-differ" title="Link to this heading">¶</a></h3> <p>Check using language info to verify the two plural forms in Czech language are not same.</p> <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Copyright © Michal Čihař &lt;michal@weblate.org&gt;</span> <span class="c1">#</span> <span class="c1"># SPDX-License-Identifier: GPL-3.0-or-later</span> <span class="sd">&quot;&quot;&quot;Quality check example for Czech plurals.&quot;&quot;&quot;</span> <span class="kn">from</span> <span class="nn">django.utils.translation</span> <span class="kn">import</span> <span class="n">gettext_lazy</span> <span class="kn">from</span> <span class="nn">weblate.checks.base</span> <span class="kn">import</span> <span class="n">TargetCheck</span> <span class="k">class</span> <span class="nc">PluralCzechCheck</span><span class="p">(</span><span class="n">TargetCheck</span><span class="p">):</span> <span class="c1"># Used as identifier for check, should be unique</span> <span class="c1"># Has to be shorter than 50 characters</span> <span class="n">check_id</span> <span class="o">=</span> <span class="s2">&quot;foo&quot;</span> <span class="c1"># Short name used to display failing check</span> <span class="n">name</span> <span class="o">=</span> <span class="n">gettext_lazy</span><span class="p">(</span><span class="s2">&quot;Foo check&quot;</span><span class="p">)</span> <span class="c1"># Description for failing check</span> <span class="n">description</span> <span class="o">=</span> <span class="n">gettext_lazy</span><span class="p">(</span><span class="s2">&quot;Your translation is foo&quot;</span><span class="p">)</span> <span class="c1"># Real check code</span> <span class="k">def</span> <span class="nf">check_target_unit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sources</span><span class="p">,</span> <span class="n">targets</span><span class="p">,</span> <span class="n">unit</span><span class="p">):</span> <span class="k">if</span> <span class="n">unit</span><span class="o">.</span><span class="n">translation</span><span class="o">.</span><span class="n">language</span><span class="o">.</span><span class="n">is_base</span><span class="p">((</span><span class="s2">&quot;cs&quot;</span><span class="p">,)):</span> <span class="k">return</span> <span class="n">targets</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="n">targets</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="k">return</span> <span class="kc">False</span> <span class="k">def</span> <span class="nf">check_single</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">source</span><span class="p">,</span> <span class="n">target</span><span class="p">,</span> <span class="n">unit</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">bool</span><span class="p">:</span> <span class="w"> </span><span class="sd">&quot;&quot;&quot;We don&#39;t check target strings here.&quot;&quot;&quot;</span> <span class="k">return</span> <span class="kc">False</span> </pre></div> </div> </section> </section> </section> </article> </div> <footer> <div class="related-pages"> <a class="next-page" href="machine.html"> <div class="page-info"> <div class="context"> <span>Next</span> </div> <div class="title">Automatic suggestions</div> </div> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> </a> <a class="prev-page" href="translating.html"> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> <div class="page-info"> <div class="context"> <span>Previous</span> </div> <div class="title">Translation process</div> </div> </a> </div> <div class="bottom-of-page"> <div class="left-details"> <div class="copyright"> Copyright &#169; Michal Čihař </div> Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s <a href="https://github.com/pradyunsg/furo">Furo</a> </div> <div class="right-details"> <div class="icons"> </div> </div> </div> </footer> </div> <aside class="toc-drawer"> <div class="toc-sticky toc-scroll"> <div class="toc-title-container"> <span class="toc-title"> On this page </span> </div> <div class="toc-tree-container"> <div class="toc-tree"> <ul> <li><a class="reference internal" href="#">Checks and fixups</a><ul> <li><a class="reference internal" href="#custom-automatic-fixups">Custom automatic fixups</a></li> <li><a class="reference internal" href="#customizing-behavior-using-flags">Customizing behavior using flags</a></li> <li><a class="reference internal" href="#enforcing-checks">Enforcing checks</a></li> <li><a class="reference internal" href="#managing-fonts">Managing fonts</a></li> <li><a class="reference internal" href="#writing-own-checks">Writing own checks</a><ul> <li><a class="reference internal" href="#checking-translation-text-does-not-contain-foo">Checking translation text does not contain “foo”</a></li> <li><a class="reference internal" href="#checking-that-czech-translation-text-plurals-differ">Checking that Czech translation text plurals differ</a></li> </ul> </li> </ul> </li> </ul> </div> </div> </div> </aside> </div> </div><script src="../_static/documentation_options.js?v=65bc969b"></script> <script src="../_static/doctools.js?v=9bcbadda"></script> <script src="../_static/sphinx_highlight.js?v=dc90522c"></script> <script src="../_static/scripts/furo.js?v=5fa4622c"></script> <script src="../_static/clipboard.min.js?v=a7894cd8"></script> <script src="../_static/copybutton.js?v=f281be69"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10