Skip to content

Commit e593ec3

Browse files
Fixes #778: Remove Gaia (#779)
* Remove Gaia * Fix Travis + remove gaia from Health.php tests * remove last references + update tests in AnalyseStrings.php
1 parent 72e77c9 commit e593ec3

34 files changed

Lines changed: 82 additions & 929 deletions

app/classes/Transvision/API.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
* Calls are like this:
1616
* api/<version>/<service>/<repository>/<search type>/<source locale>/<target locale>/<url escaped search>/?optional_parameter1=foo&optional_parameter2=bar
1717
* Example for an entity search containing bookmark:
18-
* http://transvison.mozfr.org/api/v1/tm/release/entity/en-US/fr/bookmark/?case_sensitive=1
18+
* https://transvision.mozfr.org/api/v1/tm/release/entity/en-US/fr/bookmark/?case_sensitive=1
1919
* (tm = translation memory service)
2020
*
2121
* Example for the list of locales supported for a repo:
22-
* http://transvison.mozfr.org/api/v1/locales/gaia/
22+
* https://transvision.mozfr.org/api/v1/locales/mozilla_org/
2323
*
2424
* List of services:
2525
* entity: Return translations for all locales of a Mozilla entity

app/classes/Transvision/AnalyseStrings.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ public static function differences($tmx_source, $tmx_target, $repo, $ignored_str
4343
$pattern_mismatch = [];
4444

4545
switch ($repo) {
46-
case Strings::startsWith($repo, 'gaia'):
47-
$patterns = [
48-
'l10njs' => '/\{\{\s*([a-z0-9_]+)\s*\}\}/iu', // {{foobar2}}
49-
];
50-
break;
5146
case 'firefox_ios':
5247
$patterns = [
5348
'ios' => '/(%(?:[0-9]+\$){0,1}@)/i', // %@, but also %1$@, %2$@, etc.

app/classes/Transvision/Consistency.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public static function filterStrings($strings_array, $repo)
5454
{
5555
if (Project::isDesktopRepository($repo)) {
5656
$repository_type = 'desktop';
57-
} elseif (in_array($repo, Project::getGaiaRepositories())) {
58-
$repository_type = 'gaia';
5957
} else {
6058
$repository_type = $repo;
6159
}
@@ -77,18 +75,6 @@ public static function filterStrings($strings_array, $repo)
7775
return true;
7876
}
7977

80-
if ($repository_type == 'gaia') {
81-
// Ignore plural forms containing [] in the key
82-
if (Strings::inString($key, ['[', ']'])) {
83-
return true;
84-
}
85-
86-
// Ignore accessibility strings
87-
if (strpos($key, 'accessibility.properties') !== false) {
88-
return true;
89-
}
90-
}
91-
9278
if ($repository_type == 'desktop') {
9379
/*
9480
Ignore some specific files:

app/classes/Transvision/Health.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public static function getStatsTab($data, $id, $active)
205205

206206
/**
207207
* Create a panel containing tabs with info for all the repos of this group
208-
* For instance, a panel with tabs for each gaia repo.
208+
* For instance, a panel with tabs for mozilla_org and firefox_ios repos.
209209
*
210210
* @param array $data Array containing all the data for each repo
211211
* @return string HTML element to add in the repo tab

app/classes/Transvision/Project.php

Lines changed: 3 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -25,50 +25,6 @@ class Project
2525
'calendar' => 'Lightning',
2626
];
2727

28-
/**
29-
* Read all supported Gaia versions.
30-
*
31-
* @return array list of supported Gaia versions
32-
*/
33-
public static function getSupportedGaiaVersions()
34-
{
35-
// Gaia versions are dynamically read from gaia_versions.txt
36-
$file_name = APP_SOURCES . 'gaia_versions.txt';
37-
38-
$supported_versions = [];
39-
if (file_exists($file_name)) {
40-
$gaia_versions = file($file_name, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
41-
foreach ($gaia_versions as $gaia_version) {
42-
if ($gaia_version == 'gaia') {
43-
$supported_versions += [
44-
'gaia' => 'Gaia master',
45-
];
46-
} else {
47-
$repo_name = "gaia_{$gaia_version}";
48-
$repo_description = 'Gaia ' . str_replace('_', '.', $gaia_version);
49-
$supported_versions += [
50-
$repo_name => $repo_description,
51-
];
52-
}
53-
}
54-
}
55-
56-
return $supported_versions;
57-
}
58-
59-
/**
60-
* Return the most updated Gaia branch besides master
61-
*
62-
* @return string name of the most updated Gaia branch
63-
*/
64-
public static function getLastGaiaBranch()
65-
{
66-
$gaia_repos = array_keys(self::getSupportedGaiaVersions());
67-
rsort($gaia_repos);
68-
69-
return reset($gaia_repos);
70-
}
71-
7228
/**
7329
* Create a list of all supported repositories.
7430
*
@@ -106,7 +62,7 @@ public static function getRepositories()
10662
/**
10763
* Get the list of repositories with their Display name.
10864
* The array has repo folder names as keys and Display names as value:
109-
* ex: ['gaia_1_4' => 'Gaia 1.4', 'mozilla_org' => 'mozilla.org']
65+
* ex: ['firefox_ios' => 'Firefox for iOS', 'mozilla_org' => 'mozilla.org']
11066
*
11167
* @return array list of local repositories and their Display names
11268
*/
@@ -115,24 +71,6 @@ public static function getRepositoriesNames()
11571
return self::getSupportedRepositories();
11672
}
11773

118-
/**
119-
* Get the list of repositories for Gaia.
120-
* The list is sorted by age (latest master -> older branch)
121-
*
122-
* @return array list of local repositories for Gaia
123-
*/
124-
public static function getGaiaRepositories()
125-
{
126-
$gaia_repos = array_keys(self::getSupportedGaiaVersions());
127-
rsort($gaia_repos);
128-
129-
// 'gaia' repo is the latest master branch, always first
130-
array_pop($gaia_repos);
131-
array_unshift($gaia_repos, 'gaia');
132-
133-
return $gaia_repos;
134-
}
135-
13674
/**
13775
* Get the list of repositories for desktop applications
13876
*
@@ -142,8 +80,7 @@ public static function getDesktopRepositories()
14280
{
14381
return array_diff(
14482
self::getRepositories(),
145-
['mozilla_org', 'firefox_ios'],
146-
self::getGaiaRepositories()
83+
['mozilla_org', 'firefox_ios']
14784
);
14885
}
14986

@@ -228,8 +165,7 @@ public static function isValidRepository($repository)
228165

229166
/**
230167
* Return the correct locale code based on context
231-
* For example: given "es", returns "es-ES" for Bugzilla,
232-
* "es" for Gaia, "es-ES" for other repos.
168+
* For example: given "es", returns "es-ES" for Bugzilla.
233169
*
234170
* @param string $locale Name of the current locale
235171
* @param string $context The context we need to use this locale in
@@ -248,22 +184,6 @@ public static function getLocaleInContext($locale, $context)
248184
'sr-Latn' => 'sr',
249185
];
250186

251-
// Gaia locales
252-
$locale_mappings['gaia'] = [
253-
'es-AR' => 'es',
254-
'es-CL' => 'es',
255-
'es-ES' => 'es',
256-
'es-MX' => 'es',
257-
'gu-IN' => 'gu',
258-
'pa-IN' => 'pa',
259-
'sr' => 'sr-Cyrl',
260-
];
261-
262-
// Use Gaia mapping for all Gaia repositories
263-
if (Strings::startsWith($context, 'gaia')) {
264-
$context = 'gaia';
265-
}
266-
267187
// Firefox for iOS
268188
$locale_mappings['firefox_ios'] = [
269189
'es-AR' => 'es',

app/classes/Transvision/Utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public static function getHtmlSelectOptions($options, $selected, $nice_labels =
239239
/**
240240
* Return an array of strings for a locale from a repository
241241
* @param string $locale Locale we want to have strings for
242-
* @param string $repository string repository such as gaia_2_5, central...
242+
* @param string $repository string repository such as central, mozilla_org...
243243
* @return array Localized strings or empty array if no match
244244
*/
245245
public static function getRepoStrings($locale, $repository)
@@ -263,7 +263,7 @@ public static function getRepoStrings($locale, $repository)
263263
/**
264264
* Return an array of entities for a locale from a repository
265265
* @param string $locale Locale we want to have entities for
266-
* @param string $repository string repository such as gaia_2_5, central...
266+
* @param string $repository string repository such as central, mozilla_org...
267267
* @return array Entities or empty array if no match
268268
*/
269269
public static function getRepoEntities($locale, $repository)

app/classes/Transvision/VersionControl.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public static function getVCS($repo)
2525
];
2626
$vcs['hg'] = array_merge(
2727
Project::getDesktopRepositories(),
28-
Project::getGaiaRepositories(),
2928
$vcs['hg']
3029
);
3130
foreach ($vcs as $system => $repos) {
@@ -50,11 +49,6 @@ public static function VCSRepoName($repo)
5049
$repo = strtoupper($repo == 'central' ? 'trunk' : $repo) . '_L10N';
5150
}
5251

53-
// Gaia
54-
if (substr($repo, 0, 4) == 'gaia') {
55-
$repo = strtoupper($repo);
56-
}
57-
5852
return $repo;
5953
}
6054

@@ -79,27 +73,6 @@ public static function hgPath($locale, $repo, $path)
7973
$exploded_path = explode('/', $path);
8074
$base_folder = $exploded_path[0];
8175

82-
if (Strings::startsWith($repo, 'gaia')
83-
|| in_array(
84-
$base_folder,
85-
[
86-
'apps', 'shared', 'showcase_apps',
87-
'test_apps', 'test_external_apps',
88-
]
89-
)
90-
) {
91-
$locale = Project::getLocaleInContext($locale, $repo);
92-
93-
if ($repo == 'gaia') {
94-
$url .= '/gaia-l10n/' . $locale . '/file/default/';
95-
} else {
96-
$version = str_replace('gaia_', '', $repo);
97-
$url .= '/releases/gaia-l10n/v' . $version . '/' . $locale . '/file/default/';
98-
}
99-
100-
return $url . $path . '/' . $entity_file;
101-
}
102-
10376
$en_US_folder_mess = [
10477
'b2g/',
10578
'b2g/branding/official/',

app/config/config.ini-travis

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ install=/home/travis/build/mozfr/transvision/
1212
config=/home/travis/build/mozfr/transvision/app/config
1313

1414
; URL to l10n web service. Wrap the value between quotes if the URL contains special characters like ~
15-
l10nwebservice = "https://l10n.mozilla-community.org/~flod/mozilla-l10n-query/"
15+
l10nwebservice = "https://flod.org/mozilla-l10n-query/"
1616

1717
; Path to the local Mercurial clones, both en-US and l10n. Could be external
1818
; to the Git checkout of Transvision, as long as scripts have access to it.
@@ -29,6 +29,5 @@ local_svn=/home/travis/build/mozfr/transvision/data/svn
2929
; This path is used to store libraries (e.g. silme)
3030
libraries=/home/travis/build/mozfr/transvision/data/libraries
3131

32-
3332
; Flag to know if we are working in production more or development mode
3433
dev=true

app/inc/dispatcher.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@
7070
$css_files[] = 'tmx.css';
7171
$js_files[] = '/js/select_all.js';
7272
break;
73-
case 'gaia':
74-
$view = 'gaia';
75-
$page_title = 'Gaia Comparison';
76-
$page_descr = 'Check the Status of your GAIA strings across repositories.';
77-
break;
7873
case 'news':
7974
$controller = 'changelog';
8075
$page_title = 'Transvision News and Release Notes';

app/inc/urls.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
'credits' => 'credits',
1212
'downloads' => 'downloads',
1313
'showrepos' => 'showrepos',
14-
'gaia' => 'gaia',
1514
'unchanged' => 'unchangedstrings',
1615
'unlocalized' => 'unlocalized',
1716
'unlocalized-all' => 'unlocalized_all',

0 commit comments

Comments
 (0)