Skip to content

Commit

Permalink
Always use en-US as reference for 'all projects' search (mozfr#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
flodolo authored May 5, 2023
1 parent 9b15f89 commit 1f99fe2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app/classes/Transvision/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,19 @@ public static function getRepoStrings($locale, $repository, $flat = true)
: [$repository];

foreach ($repositories as $repository) {
$file = TMX . "{$locale}/cache_{$locale}_{$repository}.php";
# Ignore meta project (all_projects)
if (Project::isMetaRepository($repository)) {
continue;
}
/*
If the locale requested is en-US, we assume that the research
needs to look at the reference locale (which might be "en"
for some projects).
*/
$repo_locale = ($locale == 'en-US')
? Project::getReferenceLocale($repository)
: $locale;
$file = TMX . "{$repo_locale}/cache_{$repo_locale}_{$repository}.php";
if (! is_file($file)) {
continue;
}
Expand All @@ -183,7 +195,8 @@ public static function getRepoStrings($locale, $repository, $flat = true)
}

/**
* Return a flat array of entity items with structure (repo, entity, entity's text)
* Return a flat array of entity items with structure (repo, entity,
entity's text)
*
* @param string $tmx Array with strings organized per repo
*
Expand Down

0 comments on commit 1f99fe2

Please sign in to comment.