|
7 | 7 |
|
8 | 8 | site_header("Documentation", ["current" => "docs"]); |
9 | 9 |
|
10 | | -$lang = Languages::ACTIVE_ONLINE_LANGUAGES_EX['en']; |
11 | 10 | ?> |
12 | 11 |
|
13 | 12 | <h1>Documentation</h1> |
14 | | -<p>PHP Translates its documentation into many different languages, but the main reference is in English</p> |
15 | | -<div style="display: flex; flex-direction: row; flex: 1 0 250px; border-radius: 0.5em; background: white; padding: 1em; gap: 1em; align-items: center"> |
16 | | - <img style="max-width: 100px; max-height: 80px; object-fit: contain" src="<?= htmlspecialchars($lang['icon'])?>" alt="Flag of <?= htmlspecialchars($lang['label_loc'])?>" /> |
17 | | - <div style="flex: 1 1; display: flex; flex-direction: column"> |
18 | | - <div style="font-size: 125%; font-weight: bold"><?= htmlspecialchars($lang['label_loc']) ?></div> |
19 | | - <div style="font-size: larger"><?= htmlspecialchars($lang['label_en']) ?></div> |
20 | | - </div> |
| 13 | +<div class="content-box"> |
| 14 | + |
| 15 | +<p> |
| 16 | + The PHP Manual is available online in a selection of languages. |
| 17 | + Please pick a language from the list below. |
| 18 | +</p> |
| 19 | + |
| 20 | +<p> |
| 21 | + Note, that many languages are just under translation, and |
| 22 | + the untranslated parts are still in English. Also some translated |
| 23 | + parts might be outdated. The translation teams are |
| 24 | + <a href="https://doc.php.net/">open to contributions</a>. |
| 25 | +</p> |
21 | 26 | </div> |
22 | | -<br /> |
23 | 27 |
|
| 28 | +<p> |
| 29 | + View Online: |
| 30 | +<?php |
24 | 31 |
|
25 | | -<h1>Available Languages</h1> |
26 | | -<div class="content-box"> |
27 | | - <p> |
28 | | - Note, that many languages are just under translation, and |
29 | | - the untranslated parts are still in English. Also some translated |
30 | | - parts might be outdated. The translation teams are |
31 | | - <a href="https://doc.php.net/">open to contributions</a>. |
32 | | - </p> |
33 | | - <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1em"> |
34 | | - <?php foreach (Languages::ACTIVE_ONLINE_LANGUAGES_EX as $langId => $lang) { ?> |
35 | | - <div style="display: flex; flex-direction: row; flex: 1 0 250px; border-radius: 0.5em; background: white; padding: 1em; gap: 1em; align-items: center"> |
36 | | - <img style="max-width: 100px; max-height: 80px; object-fit: contain" src="<?= htmlspecialchars($lang['icon'])?>" alt="Flag of <?= htmlspecialchars($lang['label_loc'])?>" /> |
37 | | - <div style="flex: 1 1; display: flex; flex-direction: column"> |
38 | | - <div style="font-size: 125%; font-weight: bold"><?= htmlspecialchars($lang['label_loc']) ?></div> |
39 | | - <div style="font-size: larger"><?= htmlspecialchars($lang['label_en']) ?></div> |
40 | | - </div> |
41 | | - </div> |
42 | | - <?php } ?> |
43 | | - </div> |
44 | | - <br /><br /> |
| 32 | +// List all manual languages viewable online |
| 33 | +$lastlang = array_key_last(Languages::ACTIVE_ONLINE_LANGUAGES); |
| 34 | +foreach (Languages::ACTIVE_ONLINE_LANGUAGES as $langcode => $langname) { |
| 35 | + if (!file_exists($_SERVER["DOCUMENT_ROOT"] . "/manual/{$langcode}/index.php")) { |
| 36 | + continue; |
| 37 | + } |
45 | 38 |
|
46 | | -</div> |
| 39 | + // Make preferred language bold |
| 40 | + if ($langcode === $LANG) { echo "<strong>"; } |
| 41 | + |
| 42 | + echo '<a href="/manual/' . $langcode . '/">' . $langname . '</a>'; |
| 43 | + echo ($lastlang !== $langcode) ? ",\n" : "\n"; |
| 44 | + |
| 45 | + if ($langcode === $LANG) { echo "</strong>"; } |
| 46 | +} |
47 | 47 |
|
| 48 | +?> |
| 49 | +</p> |
48 | 50 |
|
49 | | -<h2>More Options</h2> |
| 51 | +<p> |
| 52 | + The language currently being used as the default for you should be in |
| 53 | + <strong>bold</strong> above. You can change the setting for this on the |
| 54 | + <a href="/my.php">My PHP.net customization page</a>. |
| 55 | +</p> |
| 56 | + |
| 57 | +<p> |
50 | 58 | For downloadable formats, please visit our |
51 | 59 | <a href="download-docs.php">documentation downloads</a> page. |
52 | 60 | </p> |
|
0 commit comments