File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1616// Limit results to 200
1717array_splice ($ locale1_strings , 200 );
1818
19- // Get the locale results
20- $ results = [];
21-
22- foreach ($ locale1_strings as $ key => $ str ) {
23- $ results [$ key ] = $ tmx_target [$ key ];
24- }
25-
2619$ perfect = $ imperfect = [];
2720
2821// We want to test compound words as well, /ex: 'switch to'
@@ -77,7 +70,7 @@ function ($element) use ($word) {
7770$ get_results = function ($ arr ) use ($ tmx_target ) {
7871 $ results = [];
7972 foreach ($ arr as $ val ) {
80- if ($ tmx_target [$ val ] != '' ) {
73+ if (isset ( $ tmx_target [ $ val ]) && $ tmx_target [$ val ] != '' ) {
8174 $ results [$ val ] = $ tmx_target [$ val ];
8275 }
8376 }
Original file line number Diff line number Diff line change @@ -309,16 +309,23 @@ function ($str) {
309309 . '</tr> ' ;
310310
311311foreach ($ common_keys as $ key => $ val ) {
312+ $ get_localized_string = function ($ id ) use ($ key , $ strings ) {
313+ // Avoid warnings if the string is not localized
314+
315+ return isset ($ strings [$ id ][$ key ]) ?
316+ $ strings [$ id ][$ key ] :
317+ '<em class="error">missing string</em> ' ;
318+ };
312319 if (trim (strtolower ($ strings [$ englishchanges [0 ] . '-en-US ' ][$ key ])) != trim (strtolower ($ strings [$ englishchanges [1 ] . '-en-US ' ][$ key ]))) {
313320 $ table .=
314321 '<tr> '
315322 . '<td><span class="celltitle">Key</span><div class="string"> ' . ShowResults::formatEntity ($ key ) . '</div></td> '
316323 . '<td><span class="celltitle">Gaia ' . $ repo_one . '</span><div class="string"> '
317324 . ShowResults::highlight (Utils::secureText ($ strings [$ englishchanges [0 ] . '-en-US ' ][$ key ]), 'en-US ' )
318- . '<br><small> ' . Utils:: secureText ( $ strings [ $ englishchanges [0 ]][ $ key ]) . '</small></div></td> '
325+ . '<br><small> ' . $ get_localized_string ( $ englishchanges [0 ]) . '</small></div></td> '
319326 . '<td><span class="celltitle">Gaia ' . $ repo_two . '</span><div class="string"> '
320327 . ShowResults::highlight (Utils::secureText ($ strings [$ englishchanges [1 ] . '-en-US ' ][$ key ]), 'en-US ' )
321- . '<br><small> ' . Utils:: secureText ( $ strings [ $ englishchanges [1 ]][ $ key ]) . '</small></div></td> '
328+ . '<br><small> ' . $ get_localized_string ( $ englishchanges [1 ]) . '</small></div></td> '
322329 . '</tr> ' ;
323330 }
324331}
You can’t perform that action at this time.
0 commit comments