aboutsummaryrefslogtreecommitdiff
path: root/cli/check.translation.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2025-09-05 09:56:46 -0400
committerGravatar GitHub <noreply@github.com> 2025-09-05 15:56:46 +0200
commit23ba48c71f0d41bbe012d668349f6516dad527b4 (patch)
treeb5680e834c2b87becdded07e0555227ade9d7629 /cli/check.translation.php
parent3d85eb19380021031e9d1193919ba516bbc99573 (diff)
Change how files are included (#7916)
1. `include`, `include_once`, `require` and `require_once` are expressions not functions, parentheses are not necessary. 2. to move up the directory tree, it's better to use the `dirname` function instead of relying on `/..`.
Diffstat (limited to 'cli/check.translation.php')
-rwxr-xr-xcli/check.translation.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/check.translation.php b/cli/check.translation.php
index 151a6084f..01e90a631 100755
--- a/cli/check.translation.php
+++ b/cli/check.translation.php
@@ -6,7 +6,7 @@ require_once __DIR__ . '/i18n/I18nCompletionValidator.php';
require_once __DIR__ . '/i18n/I18nData.php';
require_once __DIR__ . '/i18n/I18nFile.php';
require_once __DIR__ . '/i18n/I18nUsageValidator.php';
-require_once __DIR__ . '/../constants.php';
+require_once dirname(__DIR__) . '/constants.php';
$cliOptions = new class extends CliOptionsParser {
/** @var array<int,string> $language */
@@ -104,7 +104,7 @@ function embedSvg(string $contents): string {
if ($cliOptions->generateReadme) {
$supportedFormats = ['txt', 'svg'];
- $flagsDir = __DIR__ . '/../docs/i18n/flags';
+ $flagsDir = dirname(__DIR__) . '/docs/i18n/flags';
$markdownImgStr = '';
foreach ($percentage as $lang => $value) {
@@ -131,7 +131,7 @@ if ($cliOptions->generateReadme) {
$template = '<!-- This file is automatically generated by `cli/check.translation.php -g` -->' . "\n";
if ($svg === '') {
- $i18nGen = include __DIR__ . "/../app/i18n/$lang/gen.php";
+ $i18nGen = include dirname(__DIR__) . "/app/i18n/$lang/gen.php";
if (!is_array($i18nGen) || !is_string($i18nGen['flag'] ?? null)) {
echo 'Error: No Unicode flag found for language ' . $lang, PHP_EOL;
exit(1);