Skip to content

Commit

Permalink
Add translations
Browse files Browse the repository at this point in the history
  • Loading branch information
lhfu committed Sep 1, 2017
1 parent bdc00a2 commit 9eae941
Show file tree
Hide file tree
Showing 17 changed files with 448 additions and 250 deletions.
29 changes: 29 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,33 @@ module.exports = function (grunt) {
src: 'dist/origin-web-common.js',
dest: 'dist/origin-web-common.min.js'
}
},

// Settings for gettext
nggettext_extract: {
pot: {
files: {
'po/openshift.pot': ['src/components/**/*.html', 'src/components/**/*.js']
}
}
},

nggettext_compile: {
all: {
options: {
format: "json"
},
files: [
{
expand: true,
dot: true,
cwd: "po",
dest: "languages",
src: ["*.po"],
ext: ".json"
}
]
}
}
});

Expand All @@ -147,6 +174,8 @@ module.exports = function (grunt) {
grunt.registerTask('test', ['karma']);
grunt.registerTask('check', ['test']);
grunt.registerTask('help', ['availabletasks']);

grunt.registerTask('update-pot', ['nggettext_extract']);
}

init({});
Expand Down
11 changes: 6 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "origin-web-common",
"version": "0.0.51",
"name": "dm-origin-web-common",
"version": "0.0.52",
"main": [
"dist/origin-web-common.js",
"dist/origin-web-common.css"
],
"authors": [
"Red Hat"
],
"description": "Library of common services and components for OpenShift Web Console.",
"description": "Library of common services and components for OpenShift Web Console. I18n support added.",
"license": "Apache-2.0",
"ignore": [
"Gruntfile.js",
Expand All @@ -24,7 +24,7 @@
],
"repository": {
"type": "git",
"url": "git://github.com/openshift/origin-web-common.git"
"url": "git://github.com/Dataman-Cloud/origin-web-common.git"
},
"dependencies": {
"angular": "~1.5.11",
Expand All @@ -37,7 +37,8 @@
"kubernetes-label-selector": "~2.0.0",
"lodash": "~4.17.4",
"patternfly": "~3.26.1",
"uri.js": "~1.18.12"
"uri.js": "~1.18.12",
"angular-gettext": "2.3.9"
},
"devDependencies": {
"angular-mocks": "~1.5.11",
Expand Down
113 changes: 54 additions & 59 deletions dist/origin-web-common-ui.js

Large diffs are not rendered by default.

113 changes: 54 additions & 59 deletions dist/origin-web-common.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/origin-web-common.min.js

Large diffs are not rendered by default.

113 changes: 54 additions & 59 deletions dist/scripts/templates.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"bower": "^1.8.0",
"express": "3.4.4",
"grunt": "0.4.5",
"grunt-cli": "^1.2.0",
"grunt-angular-templates": "0.5.7",
"grunt-available-tasks": "0.4.3",
"grunt-cli": "^1.2.0",
"grunt-angular-gettext": "^2.3.6",
"grunt-contrib-clean": "0.4.1",
"grunt-contrib-concat": "0.3.0",
"grunt-contrib-connect": "0.5.0",
Expand Down
187 changes: 187 additions & 0 deletions po/openshift.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Project-Id-Version: \n"

#: src/components/binding/bindResults.html:13
msgid "<strong>{{ctrl.serviceToBind}}</strong> <span>has been bound</span> <span ng-if=\"ctrl.bindType === 'application'\"> to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>"
msgstr ""

#: src/components/create-project/createProject.html:64
#: src/components/edit-project/editProject.html:18
msgid "A short description."
msgstr ""

#: src/components/create-project/createProject.html:25
msgid "A unique name for the project."
msgstr ""

#: src/components/binding/bindResults.html:44
msgid "An error occurred creating the binding."
msgstr ""

#: src/components/binding/bindResults.html:37
msgid "Binding Failed"
msgstr ""

#: src/components/binding/bindServiceForm.html:47
msgid "Bindings can be created later from within a project."
msgstr ""

#: src/components/binding/bindApplicationForm.html:7
msgid "Bindings create a secret containing the necessary information for an application to use a service."
msgstr ""

#: src/components/binding/bindServiceForm.html:7
msgid "Bindings create a secret containing the necessary information for an application to use this service."
msgstr ""

#: src/components/create-project/createProject.html:77
#: src/components/delete-project/delete-project-modal.html:27
msgid "Cancel"
msgstr ""

#: src/components/toast-notifications/toast-notifications.html:7
msgid "Close"
msgstr ""

#: src/components/truncate-long-text/truncateLongText.html:16
#: src/components/truncate-long-text/truncateLongText.html:20
msgid "Collapse"
msgstr ""

#: src/components/create-project/createProject.html:69
msgid "Create"
msgstr ""

#: src/components/binding/bindServiceForm.html:5
msgid "Create a binding for"
msgstr ""

#: src/components/binding/bindApplicationForm.html:5
msgid "Create a binding for application <strong>{{ctrl.applicationName}}</strong>"
msgstr ""

#: src/components/binding/bindServiceForm.html:16
msgid "Create a secret and inject it into an application"
msgstr ""

#: src/components/delete-project/delete-project-button.html:10
msgid "Delete Project"
msgstr ""

#: src/components/create-project/createProject.html:60
#: src/components/edit-project/editProject.html:14
msgid "Description"
msgstr ""

#: src/components/create-project/createProject.html:50
#: src/components/edit-project/editProject.html:4
msgid "Display Name"
msgstr ""

#: src/components/binding/bindServiceForm.html:44
msgid "Do not bind at this time"
msgstr ""

#: src/components/binding/bindApplicationForm.html:22
msgid "Do not bind at this time."
msgstr ""

#: src/components/binding/bindResults.html:35
msgid "Error"
msgstr ""

#: src/components/binding/bindResults.html:27
msgid "Info"
msgstr ""

#: src/components/binding/bindResults.html:23
msgid "Its data will be available to your application as environment variables."
msgstr ""

#: src/components/create-project/createProject.html:54
#: src/components/edit-project/editProject.html:8
msgid "My Project"
msgstr ""

#: src/components/create-project/createProject.html:4
msgid "Name"
msgstr ""

#: src/components/create-project/createProject.html:28
msgid "Name is required."
msgstr ""

#: src/components/create-project/createProject.html:33
msgid "Name must have at least two characters."
msgstr ""

#: src/components/binding/bindResults.html:5
msgid "Pending"
msgstr ""

#: src/components/create-project/createProject.html:38
msgid "Project names may only contain lower-case letters, numbers, and dashes. They may not start or end with a dash."
msgstr ""

#: src/components/binding/bindServiceForm.html:39
msgid "Secrets can be referenced later from an application."
msgstr ""

#: src/components/truncate-long-text/truncateLongText.html:12
msgid "See All"
msgstr ""

#: src/components/binding/bindApplicationForm.html:13
msgid "Select a service:"
msgstr ""

#: src/components/binding/bindResults.html:12
msgid "Success"
msgstr ""

#: src/components/binding/bindResults.html:18
msgid "The binding operation created the secret"
msgstr ""

#: src/components/binding/bindResults.html:28
msgid "The binding secret will only be available to new pods. You will need to redeploy your application."
msgstr ""

#: src/components/binding/bindResults.html:6
msgid "The binding was created but is not ready yet."
msgstr ""

#: src/components/binding/bindApplicationForm.html:49
msgid "There are no bindable services in this project"
msgstr ""

#: src/components/create-project/createProject.html:43
msgid "This name is already in use. Please choose a different name."
msgstr ""

#: src/components/binding/bindApplicationForm.html:38
msgid "This service is not yet ready. If you bind to it, then the binding will be pending until the service is ready."
msgstr ""

#: src/components/delete-project/delete-project-modal.html:6
msgid "This will <strong>delete all resources</strong> associated with the project {{project | displayName}} and <strong>cannot be undone</strong>. Make sure this is something you really want to do!"
msgstr ""

#: src/components/delete-project/delete-project-modal.html:10
msgid "Type the name of the project to confirm."
msgstr ""

#: src/components/create-project/createProject.html:9
msgid "my-project"
msgstr ""

#: src/components/delete-project/delete-project-modal.html:12
msgid "project to delete"
msgstr ""

#: src/components/binding/bindResults.html:22
msgid "that you may need to reference in your application."
msgstr ""
12 changes: 6 additions & 6 deletions src/components/binding/bindApplicationForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<form>
<div class="form-group">
<label>
<h3>Create a binding for application <strong>{{ctrl.applicationName}}</strong></h3>
<h3 translate>Create a binding for application <strong>{{ctrl.applicationName}}</strong></h3>
</label>
<span class="help-block">
<span class="help-block" translate>
Bindings create a secret containing the necessary information for an application to use a service.
</span>
</div>
</form>

<label ng-if="!ctrl.allowNoBinding">
<label ng-if="!ctrl.allowNoBinding" translate>
Select a service:
</label>
<form name="ctrl.formName">
Expand All @@ -19,7 +19,7 @@ <h3>Create a binding for application <strong>{{ctrl.applicationName}}</strong></
<div ng-if="ctrl.allowNoBinding" class="bind-service-selection">
<label>
<input type="radio" ng-model="ctrl.serviceToBind" ng-value="null">
Do not bind at this time.
<translate>Do not bind at this time.</translate>
</label>
<div class="bind-description">
<span class="help-block service-instance-name">
Expand All @@ -35,7 +35,7 @@ <h3>Create a binding for application <strong>{{ctrl.applicationName}}</strong></
<div class="bind-description">
<span class="pficon pficon-info"
ng-if="!(serviceInstance | isServiceInstanceReady)"
data-content="This service is not yet ready. If you bind to it, then the binding will be pending until the service is ready."
data-content="{{'This service is not yet ready. If you bind to it, then the binding will be pending until the service is ready.'|translate}}"
data-toggle="popover"
data-trigger="hover">
</span>
Expand All @@ -46,7 +46,7 @@ <h3>Create a binding for application <strong>{{ctrl.applicationName}}</strong></
</div>
<h4 ng-if="!ctrl.bindableServiceInstances.length">
<span class="pficon pficon-info" aria-hidden="true"></span>
<span class="help-block service-instance-name">
<span class="help-block service-instance-name" translate>
There are no bindable services in this project
</span>
</h4>
Expand Down
28 changes: 13 additions & 15 deletions src/components/binding/bindResults.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,46 @@
<div ng-if="!(ctrl.binding | isBindingReady)" class="bind-status" ng-class="{'text-center': !ctrl.progressInline, 'show-progress': !ctrl.progressInline}">
<div class="spinner" ng-class="{'spinner-sm': ctrl.progressInline, 'spinner-inline': ctrl.progressInline, 'spinner-lg': !ctrl.progressInline}" aria-hidden="true"></div>
<h3 class="bind-message">
<span class="sr-only">Pending</span>
<div class="bind-pending-message" ng-class="{'progress-inline': ctrl.progressInline}">The binding was created but is not ready yet.</div>
<span class="sr-only" translate>Pending</span>
<div class="bind-pending-message" ng-class="{'progress-inline': ctrl.progressInline}" translate>The binding was created but is not ready yet.</div>
</h3>
</div>
<div ng-if="(ctrl.binding | isBindingReady)">
<div class="bind-status">
<span class="pficon pficon-ok" aria-hidden="true"></span>
<span class="sr-only">Success</span>
<h3 class="bind-message">
<strong>{{ctrl.serviceToBind}}</strong>
<span>has been bound</span>
<span ng-if="ctrl.bindType === 'application'"> to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>
<span class="sr-only" translate>Success</span>
<h3 class="bind-message" translate>
<strong>{{ctrl.serviceToBind}}</strong> <span>has been bound</span> <span ng-if="ctrl.bindType === 'application'"> to <strong>{{ctrl.applicationToBind}}</strong> successfully</span>
</h3>
</div>
<div class="sub-title">
The binding operation created the secret
<translate>The binding operation created the secret</translate>
<a ng-if="ctrl.secretHref && 'secrets' | canI : 'list'"
ng-href="{{ctrl.secretHref}}">{{ctrl.binding.spec.secretName}}</a>
<span ng-if="!ctrl.secretHref || !('secrets' | canI : 'list')">{{ctrl.binding.spec.secretName}}</span>
that you may need to reference in your application.
<span ng-if="ctrl.showPodPresets">Its data will be available to your application as environment variables.</span>
<translate>that you may need to reference in your application.</translate>
<span ng-if="ctrl.showPodPresets" translate>Its data will be available to your application as environment variables.</span>
</div>
<div class="alert alert-info bind-info">
<span class="pficon pficon-info" aria-hidden="true"></span>
<span class="sr-only">Info</span>
The binding secret will only be available to new pods. You will need to redeploy your application.
<span class="sr-only" translate>Info</span>
<translate>The binding secret will only be available to new pods. You will need to redeploy your application.</translate>
</div>
</div>
</div>
<div ng-if="ctrl.error">
<div class="bind-status">
<span class="pficon pficon-error-circle-o text-danger" aria-hidden="true"></span>
<span class="sr-only">Error</span>
<span class="sr-only" translate>Error</span>
<h3 class="bind-message">
<span>Binding Failed</span>
<span translate>Binding Failed</span>
</h3>
</div>
<div class="sub-title">
<span ng-if="ctrl.error.data.message">
{{ctrl.error.data.message | upperFirst}}
</span>
<span ng-if="!ctrl.error.data.message">
<span ng-if="!ctrl.error.data.message" translate>
An error occurred creating the binding.
</span>
</div>
Expand Down
Loading

0 comments on commit 9eae941

Please # to comment.