Skip to content

Commit 30c04c6

Browse files
authored
Share common markup for PHP 8.0 release page translations (#1530)
1 parent 4102ab3 commit 30c04c6

File tree

29 files changed

+1592
-6051
lines changed

29 files changed

+1592
-6051
lines changed

releases/8.0/common.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,13 @@ function language_chooser(string $currentLang): void {
6969
</form>
7070
';
7171
}
72+
73+
function message($code, $language = 'en')
74+
{
75+
$original = require __DIR__ . '/languages/en.php';
76+
if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) {
77+
$translation = require __DIR__ . '/languages/' . $language . '.php';
78+
}
79+
80+
return $translation[$code] ?? $original[$code] ?? $code;
81+
}

0 commit comments

Comments
 (0)