File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070 $ page_descr = 'Show productization aspects for this locale. ' ;
7171 $ css_include = ['productization.css ' ];
7272 break ;
73- case 'repocomparison ' :
74- $ view = 'repocomparison ' ;
75- break ;
7673 case 'rss ' :
7774 $ controller = 'changelog ' ;
7875 $ template = false ;
Original file line number Diff line number Diff line change 8888
8989 $ locale_entities = $ filter_pattern ($ locale );
9090 $ english_entities = $ filter_pattern ($ ref_locale );
91+ $ english_strings = $ locale_strings = [];
9192
9293 // Skip some special cases (mostly optional strings)
9394 $ path = [];
@@ -260,7 +261,10 @@ function ($entity) use ($path) {
260261 $ stats = Health::getStats ($ projects );
261262 $ translated = $ stats ['translated ' ];
262263 $ reference = $ stats ['total ' ];
263- $ completion = round (($ translated / $ reference ) * 100 , 2 );
264+
265+ // Making sure we never divide by zero while computing percentage
266+ $ completion = $ reference == 0 ? 0 : round (($ translated / $ reference ) * 100 , 2 );
267+
264268 $ completion = $ completion > 100 ? 100 : $ completion ;
265269
266270 // Get color from completion value
Original file line number Diff line number Diff line change 1- <form name="searchform" id="simplesearchform" method="get" action="">
2- <fieldset id="main_search">
3- <fieldset>
4- <label>Locale</label>
5- <select name="locale" title="Locale">
6- <?= $ target_locales_list?>
7- </select>
8- </fieldset>
9- <input type="submit" value="Go" alt="Go" />
10- </fieldset>
11- </form>
1+ <?php
2+
3+ // Include the common simple search form
4+ include __DIR__ . '/simplesearchform.php ' ;
5+ ?>
126
137<h3>Health Status for <?= $ page_locale?> </h3>
148<div id="wrapper">
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2828
2929$ string_count = [];
3030
31- // Referen_ce locale count
31+ // Reference locale count
3232$ count_reference = count ($ strings ['en-US ' ][$ repo ]);
3333
3434foreach ($ gaia_locales as $ val ) {
5757
5858foreach ($ string_count as $ locale => $ numbers ) {
5959 $ completion = $ count_reference - $ numbers ['identical ' ] - $ numbers ['missing ' ];
60- $ completion = number_format ($ completion / $ count_reference * 100 );
60+
61+ // Making sure we never divide by zero while computing percentage
62+ $ completion = $ count_reference == 0 ? 0 : number_format ($ completion / $ count_reference * 100 );
6163
6264 if ($ completion >= 99 ) {
6365 $ confidence = 'Highest ' ;
You can’t perform that action at this time.
0 commit comments