Skip to content

Commit 7de10cc

Browse files
committed
Support new project firefox.com
1 parent e3ffb8e commit 7de10cc

File tree

6 files changed

+39
-5
lines changed

6 files changed

+39
-5
lines changed

app/classes/Transvision/Project.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ class Project
8383
'source_type' => 'mixed',
8484
'variable_patterns' => ['ftl'],
8585
],
86+
'firefox_com' => [
87+
'git_repository' => 'mozilla-l10n/www-firefox-l10n',
88+
'git_branch' => 'main',
89+
'pontoon_project' => 'firefoxcom',
90+
'reference_locale' => 'en',
91+
'source_type' => 'mixed',
92+
'variable_patterns' => ['ftl'],
93+
],
8694
'android_l10n' => [
8795
'git_repository' => 'mozilla-l10n/android-l10n',
8896
'git_branch' => 'master',
@@ -114,8 +122,8 @@ class Project
114122
],
115123
// Products using Git
116124
'git' => [
117-
'android_l10n', 'firefox_ios', 'gecko_strings', 'mozilla_org',
118-
'seamonkey', 'thunderbird', 'vpn_client',
125+
'android_l10n', 'firefox_ios', 'gecko_strings', 'firefox_com',
126+
'mozilla_org', 'seamonkey', 'thunderbird', 'vpn_client',
119127
],
120128
// Products using free text search on Pontoon
121129
'text_search' => [

app/classes/Transvision/VersionControl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ public static function gitPath($locale, $repo, $path)
129129

130130
return "https://github.com/{$git_repo}/blob/{$git_branch}/{$file_path}";
131131
}
132-
if ($repo == 'mozilla_org') {
133-
// Special case for mozilla.org (Fluent)
132+
if ($repo == 'mozilla_org' || $repo == "firefox_com") {
133+
// Special case for mozilla.org and firefox.com (Fluent)
134134
if ($locale != 'en') {
135135
$file_path = str_replace('en/', "{$locale}/", $file_path);
136136
}

app/models/unchanged_strings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22
namespace Transvision;
33

4-
// Set up the repository selector, remove meta project and mozilla.org
4+
// Set up the repository selector, remove meta project, mozilla.org, firefox.com
55
$repositories = Project::getSupportedRepositories(true);
66
unset($repositories['mozilla_org']);
7+
unset($repositories['firefox_com']);
78
$repository_selector = Utils::getHtmlSelectOptions($repositories, $repo, true);
89

910
$reference_locale = Project::getReferenceLocale($repo);

app/scripts/bash_variables.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ folders+=( $seamonkey_path )
2525
mozilla_org=$local_git/mozilla_org/
2626
folders+=( $mozilla_org )
2727

28+
# Location of firefox.com repository (Fluent based)
29+
firefox_com=$local_git/firefox_com/
30+
folders+=( $firefox_com )
31+
2832
# Firefox for iOS, Android-l10n, VPN Client
2933
android_l10n=$local_git/android_l10n/
3034
firefox_ios=$local_git/firefox_ios/

app/scripts/glossaire.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,27 @@ function updateMozOrg() {
230230
nice -20 $install/app/scripts/tmx/tmx_projectconfig.py $mozilla_org/l10n-vendor.toml --ref en --repo mozilla_org
231231
}
232232

233+
function updateFirefoxCom() {
234+
if [ "$checkrepo" = true ]
235+
then
236+
cd $firefox_com
237+
echogreen "Update GitHub repository"
238+
git pull
239+
fi
240+
echogreen "Extract strings for firefox.com (Fluent)"
241+
cd $install
242+
nice -20 $install/app/scripts/tmx/tmx_projectconfig.py $firefox_com/l10n-pontoon.toml --ref en --repo firefox_com
243+
nice -20 $install/app/scripts/tmx/tmx_projectconfig.py $firefox_com/l10n-vendor.toml --ref en --repo firefox_com
244+
}
245+
233246
echogreen "Activating virtualenv..."
234247
source $install/python-venv/bin/activate || exit 1
235248

236249
updateMultirepo gecko_strings
237250
updateMultirepo thunderbird
238251
updateSeamonkey
239252
updateMozOrg
253+
updateFirefoxCom
240254
updateOtherProduct firefox_ios "Firefox for iOS" tmx_xliff
241255
updateOtherProduct vpn_client "Mozilla VPN Client" tmx_xliff
242256
updateAndroidl10n

app/scripts/setup.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ then
189189
git clone https://github.com/mozilla-l10n/www-l10n .
190190
fi
191191

192+
cd $firefox_com
193+
if [ ! -d $firefox_com/.git ]
194+
then
195+
echogreen "Checking out firefox.com (Fluent) repo"
196+
git clone https://github.com/mozilla-l10n/www-firefox-l10n .
197+
fi
198+
192199
cd $firefox_ios
193200
if [ ! -d $firefox_ios/.git ]
194201
then

0 commit comments

Comments
 (0)