ada.tools/polyglots/rules-builder

Rules builder

If you already use polyglots, you can edit your rules in the app instead, on the Locale rules screen or withpolyglots rules edit. Build your locale’s rules file without writing YAML. Every step can be skipped. Nothing leaves your browser unless you share the file at the end. See Locale rules for what each part does.

Prompt for your AI agent

Help me write a rules file for polyglots, a tool that reviews and drafts WordPress translations. The file is YAML. It tells polyglots how my locale team translates, so its checks and its AI prompts follow our conventions.

Ask me which WordPress locale the file is for (a code such as de_DE or pt_BR) before anything else.

Steps:
1. Fetch the template: https://ada.tools/polyglots/rules-builder/template.txt
   It lists every section, with a comment and an example. If you cannot open web addresses, stop and ask me to paste the template.
2. Before you write anything, ask me for my team's style guide and glossary, or for the conventions we follow: form of address, capitalization, punctuation, words we reject. Do not invent conventions. Leave out every section I give you nothing for.
3. Write the file.

Rules for the file:
- The first line is `schema: 2`, or `schema: 3` when the file uses `dateTime` or `names`, or names `date-format` or `name-order` in `rules`. Schema 3 needs polyglots 1.2 or later.
- Use only these top-level keys: `rules`, `glossaryStemRatio`, `properNouns`, `mistakes`, `patterns`, `guidance`, `schema`, `capitalization`, `register`, `formality`, `sentenceEnd`, `dateTime`, `names`.
- `rules.enable` and `rules.disable` take only these names: `placeholder`, `html`, `plural-count`, `whitespace`, `untranslated`, `escaping`, `punctuation`, `line-breaks`, `ampersand`, `number-format`, `title-case`, `glossary`, `apostrophe`, `inconsistent`, `tm-conflict`, `control`, `date-format`, `name-order`. On by default: `placeholder`, `html`, `plural-count`, `whitespace`, `untranslated`, `escaping`, `line-breaks`, `punctuation`, `glossary`, `inconsistent`, `tm-conflict`, `control`, `date-format`, `name-order`. Off unless enabled: `ampersand`, `number-format`, `title-case`, `apostrophe`.
- `guidance` is at most 1,500 characters, `capitalization` at most 2,500, and each of `register.audit` and `register.translate` at most 500.
- `formality` is `formal` or `informal`.
- A `mistakes` entry has `wrong` (required), `right` and `note`.
- A `patterns` entry has exactly one of `text` (literal) or `find` (regular expression), and `level`: `hint`, `error` or `fix`. A `fix` needs `replace`. It can also have `ignoreCase`, `when.source`, `when.notSource` and `note`.
- Write `guidance`, `capitalization`, `register` and every `note` in English: a model reads them.
- Regular expressions are JavaScript, compiled with the `u` flag. Keep them simple: polyglots skips a pattern that takes more than about 100 ms on one translation, so avoid nested quantifiers such as `(a+)+`.
- Use `sentenceEnd` only for a script whose sentences do not end with a full stop.
- `dateTime` has `clock` (`24h` or `12h`), `order` (`dmy`, `mdy` or `ymd`) and `formats`, which maps a common English PHP date format to the locale's, such as `'F j, Y': 'j F Y'`. Each suggested format must keep every part of the date and agree with `clock` and `order`.
- `names` has one key, `order`: `given-first` or `family-first`, which name the language writes first. Leave it out unless I say.

Answer with the whole file in one yaml code block, and nothing after it. I will paste it into the rules builder at https://ada.tools/polyglots/rules-builder/, which checks it, and save it as <wp_code>.yaml.
Open the template

Locale and you

For GTEs, PTEs and plugin or theme developers who want polyglots to check a locale the way its team does. Pick the locale, then start empty or from the rules the locale team has already published.

Any WordPress locale code from translate.wordpress.org.