Skip to content

Commit

Permalink
Localize the Welcome dialog
Browse files Browse the repository at this point in the history
And do some small changes in the text.

Signed-off-by: Jan Holesovsky <[email protected]>
Change-Id: I12ee785ff9c38555514a4cd47061342b41b13a29
  • Loading branch information
kendy authored and timar committed Nov 24, 2021
1 parent d3653a5 commit e6f9264
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 15 deletions.
32 changes: 31 additions & 1 deletion browser/src/control/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,18 @@ L.Map.include({
});
},

/** Add various content instead of the variables in the Welcome dialog */
_replaceVars: function(text) {
return text
.replace(/%coolVersion/g, app.socket.WSDServer.Version)
.replace(/%coolAppsURL/g, 'https://www.collaboraoffice.com/solutions/collabora-office-android-ios/')
.replace(/%coolReleaseNotesURL/g, 'https://www.collaboraoffice.com/code-21-11-release-notes/')
.replace(/%coolSdkURL/g, 'https://sdk.collaboraonline.com/')
.replace(/%coolStepByStepURL/g, 'https://collaboraonline.github.io/post/build-code/')
.replace(/%coolTranslationsURL/g, 'https://collaboraonline.github.io/post/translate/')
.replace(/%coolBugreportURL/g, 'https://collaboraonline.github.io/post/filebugs/');
},

