/[debian-med]/trunk/community/website/locales.php
ViewVC logotype

Contents of /trunk/community/website/locales.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 639 - (show annotations) (download)
Sat Oct 6 09:32:12 2007 UTC (5 years, 7 months ago) by hanska-guest
File size: 4530 byte(s)
Locale warning message shown throughout the website.
Messages updated.
1 <?php
2 require_once("inc/header.inc.php");
3 ?>
4 <table class="columns">
5 <tr>
6 <td class="left">
7 <span class="section"><?=_("summary")?></span>
8 <div class="section">
9 <div class="sectionTop"></div>
10 <div class="row" style="text-align: center;">
11 <?=_("Current locale")?>:<br />
12 <strong><?=$locale?></strong>
13 </div>
14 <div class="row" style="text-align: center;">
15 <?=_("Priority")?>:<br />
16 <strong><?=$priority?></strong>
17 </div>
18 <?php
19 if ($show_locale_warning) {
20 ?>
21 <div class="row">
22 <p class="error">
23 <p style="text-align: center;">
24 <img src="/img/warning.png" />
25 </p>
26 <?=_("You're using a low priority locale.<br />Please ask the site administrators to add your locale, or provide one yourself :).")?>
27 <br /><br />
28 <?php
29 $msg = _("More information on how to contribute to the Debian-Med project, can be found in the %1How to Contribute%2 page.");
30 echo str_replace(array("%1", "%2"),
31 array('<a href="/contribute.php"><del>', '</del></a>'),
32 $msg);
33 ?>
34 </p>
35 </div>
36 <?php
37 }
38 ?>
39 </div>
40 </td>
41 <td class="main">
42 <span class="section"><?=_("localization")?></span>
43 <div class="section">
44 <div class="sectiontop"></div>
45 <div class="row">
46 <h1><?=_("Currently installed locales")?></h1>
47 <table>
48 <tr>
49 <th><?=_("locale")?></th>
50 <th><?=_("translation status")?></th>
51 <th><?=_("author")?></th>
52 <th><?=_("team")?></th>
53 </tr>
54 <tr>
55 <td style="text-align: center"><strong>en_US</strong></td>
56 <td style="text-align: center"><strong>100%</strong> (builtin)</td>
57 <td></td>
58 <td></td>
59 </tr>
60 <?php
61 require_once("inc/po-stats.inc.php");
62
63 $handle = opendir("locale/");
64 $avail_locales = array();
65 while ($file = readdir($handle)) {
66 if ($file != "." && $file != ".." && $file != ".svn") {
67 // we get this $locales_dir from locale.inc.php
68 if (is_dir("locale/$file")) {
69 $po = "locale/$file/LC_MESSAGES/messages.po";
70 $avail_locales[$file] = makePOStats($po);
71 }
72 }
73 }
74
75 while (list($code, $lang) = each($avail_locales)) {
76 $lang["complete"] = round($lang["complete"], 2);
77 if ($lang["complete"] == "100") {
78 $lang["complete"] = "<strong>".$lang["complete"]."</strong>";
79 }
80 ?>
81 <tr>
82 <td style="text-align: center"><strong><?=$code?></strong></td>
83 <td style="text-align: center"><?=$lang["complete"]?>%</td>
84 <td><?=str_replace(array("<", ">"), array("&lt;", "&gt;"), $lang["author"])?></td>
85 <td><?=str_replace(array("<", ">"), array("&lt;", "&gt;") ,$lang["team"])?></td>
86 </tr>
87 <?php
88 }
89 ?>
90 </table>
91 </div>
92 <div class="row">
93 <h1><?=_("Add new locale")?></h1>
94 <span class="info">
95 <p class="info">
96 To add a new locale, please use your authenticated SVN access.<br />
97 First, checkout the locale/ directory:
98 <pre>
99 $ svn co svn+ssh://myaliothlogin@svn.debian.org/svn/debian-med/trunk/community/website/locale/</pre>
100 After this, create a new directory for your locale (let's suppose it's fr_FR):
101 <pre>
102 $ mkdir -p fr_FR/LC_MESSAGES/</pre>
103 Next step is actually adding the .po catalog. Copy the .pot template to your newly created
104 directory, and start translating:
105 <pre>
106 $ cp messages.pot fr_FR/LC_MESSAGES/messages.po
107 $ cd fr_FR/LC_MESSAGES/
108 $ vi messages.po</pre>
109 Now you need to compile the catalog you've just translated, and add everything under SVN
110 control (we're in the LC_MESSAGES/ directory in this example):
111 <pre>
112 $ msgfmt messages.po
113 $ ls
114 messages.mo messages.po
115 $ cd ../../ # up to the locale/ directory
116 $ ls
117 it_IT/ fr_FR/ messages.pot
118 $ svn add fr_FR/
119 A fr_FR/
120 A fr_FR/LC_MESSAGES/
121 A fr_FR/LC_MESSAGES/messages.mo
122 A fr_FR/LC_MESSAGES/messages.po
123 $ </pre>
124 Now it's time to commit the changes:
125 <pre>
126 $ svn commit -m "Adding fr_FR locale"
127 Sending locale/fr_FR/
128 Sending locale/fr_FR/LC_MESSAGES/
129 Sending locale/fr_FR/LC_MESSAGES/messages.mo
130 Sending locale/fr_FR/LC_MESSAGES/messages.po
131 Sending data ....
132 Commit of Revision xxx done.
133 $ </pre>
134 Please note that the <em>automatic loading</em> of locales has not been tested yet. Please
135 send an e-mail to <a href="mailto:debian-med@lists.debian.org">debian-med@lists.debian.org</a>
136 if you encounter any problems.
137 </p>
138 </span>
139 </div>
140 </div>
141 </td>
142 </tr>
143 </table>
144 <?php
145 require_once("inc/footer.inc.php");
146 ?>

  ViewVC Help
Powered by ViewVC 1.1.5