Ask your AI agent Give this prompt to ChatGPT, Claude or another agent. Then paste its answer in step 1 with Paste a rules file.
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.