I18nAudit
MMO\admin\helpers · 1 symbole · générée le 30 Nov 2026
I18nAudit
I18nAudit.php:38The translation audit of one package (a library of libs/, an application, one of its modules): what the root hub's php tools/mmo.php i18n and a monitoring hub's local project report.
- Espace de noms
MMO\admin\helpers- Utilise les traits
- tIgnoreFile
Index
| ACCENTS | an accented letter, a French quote or apostrophe: French text | |
| JSON_FIELDS | the fields holding a text, by kind of json file: [php or js, fields] | |
| LOG_FUNCTIONS | the log calls, whose texts are English and never translated | |
| SKIP_ATTRIBUTES | the attributes of a template whose value is data or code, never a text | |
| SKIP_FOLDERS | the folders never scanned, at any depth | |
| STOP_WORDS | French words that English does not use: two of them make a text French | |
| dictionaries | ||
| files readonly | ||
| folder readonly | ||
| french | ||
| ignore | ||
| ignored | ||
| jsKeys | ||
| lang readonly | ||
| lines | ||
| manifest readonly | ||
| name readonly | ||
| phpKeys | ||
| scanned | ||
| addDictionaries($name, $folder) | Add the dictionaries of another package: what the run time merges with the package's. | |
| addModules($folder, $manifest) | ||
| addRelatedPackages() | The application of a module (<app>/modules/<module>), and the modules of an application (its mmo.json urls). | |
| Callee($tokens, $i) static | ||
| docComment($doc, $file, $line) | The @title/@label/@description of a docblock: keys, unless a template made only of placeholders. | |
| isIgnored($file, $line) | ||
| IsText($text) static | ||
| jsonKind($file) | ||
| key($side, $key, $file, $line) | A text written for translation: French, it is a French literal; English, a key to find in a dictionary. | |
| LooksFrench($text) static | ||
| matchesFilter($rel) | ||
| ParseJsDictionary($content, $lang) static | ||
| PhpString($literal) static | ||
| readDictionaries($folder, $manifest) | ||
| readIgnore($name) | ||
| ReadManifest($folder) static | ||
| run() | Scan the package and check its keys. | |
| scanFile($file, $rel) | ||
| scanHtml($html, $file, $lines, $lineOffset) | Scan markup: its scripts (<script>, on*= attributes, {= … } expressions) as js, its text nodes and its attributes (but SKIP_ATTRIBUTES) for French. | |
| scanJs($content, $start, $end, $file, $lines, $untilBrace) | Scan the script between two offsets of a file: its keys and its strings. | |
| scanJson($content, $file, $kind) | ||
| scanPhp($content, $file, $lines) | ||
| Significant($tokens, $i, $dir) static | ||
| sources($folder, $manifest) | ||
| text($text, $file, $line, $lines, $base) | A text shown as is: French, it is reported (a template's markup is looked into: scanHtml). | |
| Walk($folder, $withI18n) static | Every file below a folder, but the folders never scanned, a symbolic link, a package of its own. | |
| withLineOffset($lineOffset, $fn) | Run a scan whose lines are shifted (markup inside a php string). | |
| __construct($folder, $lang, $files) |
Constantes6
ACCENTS
an accented letter, a French quote or apostrophe: French text
JSON_FIELDS
the fields holding a text, by kind of json file: [php or js, fields]
LOG_FUNCTIONS
the log calls, whose texts are English and never translated
SKIP_ATTRIBUTES
the attributes of a template whose value is data or code, never a text
SKIP_FOLDERS
the folders never scanned, at any depth
STOP_WORDS
French words that English does not use: two of them make a text French
Propriétés13
dictionaries
- Type
- array
files
readonlyfolder
readonly- Type
- string
french
- Type
- array
ignore
- Type
- array
ignored
- Type
- int
jsKeys
- Type
- array
lang
readonly- Type
- string
lines
- Type
- array
manifest
readonly- Type
- array
name
readonly- Type
- string
phpKeys
- Type
- array
scanned
- Type
- int
Méthodes28
addDictionaries($name, $folder)
I18nAudit.php:124Add the dictionaries of another package: what the run time merges with the package's.
addModules($folder, $manifest)
I18nAudit.php:140addRelatedPackages()
I18nAudit.php:130The application of a module (<app>/modules/<module>), and the modules of an application (its mmo.json urls).
| retourne | void |
Callee($tokens, $i)
staticI18nAudit.php:457docComment($doc, $file, $line)
I18nAudit.php:486The @title/@label/@description of a docblock: keys, unless a template made only of placeholders.
isIgnored($file, $line)
tIgnoreFile.php:38IsText($text)
staticI18nAudit.php:344jsonKind($file)
I18nAudit.php:599| $file | string | |
| retourne | null | string | the kind of a json file whose texts are translated (JSON_FIELDS), null for the others |
key($side, $key, $file, $line)
I18nAudit.php:349A text written for translation: French, it is a French literal; English, a key to find in a dictionary.
LooksFrench($text)
staticI18nAudit.php:331matchesFilter($rel)
I18nAudit.php:308ParseJsDictionary($content, $lang)
staticI18nAudit.php:183PhpString($literal)
staticI18nAudit.php:477readDictionaries($folder, $manifest)
I18nAudit.php:156readIgnore($name)
tIgnoreFile.php:24ReadManifest($folder)
staticI18nAudit.php:113run()
I18nAudit.php:244Scan the package and check its keys.
| retourne | array | missing: array{php: list<array{0: string, 1: int, 2: string}>, js: list<array{0: string, 1: int, 2: string}>}, elsewhere: array{php: array<string, string>, js: array<string, string>}, conflicts: array<string, array<string, string>>, french: list<array{0: string, 1: int, 2: string}>, counts: array<string, int>, dictionaries: array<string, array{php: int, js: int, own: bool, files: list<string>}> } |
scanFile($file, $rel)
I18nAudit.php:313scanHtml($html, $file, $lines, $lineOffset)
I18nAudit.php:528Scan markup: its scripts (<script>, on*= attributes, {= … } expressions) as js, its text nodes and its attributes (but SKIP_ATTRIBUTES) for French.
scanJs($content, $start, $end, $file, $lines, $untilBrace)
I18nAudit.php:502Scan the script between two offsets of a file: its keys and its strings.
scanJson($content, $file, $kind)
I18nAudit.php:608scanPhp($content, $file, $lines)
I18nAudit.php:368Significant($tokens, $i, $dir)
staticI18nAudit.php:448sources($folder, $manifest)
I18nAudit.php:202text($text, $file, $line, $lines, $base)
I18nAudit.php:357A text shown as is: French, it is reported (a template's markup is looked into: scanHtml).
Walk($folder, $withI18n)
staticI18nAudit.php:215Every file below a folder, but the folders never scanned, a symbolic link, a package of its own.
withLineOffset($lineOffset, $fn)
I18nAudit.php:583Run a scan whose lines are shifted (markup inside a php string).