Skip to content

Commit

Permalink
VPN: fix links to source file when showing results for all projects
Browse files Browse the repository at this point in the history
  • Loading branch information
flodolo committed Sep 19, 2024
1 parent 2387953 commit 1eeb53e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/classes/Transvision/VersionControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ public static function gitPath($locale, $repo, $path)

return "https://github.com/{$git_repo}/blob/{$git_branch}/{$file_path}";
}
if ($repo == 'vpn_client') {
if ($locale == 'en_US') {
$locale = 'en';
}

return "https://github.com/{$git_repo}/blob/{$git_branch}/{$locale}/{$file_path}";
}
} else {
$file_path = $path;
$git_repo = $repo;
Expand Down
6 changes: 6 additions & 0 deletions tests/units/Transvision/VersionControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ public function getPathDP()
'vpn_client/mozillavpn.xliff.xliff:0f4d892c',
'https://github.com/mozilla-l10n/mozilla-vpn-client-l10n/blob/main/sv_SE/mozillavpn.xliff.xliff',
],
[
'en-US',
'vpn_client',
'vpn_client/mozillavpn.xliff.xliff:0f4d892c',
'https://github.com/mozilla-l10n/mozilla-vpn-client-l10n/blob/main/en/mozillavpn.xliff.xliff',
],
];
}

Expand Down

0 comments on commit 1eeb53e

Please sign in to comment.