Exemple #1
0
         // return $arr;
         return array_filter($arr, 'strlen');
     };
     if ($cache = Cache::getKey($cache_id)) {
         return $cache;
     } else {
         $filtered_strings = $filter_empty(Utils::getRepoStrings($lang, $repo));
         Cache::setKey($cache_id, $filtered_strings);
         return $filtered_strings;
     }
 };
 $strings[$locale][$repo] = $cache_filtered_strings($locale, $locale . $repo . 'filteredstrings');
 $strings[$ref_locale][$repo] = $cache_filtered_strings($ref_locale, $ref_locale . $repo . 'filteredstrings');
 // If Desktop, parse the strings to get components
 if (in_array($repo, Project::getDesktopRepositories())) {
     foreach (Project::getComponents($strings[$locale][$repo]) as $component) {
         $filter_pattern = function ($locale_code) use($component, $repo, $strings) {
             return array_filter(preg_grep('#^' . $component . '/.*#', array_keys($strings[$locale_code][$repo])), 'strlen');
         };
         $locale_entities = $filter_pattern($locale);
         $english_entities = $filter_pattern($ref_locale);
         // Skip some special cases (mostly optional strings)
         $path = [];
         switch ($component) {
             case 'browser':
                 $path[] = $component . '/branding';
                 $path[] = $component . '/chrome/browser/devtools/styleeditor.dtd:noStyleSheet-tip';
                 $path[] = $component . '/chrome/browser-region/region.properties';
                 break;
             case 'extensions':
                 $path[] = $component . '/irc/chrome/chatzilla.properties:pref.bugKeyword';