From 1dce9cda9e0823feeb66efcf3eb38245c722d7d9 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 31 May 2017 16:02:59 +0100 Subject: [PATCH] Translate src/components/views/globals directory and elements already done --- .../views/globals/GuestWarningBar.js | 15 +++++++++-- src/components/views/globals/NewVersionBar.js | 25 ++++++++++++++----- src/i18n/strings/en_EN.json | 4 +++ 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/src/components/views/globals/GuestWarningBar.js b/src/components/views/globals/GuestWarningBar.js index 810021cc..6cf11fed 100644 --- a/src/components/views/globals/GuestWarningBar.js +++ b/src/components/views/globals/GuestWarningBar.js @@ -15,7 +15,8 @@ limitations under the License. */ var React = require('react'); -var dis = require('matrix-react-sdk/lib/dispatcher') +var dis = require('matrix-react-sdk/lib/dispatcher'); +import { _tJsx } from 'matrix-react-sdk/lib/languageHandler'; module.exports = React.createClass({ displayName: 'GuestWarningBar', @@ -34,7 +35,17 @@ module.exports = React.createClass({
/!\
- You are Rioting as a guest. Register or sign in to access more rooms and features. + { _tJsx( + "You are Rioting as a guest. Register or sign in to access more rooms and features!", + [ + /(.*?)<\/a>/, + /(.*?)<\/a>/ + ], + [ + (sub) => {sub}, + (sub) => {sub} + ] + ) }
); diff --git a/src/components/views/globals/NewVersionBar.js b/src/components/views/globals/NewVersionBar.js index 3e03be72..219ef02a 100644 --- a/src/components/views/globals/NewVersionBar.js +++ b/src/components/views/globals/NewVersionBar.js @@ -20,6 +20,7 @@ import React from 'react'; import sdk from 'matrix-react-sdk'; import Modal from 'matrix-react-sdk/lib/Modal'; import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; /** * Check a version string is compatible with the Changelog @@ -40,9 +41,9 @@ export default React.createClass({ displayReleaseNotes: function(releaseNotes) { const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog'); Modal.createDialog(QuestionDialog, { - title: "What's New", + title: _t("What's New"), description:
{releaseNotes}
, - button: "Update", + button: _t("Update"), onFinished: (update) => { if(update && PlatformPeg.get()) { PlatformPeg.get().installUpdate(); @@ -75,17 +76,29 @@ export default React.createClass({ // automatically tells you what's changed (provided the versions // are in the right format) if (this.props.releaseNotes) { - action_button = ; + action_button = ( + + ); } else if (checkVersion(this.props.version) && checkVersion(this.props.newVersion)) { - action_button = ; + action_button = ( + + ); } else if (PlatformPeg.get()) { - action_button = ; + action_button = ( + + ); } return (
/!\
- A new version of Riot is available. + {_t("A new version of Riot is available.")}
{action_button}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 80899de1..3d14423b 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1,5 +1,6 @@ { "Safari and Opera work too.": "Safari and Opera work too.", + "A new version of Riot is available.": "A new version of Riot is available.", "Add an email address above to configure email notifications": "Add an email address above to configure email notifications", "Advanced notification settings": "Advanced notification settings", "All messages": "All messages", @@ -125,11 +126,14 @@ "Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s", "View Decrypted Source": "View Decrypted Source", "View Source": "View Source", + "What's New": "What's New", + "What's new?": "What's new?", "When I'm invited to a room": "When I'm invited to a room", "World readable": "World readable", "You cannot delete this image. (%(code)s)": "You cannot delete this image. (%(code)s)", "You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)", "You are not receiving desktop notifications": "You are not receiving desktop notifications", + "You are Rioting as a guest. Register or sign in to access more rooms and features!": "You are Rioting as a guest. Register or sign in to access more rooms and features!", "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply", "Sunday": "Sunday", "Monday": "Monday",