diff --git a/app/models/tmx_downloading.php b/app/models/tmx_downloading.php index 17651be5..f6fc30be 100644 --- a/app/models/tmx_downloading.php +++ b/app/models/tmx_downloading.php @@ -5,8 +5,10 @@ $missing_repos_count = $repos_count = 0; $strings = ['en-US' => [], $locale => []]; +$requested_repositories = ''; foreach ($repos as $repo) { if (isset($_GET[$repo])) { + $requested_repositories .= $repo; $cache_file_english = Utils::getRepoStrings(Project::getReferenceLocale($repo), $repo); if ($cache_file_english) { @@ -47,16 +49,13 @@ function ($e) { $empty_TMX = $repos_count == 0; // Generate the TMX file +$content = $check['tmx_format'] == 'normal' + ? TMX::create($strings, $locale, 'en-US') + : TMX::createOmegat($strings, $locale, 'en-US'); -if ($check['tmx_format'] == 'normal') { - $content = TMX::create($strings, $locale, 'en-US'); - $target_file = 'mozilla_en-US_' . $locale . '.tmx'; -} else { - $content = TMX::createOmegat($strings, $locale, 'en-US'); - $target_file = 'mozilla_en-US_' . $locale . '_forOmegaT.tmx'; -} - -$target_file_path = WEB_ROOT . 'download/' . $target_file; +$tmx_id = md5($requested_repositories); +$target_file_name = "mozilla_en-US_{$locale}_{$tmx_id}_{$check['tmx_format']}.tmx"; +$target_file_path = WEB_ROOT . "download/{$target_file_name}"; unset($strings); diff --git a/app/views/tmx_downloading.php b/app/views/tmx_downloading.php index f36f1fe8..ebdf73f5 100644 --- a/app/views/tmx_downloading.php +++ b/app/views/tmx_downloading.php @@ -25,7 +25,7 @@ Download or '; + echo 'Download or '; } ?> Go back to TMX creation page