Merge pull request #4129 from vector-im/matthew/i18n-welcome

i18n welcome
This commit is contained in:
Matthew Hodgson 2017-06-01 18:08:17 +01:00 committed by GitHub
commit 29e58be7f4
3 changed files with 60 additions and 30 deletions

View file

@ -3,37 +3,37 @@
<div class="mx_HomePage_col mx_HomePage_header">
<a href="https://riot.im"><img src="home/images/logo.svg" class="mx_HomePage_logo"></a>
<div>
<h1>Welcome to Riot.im</h1>
<h2>Decentralised, encrypted chat &amp; collaboration powered by <a href="https://matrix.org"><img width="79" height="34" style="padding-left: 1px;vertical-align: middle" src="home/images/matrix.svg"/></a></h2>
<h1>_t("Welcome to Riot.im")</h1>
<h2>_t("Decentralised, encrypted chat &amp; collaboration powered by") <a href="https://matrix.org"><img width="79" height="34" alt="[matrix]" style="padding-left: 1px;vertical-align: middle" src="home/images/matrix.svg"/></a></h2>
</div>
</div>
<div class="mx_HomePage_col mx_HomePage_toprow">
<div class="mx_HomePage_row">
<div>
<h3>Search the room directory</h3>
<h3>_t("Search the room directory")</h3>
<a class="mx_HomePage_room" href="#/room/#matrix:matrix.org">
<img class="mx_HomePage_icon" src="img/icons-directory.svg">
</a>
<span class="mx_HomePage_comment">
Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent.
Check out the directory!
_t("Lots of rooms already exist in Matrix, linked to existing networks (Slack, IRC, Gitter etc) or independent.
Check out the directory!")
</span>
</div>
</div>
<div class="mx_HomePage_row">
<div>
<h3>Chat with Riot Bot</h3>
<h3>_t("Chat with Riot Bot")</h3>
<a class="mx_HomePage_room" href="#/user/@riot-bot:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot-bot.png">
</a>
<span class="mx_HomePage_comment">
Get started with some tips from Riot Bot!
_t("Get started with some tips from Riot Bot!")
</span>
</div>
</div>
</div>
<h3>General discussion about Matrix</h3>
<h3>_t("General discussion about Matrix")</h3>
<div class="mx_HomePage_row">
<div class="mx_HomePage_room">
@ -41,33 +41,33 @@
<img class="mx_HomePage_icon" src="home/rooms/matrix.png">
<span class="mx_HomePage_name">Matrix HQ</span>
</a>
<span class="mx_HomePage_desc">Discussion of all things Matrix!</span>
<span class="mx_HomePage_desc">_t("Discussion of all things Matrix!")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#riot:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot.png">
<span class="mx_HomePage_name">Riot</span>
</a>
<span class="mx_HomePage_desc">Riot/Web &amp; Desktop chat</span>
<span class="mx_HomePage_desc">_t("Riot/Web &amp; Desktop chat")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#riot-ios:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot-ios.png">
<span class="mx_HomePage_name">#riot-ios</span>
</a>
<span class="mx_HomePage_desc">Riot/iOS &amp; matrix-ios-sdk chat</span>
<span class="mx_HomePage_desc">_t("Riot/iOS &amp; matrix-ios-sdk chat")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#riot-android:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot-android.png">
<span class="mx_HomePage_name">#riot-android</span>
</a>
<span class="mx_HomePage_desc">Riot/Android &amp; matrix-android-sdk chat</span>
<span class="mx_HomePage_desc">_t("Riot/Android &amp; matrix-android-sdk chat")</span>
</div>
</div>
<h3>Matrix technical discussions</h3>
<h4>Running Matrix services</h4>
<h3>_t("Matrix technical discussions")</h3>
<h4>_t("Running Matrix services")</h4>
<div class="mx_HomePage_row">
<div class="mx_HomePage_room">
@ -75,32 +75,32 @@
<img class="mx_HomePage_icon" src="home/rooms/matrix.png">
<span class="mx_HomePage_name">Synapse Support Community</span>
</a>
<span class="mx_HomePage_desc">Community-run support for Synapse</span>
<span class="mx_HomePage_desc">_t("Community-run support for Synapse")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#dendrite:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/dendrite.png">
<span class="mx_HomePage_name">#dendrite:matrix.org</span>
</a>
<span class="mx_HomePage_desc">Admin support for Dendrite</span>
<span class="mx_HomePage_desc">_t("Admin support for Dendrite")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#homeowners:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/homeowners.png">
<span class="mx_HomePage_name">Synapse Homeowners</span>
</a>
<span class="mx_HomePage_desc">Announcements about Synapse releases</span>
<span class="mx_HomePage_desc">_t("Announcements about Synapse releases")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#irc:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/irc.png">
<span class="mx_HomePage_name">IRC Matrix Bridges</span>
</a>
<span class="mx_HomePage_desc">Support for those using and running matrix-appservice-irc</span>
<span class="mx_HomePage_desc">_t("Support for those using and running matrix-appservice-irc")</span>
</div>
</div>
<h4>Building services on Matrix</h4>
<h4>_t("Building services on Matrix")</h4>
<div class="mx_HomePage_row">
<div class="mx_HomePage_room">
@ -108,46 +108,46 @@
<img class="mx_HomePage_icon" src="home/rooms/matrix-dev.png">
<span class="mx_HomePage_name">#matrix-dev:matrix.org</span>
</a>
<span class="mx_HomePage_desc">Support for those using the Matrix spec</span>
<span class="mx_HomePage_desc">_t("Support for those using the Matrix spec")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#e2e:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/e2e.png">
<span class="mx_HomePage_name">End-to-end crypto in Matrix</span>
</a>
<span class="mx_HomePage_desc">Design and implementation of E2E in Matrix</span>
<span class="mx_HomePage_desc">_t("Design and implementation of E2E in Matrix")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#vr:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/vr.png">
<span class="mx_HomePage_name">#vr:matrix.org</span>
</a>
<span class="mx_HomePage_desc">Implementing VR services with Matrix</span>
<span class="mx_HomePage_desc">_t("Implementing VR services with Matrix")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#webrtc:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/webrtc.png">
<span class="mx_HomePage_name">#webrtc:matrix.org</span>
</a>
<span class="mx_HomePage_desc">Implementing VoIP services with Matrix</span>
<span class="mx_HomePage_desc">_t("Implementing VoIP services with Matrix")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#identity:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/identity.jpg">
<span class="mx_HomePage_name">Matrix Identity</span>
</a>
<span class="mx_HomePage_desc">Discussion of the Identity Service API</span>
<span class="mx_HomePage_desc">_t("Discussion of the Identity Service API")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#bridging:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/bridging.png">
<span class="mx_HomePage_name">Matrix Bridging</span>
</a>
<span class="mx_HomePage_desc">Support for those using, running and writing other bridges</span>
<span class="mx_HomePage_desc">_t("Support for those using, running and writing other bridges")</span>
</div>
</div>
<h4>Contributing code to Matrix and Riot</h4>
<h4>_t("Contributing code to Matrix and Riot")</h4>
<div class="mx_HomePage_row">
<div class="mx_HomePage_room">
@ -155,21 +155,21 @@
<img class="mx_HomePage_icon" src="home/rooms/riot-dev.png">
<span class="mx_HomePage_name">#riot-dev</span>
</a>
<span class="mx_HomePage_desc">Dev chat for the Riot/Web dev team</span>
<span class="mx_HomePage_desc">_t("Dev chat for the Riot/Web dev team")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#dendrite-dev:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/dendrite-dev.png">
<span class="mx_HomePage_name">#dendrite-dev</span>
</a>
<span class="mx_HomePage_desc">Dev chat for the Dendrite dev team</span>
<span class="mx_HomePage_desc">_t("Dev chat for the Dendrite dev team")</span>
</div>
<div class="mx_HomePage_room">
<a href="#/room/#riotweb-translations:matrix.org">
<img class="mx_HomePage_icon" src="home/rooms/riot-translations.png">
<span class="mx_HomePage_name">Riot-Web Translations</span>
</a>
<span class="mx_HomePage_desc">Co-ordination for Riot/Web translators</span>
<span class="mx_HomePage_desc">_t("Co-ordination for Riot/Web translators")</span>
</div>
</div>
</div>

View file

@ -22,6 +22,8 @@ import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
import sdk from 'matrix-react-sdk';
import GeminiScrollbar from 'react-gemini-scrollbar';
import request from 'browser-request';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
import sanitizeHtml from 'sanitize-html';
module.exports = React.createClass({
displayName: 'HomePage',
@ -64,6 +66,7 @@ module.exports = React.createClass({
this.setState({ page: "Couldn't load home page" });
}
body = body.replace(/_t\(['"]([\s\S]*?)['"]\)/mg, (match, g1)=>{ return sanitizeHtml(_t(g1)) });
this.setState({ page: body });
}
);

View file

@ -128,5 +128,32 @@
"Today": "Today",
"Yesterday": "Yesterday",
"Welcome page": "Welcome page",
"With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!": "With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!"
"With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!": "With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!",
"Welcome to Riot.im": "Welcome to Riot.im",
"Decentralised, encrypted chat &amp; collaboration powered by": "Decentralised, encrypted chat &amp; collaboration powered by",
"Search the room directory": "Search the room directory",
"Chat with Riot Bot": "Chat with Riot Bot",
"Get started with some tips from Riot Bot!": "Get started with some tips from Riot Bot!",
"General discussion about Matrix": "General discussion about Matrix",
"Discussion of all things Matrix!": "Discussion of all things Matrix!",
"Riot/Web &amp; Desktop chat": "Riot/Web &amp; Desktop chat",
"Riot/iOS &amp; matrix-ios-sdk chat": "Riot/iOS &amp; matrix-ios-sdk chat",
"Riot/Android &amp; matrix-android-sdk chat": "Riot/Android &amp; matrix-android-sdk chat",
"Matrix technical discussions": "Matrix technical discussions",
"Running Matrix services": "Running Matrix services",
"Community-run support for Synapse": "Community-run support for Synapse",
"Admin support for Dendrite": "Admin support for Dendrite",
"Announcements about Synapse releases": "Announcements about Synapse releases",
"Support for those using and running matrix-appservice-irc": "Support for those using and running matrix-appservice-irc",
"Building services on Matrix": "Building services on Matrix",
"Support for those using the Matrix spec": "Support for those using the Matrix spec",
"Design and implementation of E2E in Matrix": "Design and implementation of E2E in Matrix",
"Implementing VR services with Matrix": "Implementing VR services with Matrix",
"Implementing VoIP services with Matrix": "Implementing VoIP services with Matrix",
"Discussion of the Identity Service API": "Discussion of the Identity Service API",
"Support for those using, running and writing other bridges": "Support for those using, running and writing other bridges",
"Contributing code to Matrix and Riot": "Contributing code to Matrix and Riot",
"Dev chat for the Riot/Web dev team": "Dev chat for the Riot/Web dev team",
"Dev chat for the Dendrite dev team": "Dev chat for the Dendrite dev team",
"Co-ordination for Riot/Web translators": "Co-ordination for Riot/Web translators"
}