Skip to content

Commit

Permalink
fix localization bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmerAL committed Sep 16, 2017
1 parent 706c076 commit d4b2767
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 13 deletions.
5 changes: 4 additions & 1 deletion pages/crash/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<html>

<head>
<meta charset="UTF-8"/>

<title data-string="crashErrorTitle"></title>
<link rel="stylesheet" href="../pagebase.css" />
<link rel="stylesheet" href="../../ext/font-awesome-4.4.0/css/font-awesome.min.css" />
</head>
Expand All @@ -19,4 +22,4 @@ <h2 data-string="crashErrorSubtitle"></h2>
<script src="../../dist/localization.build.js"></script>
</body>

</html>
</html>
13 changes: 10 additions & 3 deletions pages/error/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,20 @@ const errorCodes = {

var err = errorCodes[ec]

var title, subtitle

if (err) {
h1.innerHTML += err.name || ''
h2.innerHTML += err.message || ''
title = err.name || ''
subtitle = err.message || ''
} else {
h1.innerHTML += l('genericError')
title = l('genericError')
subtitle = ''
}

h1.textContent = title
h2.textContent = subtitle
document.title = title

if (err.secondaryAction) {
secondaryButton.hidden = false
secondaryButton.textContent = err.secondaryAction.title
Expand Down
4 changes: 3 additions & 1 deletion pages/error/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<html>

<head>
<meta charset="UTF-8" />

<link rel="stylesheet" href="../pagebase.css" />
<link rel="stylesheet" href="../../ext/font-awesome-4.4.0/css/font-awesome.min.css" />
</head>
Expand All @@ -25,4 +27,4 @@ <h2 id="error-desc"></h2>
<script src="error.js"></script>
</body>

</html>
</html>
4 changes: 3 additions & 1 deletion pages/phishing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<html>

<head>
<title>Malicious site detected</title>
<meta charset="UTF-8"/>

<title data-string="phishingErrorTitle"></title>
<link rel="stylesheet" href="../pagebase.css" />
<link rel="stylesheet" href="phishingError.css" />
<!-- hack to turn the browser tabs red -->
Expand Down
4 changes: 3 additions & 1 deletion pages/sessionRestoreError/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<html>

<head>
<Title>Session Restore Error</Title>
<meta charset="UTF-8" />

<title data-string="sessionRestoreErrorTitle"></title>
<link rel="stylesheet" href="../pagebase.css" />
<link rel="stylesheet" href="../../ext/font-awesome-4.4.0/css/font-awesome.min.css" />
</head>
Expand Down
14 changes: 8 additions & 6 deletions pages/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<html>

<head>
<title>Preferences | Min</title>
<meta charset="UTF-8" />

<!-- title is set in JS -->

<link rel="stylesheet" href="../../css/base.css" />
<link rel="stylesheet" href="settings.css" />
<link rel="stylesheet" href="../../ext/font-awesome-4.4.0/css/font-awesome.min.css" />
Expand All @@ -12,7 +15,7 @@
<div class="banner yellow-background" id="restart-required-banner" hidden>
<div class="container padding">
<i class="fa fa-info-circle"></i>
<span data-string="settingsRestartRequired"></span>
<span data-string="settingsRestartRequired"></span>
</div>
</div>

Expand Down Expand Up @@ -62,8 +65,7 @@ <h3 data-string="settingsSwipeNavigationHeading"></h3>
<div class="container padding" id="search-engine-settings-container">
<h3 data-string="settingsSearchEngineHeading"></h3>

<label for="defaultSearchEngine" data-string="settingsDefaultSearchEngine"></label>
&nbsp;
<label for="defaultSearchEngine" data-string="settingsDefaultSearchEngine"></label> &nbsp;
<select id="default-search-engine" name="defaultSearchEngine" style="min-width: 225px"></select>

<div class="light-fade" style="padding-top:0.4em" data-string="settingsDDGExplanation"></div>
Expand All @@ -85,8 +87,8 @@ <h3 data-string="settingsKeyboardShortcutsHeading"></h3>
<script src="../../js/util/settings.js"></script>
<script src="../../js/util/searchEngine.js"></script>
<script src="../../js/util/theme.js"></script>
<script src="../../dist/localization.build.js"></script>
<script src="../../dist/localization.build.js"></script>
<script src="settings.js"></script>
</body>

</html>
</html>
2 changes: 2 additions & 0 deletions pages/settings/settings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
document.title = l('settingsPreferencesHeading') + ' | Min'

var container = document.getElementById('privacy-settings-container')
var trackerCheckbox = document.getElementById('checkbox-block-trackers')
var banner = document.getElementById('restart-required-banner')
Expand Down

0 comments on commit d4b2767

Please sign in to comment.