Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 1079860 - Use WebApp's manifests instead of locales.ini #171

Merged
merged 2 commits into from
Oct 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions call_screen/call.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
<link href="../style/bb/progress_activity.css" rel="stylesheet" type="text/css">
<link href="style/oncall.css" rel="stylesheet" type="text/css">

<link rel="resource" type="application/l10n" href="../locales/locales.ini">
<link rel="resource" type="application/l10n" href="../locales/date.ini">
<link rel="manifest" href="../manifest.webapp">
<link rel="localization" href="../locales/loop.{locale}.properties">
<link rel="localization" href="../locales/date/date.{locale}.properties">

<script defer src="../libs/lazy_loader.js"></script>
<script defer src="../libs/l10n.js"></script>
Expand Down
16 changes: 9 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
<link rel="stylesheet" type="text/css" href="style/wizard.css">
<link rel="stylesheet" type="text/css" href="style/splash_screen.css">

<link rel="resource" type="application/l10n" href="locales/locales.ini">
<link rel="resource" type="application/l10n" href="locales/date.ini">
<link rel="manifest" href="manifest.webapp">
<link rel="localization" href="locales/loop.{locale}.properties">
<link rel="localization" href="locales/date/date.{locale}.properties">

<script defer src="js/config.js"></script>
<script defer src="js/version.js"></script>
Expand Down Expand Up @@ -74,6 +75,7 @@
<script defer src="js/screens/calllog.js"></script>
<script defer src="js/screens/share.js"></script>
<script defer src="js/screens/settings.js"></script>
<script defer src="js/branding.js"></script>

<script defer src="js/boot.js"></script>
</head>
Expand Down Expand Up @@ -104,7 +106,7 @@ <h1 id="webview-overlay-title"></h1>
<section id="wizard-tutorial-section" class="wizard-section vbox current">
<header id="wizard-tutorial-header">
<p data-l10n-id="welcome"></p>
<p data-l10n-id="serviceName"></p>
<p data-service-name></p>
</header>
<ul id="wizard-tutorial-slideshow" class="fit">
<li class="wizard-tutorial-step">
Expand Down Expand Up @@ -155,12 +157,12 @@ <h1 id="webview-overlay-title"></h1>
<section id="wizard-login" class="wizard-section vbox">
<header>
<p data-l10n-id="startUsing"></p>
<p data-l10n-id="serviceName"></p>
<p data-service-name></p>
<p data-l10n-id="todayWizard"></p>
</header>
<footer class="gaia-footer vbox">
<p>
<span data-l10n-id="byProceeding"><span><br/>
<span data-l10n-id="byProceeding"></span><br/>
<a data-url="http://www.mozilla.com" data-title="ToS" data-webview="true" data-l10n-id="termsOfService"></a>
</p>
<button id="authenticate-msisdn-button" class="wizard-button" data-l10n-id="usePhone">
Expand All @@ -175,7 +177,7 @@ <h1 id="webview-overlay-title"></h1>
<menu type="toolbar">
<a id="open-settings-button"><span class="icon icon-settings"></span></a>
</menu>
<h1 data-l10n-id="serviceName"></h1>
<h1 data-service-name></h1>
</header>
<section id="calllog-container" class="vbox fit">
<nav>
Expand Down Expand Up @@ -304,7 +306,7 @@ <h1 data-l10n-id="settingsTitle"></h1>
</li>
<li class="vbox">
<p data-l10n-id="version"></p>
<p id="settings-commit-hash-tag"></p>
<p id="settings-commit-hash-tag" data-l10n-id="unknown"></p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point you're using the wrong id here (should be unknownUser)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is correct, this is something like Version "1ade43e". Nothing related to users

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, was confused by the fact that the rest of the code was actually using unknown for user

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't apologize mate, everybody can be wrong. Me everyday XD

</li>
</ul>
</section>
Expand Down
5 changes: 1 addition & 4 deletions js/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ window.addEventListener('load', function load() {
// TODO Add LazyLoading
// TODO If it's an incoming call, I launch it before rendering the app
Controller.init();

LazyLoader.load('js/helpers/language_manager.js', () => {
LanguageManager.init();
});
Branding.init();

// Headers have to be properly resized and centered, we emmit a lazyload event
LazyLoader.load('libs/font_size_utils.js', () => {
Expand Down
22 changes: 22 additions & 0 deletions js/branding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

(function(exports) {

var _name = 'Firefox Hello';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move this to Config?


var Branding = {
init: function b_init() {
var elements = document.querySelectorAll('[data-service-name]');
var length = elements.length;
for (var i = 0; i < length; i++) {
elements[i].textContent = _name;
}
},

get name() {
return _name;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this to Config file.

};

exports.Branding = Branding;
}(this));
17 changes: 0 additions & 17 deletions js/helpers/language_manager.js

This file was deleted.

14 changes: 8 additions & 6 deletions js/screens/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@
);
}

// Set the commit based on the version
var id = Version.id;
if (_commitHashTag && id) {
_commitHashTag.removeAttribute('data-l10n-id');
_commitHashTag.textContent = id;
}

this.localize();
// In this point the code is localized, but we want to listen new change
// in language in order to update it properly.
Expand Down Expand Up @@ -225,15 +232,10 @@
_loggedAs.innerHTML = _(
'loggedInAs',
{
username: _identity || _('unknown')
username: _identity || _('unknownUser')
}
);
}

// Set the commit based on the version
if (_commitHashTag && Version.id) {
_commitHashTag.textContent = Version.id || _('unknown');
}
},

show: function s_show() {
Expand Down
2 changes: 1 addition & 1 deletion js/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version = { id: '4399522' };
Version = { id: '59294fd' };
2 changes: 1 addition & 1 deletion libs/font_size_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
},

_initHeaderFormatting: function() {
if (navigator.mozL10n && navigator.mozL10n.once) {
if (navigator.mozL10n) {
// When l10n is ready, register all displayed headers for formatting.
navigator.mozL10n.once(function() {
this._registerHeadersInSubtree(document.body);
Expand Down
Loading