// show the actual welcome dialog with the given data
_showWelcomeDialogVex: function(data, calledFromMenu) {
var w;
Expand Down Expand Up @@ -599,6 +611,24 @@ L.Map.include({
$.extend({}, vex.dialog.buttons.YES, { text: btnText }),
],
afterOpen: function() {
$('#welcome-slide1-heading-1').text(map._replaceVars(_('Explore the new %coolVersion')));
$('#welcome-slide1-heading-2').text(_('Collabora Online Development Edition'));
$('#welcome-slide1-content').html(map._replaceVars(_('Enjoy the latest developments in online productivity, free for you to use, to explore and to use with others in the browser. <a href="%coolAppsURL" target="_blank">Apps</a> are also available for Android and iOS. %coolVersion introduces important improvements, in the areas of usability, visual presentation and performance.')));

$('#welcome-slide2-heading-1').text(map._replaceVars(_('Discover all the changes')));
$('#welcome-slide2-heading-2').text(_('Collabora Online Development Edition'));
$('#welcome-slide2-content').html(map._replaceVars(_('Check the <a href="%coolReleaseNotesURL" target="_blank">release notes</a> and learn all about the latest milestone in performance particularly for larger groups working on documents, new native sidebar, new re-worked avatar list, asynchronous saving, faster spell checking and more.')));

$('#welcome-slide3-heading-1').text(_('Integrate Collabora Online into your webapp'));
$('#welcome-slide3-heading-2').text(_('Or get involved in the development'));
$('#welcome-slide3-content').html(map._replaceVars(_('Learn more about integrating into your web application in the <a href="%coolSdkURL" target="_blank">Collabora Online SDK</a>. Or head over to the <a href="%coolStepByStepURL" target="_blank">step-by-step instructions</a> and build CODE from scratch. You can also help out with <a href="%coolTranslationsURL" target="_blank">translations</a> or by <a href="%coolBugreportURL" target="_blank">filing a bug report</a> with all the essential steps on how to reproduce it.')));

$('#welcome-button-next-1').text(_('Next').replace('~', ''));
$('#welcome-button-next-2').text(_('Next').replace('~', ''));
$('#welcome-button-close').text(_('Close').replace('~', ''));

$('#view-supported-versions').text(_('Learn more about the enterprise-ready versions'));

var $vexContent = $(this.contentEl);
this.contentEl.style.width = w + 'px';

Expand All @@ -623,7 +653,7 @@ L.Map.include({

showWelcomeDialog: function(calledFromMenu) {
console.log('showWelcomeDialog, calledFromMenu: ' + calledFromMenu);
var welcomeLocation = 'welcome/welcome-' + String.locale + '.html';
var welcomeLocation = 'welcome/welcome.html';
if (window.socketProxy)
welcomeLocation = window.makeWsUrl('/cool/dist/' + welcomeLocation);

Expand Down
28 changes: 14 additions & 14 deletions browser/welcome/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@
<fig id="fig-slide1-c"></fig>
<fig id="fig-slide1-r"></fig>
</fig>
<h1>Explore the new 21.11</h1>
<h2>Collabora Online Development Edition</h2>
<p>Enjoy the latest developments in online productivity, free for you to use, to explore and to use with others in the browser. Various <a href="https://www.collaboraoffice.com/solutions/collabora-office-android-ios/">apps</a> are also available for mobile. 21.11 introduces important improvements, in the areas of security, performance and user interface.</p>
<h1 id="welcome-slide1-heading-1"></h1>
<h2 id="welcome-slide1-heading-2"></h2>
<p id="welcome-slide1-content"></p>
<div id="user-welcome--buttons">
<form action="#slide-2">
<button type="button" class="ui-pushbutton jsdialog" onclick="onSlideClick('i-slide-2')">Next</button>
<button id='welcome-button-next-1' type="button" class="ui-pushbutton jsdialog" onclick="onSlideClick('i-slide-2')"></button>
</form>
</div>
</div>
<div id="slide-2">
<fig></fig>
<h1>Discover all the changes</h1>
<h2>Collabora Online Development Edition</h2>
<p>Check the <a href="https://www.collaboraoffice.com/press-releases/code-21-11-deliv…nt-collaboration/">release notes</a> and learn all about: The latest milestone in performance particularly for larger groups working on documents; New native sidebar; New re-worked avatar list; Asynchronous save; faster spell checking and more.</p>
<h1 id="welcome-slide2-heading-1"></h1>
<h2 id="welcome-slide2-heading-2"></h2>
<p id="welcome-slide2-content"></p>
<div id="user-welcome--buttons">
<form action="#slide-3">
<button type="button" class="ui-pushbutton jsdialog" onclick="onSlideClick('i-slide-3')">Next</button>
<button id='welcome-button-next-2' type="button" class="ui-pushbutton jsdialog" onclick="onSlideClick('i-slide-3')"></button>
</form>
</div>
</div>
<div id="slide-3">
<fig></fig>
<h1>Get involved</h1>
<h2>https://CollaboraOnline.github.io/</h2>
<p>Are you interested in contributing but don’t know where to start? Head over to the <a href="https://collaboraonline.github.io/post/build-code/">step-by-step instructions</a> and build CODE from scratch. You can also help out with <a href="https://collaboraonline.github.io/post/translate/">translations</a> or by <a href="https://github.com/CollaboraOnline/online/issues/new/choose">filing a bug report</a> with all the essential steps on how to reproduce it.</p>
<h1 id="welcome-slide3-heading-1"></h1>
<h2 id="welcome-slide3-heading-2"></h2>
<p id="welcome-slide3-content"></p>
<div id="user-welcome--buttons">
<button type="button" class="ui-pushbutton jsdialog" onclick="onClose()">Close</button>
<button id='welcome-button-close' type="button" class="ui-pushbutton jsdialog" onclick="vex.closeAll()"></button>
</div>
</div>
</div>
<btn id="i-slide-1" class="active" onclick="onSlideClick(this.id)">1</btn>
<btn id="i-slide-2" onclick="onSlideClick(this.id)">2</btn>
<btn id="i-slide-3" onclick="onSlideClick(this.id)">3</btn>
</div>
<a id="view-supported-versions" href="https://www.collaboraoffice.com/subscriptions/">Browse enterprise-ready versions</a>
</div>
<a id="view-supported-versions" href="https://www.collaboraoffice.com/subscriptions/" target="_blank"></a>
</div>

0 comments on commit e6f9264

Please sign in to comment.