|
5 | 5 | $missing_repos_count = $repos_count = 0; |
6 | 6 | $strings = ['en-US' => [], $locale => []]; |
7 | 7 |
|
| 8 | +$requested_repositories = ''; |
8 | 9 | foreach ($repos as $repo) { |
9 | 10 | if (isset($_GET[$repo])) { |
| 11 | + $requested_repositories .= $repo; |
10 | 12 | $cache_file_english = Utils::getRepoStrings(Project::getReferenceLocale($repo), $repo); |
11 | 13 |
|
12 | 14 | if ($cache_file_english) { |
@@ -47,16 +49,13 @@ function ($e) { |
47 | 49 | $empty_TMX = $repos_count == 0; |
48 | 50 |
|
49 | 51 | // Generate the TMX file |
| 52 | +$content = $check['tmx_format'] == 'normal' |
| 53 | + ? TMX::create($strings, $locale, 'en-US') |
| 54 | + : TMX::createOmegat($strings, $locale, 'en-US'); |
50 | 55 |
|
51 | | -if ($check['tmx_format'] == 'normal') { |
52 | | - $content = TMX::create($strings, $locale, 'en-US'); |
53 | | - $target_file = 'mozilla_en-US_' . $locale . '.tmx'; |
54 | | -} else { |
55 | | - $content = TMX::createOmegat($strings, $locale, 'en-US'); |
56 | | - $target_file = 'mozilla_en-US_' . $locale . '_forOmegaT.tmx'; |
57 | | -} |
58 | | - |
59 | | -$target_file_path = WEB_ROOT . 'download/' . $target_file; |
| 56 | +$tmx_id = md5($requested_repositories); |
| 57 | +$target_file_name = "mozilla_en-US_{$locale}_{$tmx_id}_{$check['tmx_format']}.tmx"; |
| 58 | +$target_file_path = WEB_ROOT . "download/{$target_file_name}"; |
60 | 59 |
|
61 | 60 | unset($strings); |
62 | 61 |
|
|
0 commit comments