From 9a61cf87f5e4f45280067d0c0a4e9f73a8805fca Mon Sep 17 00:00:00 2001 From: megala21 Date: Tue, 3 Oct 2017 00:05:11 +0530 Subject: [PATCH] Adding support for internationalization --- .../src/main/resources/publisher/package.json | 1 + .../publisher/public/locales/en.json | 43 +++++++++++ .../publisher/src/common/constants.js | 8 +++ .../AppPublisherBase/BaseLayout.jsx | 3 +- .../Application/ApplicationListing.jsx | 14 ++-- .../Application/Create/ApplicationCreate.jsx | 21 ++++-- .../Application/Create/CreateSteps/Step1.jsx | 51 ++++++------- .../Application/Create/CreateSteps/Step2.jsx | 18 ++--- .../Application/Create/CreateSteps/Step3.jsx | 16 +++-- .../Edit/Base/ApplicationEditBaseLayout.jsx | 10 +-- .../Edit/GenenralInfo/GeneralInfo.jsx | 71 +++++++++---------- .../Release/Create/CreateRelease.jsx | 9 ++- .../Release/Create/UploadPackage.jsx | 40 +++++++---- .../Release/ReleaseMgtBase/ReleaseManager.jsx | 8 +-- .../Application/View/ApplicationView.jsx | 17 +++-- .../src/main/resources/publisher/src/index.js | 32 ++++++++- .../resources/publisher/webpack.config.js | 1 - 17 files changed, 233 insertions(+), 130 deletions(-) create mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/locales/en.json diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/package.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/package.json index 441f751757..9c9755c4a1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/package.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/package.json @@ -46,6 +46,7 @@ "mocha": "^3.4.1", "mock-local-storage": "^1.0.2", "node-sass": "^4.5.3", + "react-intl": "^2.4.0", "sass-loader": "^6.0.6", "style-loader": "^0.18.1", "webpack": "^2.7.0" diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/locales/en.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/locales/en.json new file mode 100644 index 0000000000..81f452f40c --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/locales/en.json @@ -0,0 +1,43 @@ +{ + "Title" : "Title", + "Description" : "Description", + "Category" : "Category", + "Visibility" : "Visibility", + "Devices" : "Devices", + "Roles" : "Roles", + "Groups" : "Groups", + "Tags" : "Tags", + "Platform" : "Platform", + "Platforms" : "Platfomrs", + "No.Platform" : "No Platforms", + "Screenshots" : "Screenshots", + "Icon" : "Icon", + "Banner" : "Banner", + "Create.Application" : "Create Application", + "Back" : "Back", + "Cancel" : "Cancel", + "Finish" : "Finish", + "Continue" : "Continue", + "Application.Name" : "Application Name", + "General" : "General", + "App.Releases" : "Application Releases", + "Package.Manager" : "Package Manager", + "Save" : "Save", + "Create.Release" : "Create Release", + "Release" : "Release", + "New.Release.For" : "New Release for", + "Upload.Package.File" : "Upload Package File", + "Upload" : "Upload", + "Select.from.package.library" : "Select from package library", + "Release.Name" : "Release Name", + "Release.Notes" : "Release Notes", + "Send.for.Review" : "Send for Review", + "Production.Releases" : "Production Releases", + "Beta.Releases" : "Beta Releases", + "Alpha.Releases" : "Alpha Releases", + "Version" : "Version", + "Status" : "Status", + "App.Publisher" : "Application Publisher" + + +} \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/common/constants.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/common/constants.js index 336b122e7b..c0f22aaeca 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/common/constants.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/common/constants.js @@ -43,5 +43,13 @@ export default class Constants { REFRESH_TOKEN_URL: "", WSO2_USER: 'wso2_user', PARTIAL_TOKEN: 'WSO2_IOT_TOKEN' + }; + + static hostConstants = { + baseURL : window.location.origin, + appContext : window.location.pathname.split("/")[1] + } + + static defaultLocale = "en"; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx index 6b845f796c..843788c7c3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx @@ -23,6 +23,7 @@ import AuthHandler from "../../api/authHandler"; import ApplicationCreate from '../Application/Create/ApplicationCreate'; import {Col, Container, Input, Row,} from 'reactstrap'; import FloatingButton from "../UIComponents/FloatingButton/FloatingButton"; +import {FormattedMessage} from 'react-intl'; /** * Base Layout: @@ -75,7 +76,7 @@ class BaseLayout extends Component {