Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
bower_components/*
node_modules/*
templates.js
templates.js
30 changes: 29 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,30 @@ module.exports = function(grunt) {
src: 'views/**.html',
dest: 'templates.js'
}
},
nggettext_extract: {
pot: {
files: {
'po/kubernetes-object-describer.pot': ['views/*.html']
}
}
},
nggettext_compile: {
all: {
options: {
format: "json"
},
files: [
{
expand: true,
dot: true,
cwd: "po",
dest: "dist/languages",
src: ["*.po"],
ext: ".json"
}
]
}
}
});

Expand All @@ -99,6 +123,9 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-wiredep');
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-angular-gettext');

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

grunt.registerTask('serve', [
'less',
Expand All @@ -109,10 +136,11 @@ module.exports = function(grunt) {
]);

grunt.registerTask('build', [
'nggettext_compile',
'less',
'ngtemplates',
'concat'
]);
grunt.registerTask('default', ['serve']);

};
};
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"dist/object-describer.js"
],
"dependencies": {
"angular": "~1.3.8"
"angular": "~1.3.8",
"angular-gettext": "~2.1.0"
},
"devDependencies": {
"bootstrap": "~3.3.4",
Expand Down
1 change: 1 addition & 0 deletions dist/languages/ja.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ja":{"Name":"名前"}}
168 changes: 84 additions & 84 deletions dist/object-describer.js

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
</style>
</head>
<body ng-app="exampleApp" style="margin-left: 10px;">
<label translate>Select a language:</label>
<select ng-model="lang"
ng-options="lang for lang in languages"
ng-change="switchLanguage()">
</select>
<h1>Default generic describer</h1>
<kubernetes-object-describer resource="kubernetesExamplePod" more-details-link="example/path/to/more/details.htm"></kubernetes-object-describer>
<hr>
Expand All @@ -45,6 +50,7 @@ <h1>Replication Controller describer</h1>
<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-gettext/dist/angular-gettext.js"></script>
<!-- endbower -->
<!-- endbuild -->

Expand All @@ -57,15 +63,21 @@ <h1>Replication Controller describer</h1>

<script src="bower_components/jQuery/dist/jquery.js"></script>
<script type="text/javascript">
angular.module('exampleApp', ['kubernetesUI'])
.run(function($rootScope) {
angular.module('exampleApp', ['kubernetesUI', 'gettext'])
.run(function($rootScope, gettextCatalog) {
// TODO any example JS will go here
$rootScope.kubernetesExamplePod = window.EXAMPLE_POD;
$rootScope.kubernetesExampleService = window.EXAMPLE_SERVICE;
$rootScope.kubernetesExampleHeadlessService = window.EXAMPLE_HEADLESS_SERVICE;
$rootScope.kubernetesExampleNodePortService = window.EXAMPLE_NODE_PORT_SERVICE;
$rootScope.kubernetesExampleLoadBalancedService = window.EXAMPLE_LOAD_BALANCED_SERVICE;
$rootScope.kubernetesExampleRC = window.EXAMPLE_RC;
$rootScope.languages = ['en', 'ja'];
$rootScope.lang = 'en';
$rootScope.switchLanguage = function() {
gettextCatalog.setCurrentLanguage($rootScope.lang);
gettextCatalog.loadRemote('/dist/languages/' + $rootScope.lang + '.json');
};
});
</script>
</body>
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-angular-gettext": "^2.1.3",
"grunt-angular-templates": "~0.5.7",
"grunt-contrib-concat": "~0.5.1",
"grunt-contrib-connect": "~0.9.0",
"grunt-contrib-jshint": "~0.11.1",
"grunt-contrib-less": "~1.0.0",
"grunt-wiredep": "~2.0.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-angular-templates": "~0.5.7",
"grunt-contrib-concat": "~0.5.1"
"grunt-wiredep": "~2.0.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
222 changes: 222 additions & 0 deletions po/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Project-Id-Version: \n"
"Language: ja\n"

#: views/annotations.html:1
msgid "Annotations"
msgstr ""

#: views/pod.html:28
msgid "Container Statuses"
msgstr ""

#: views/pod-template.html:10
msgid "Containers"
msgstr ""

#: views/metadata.html:6
#: views/pod.html:8
#: views/replication-controller.html:8
#: views/service.html:8
msgid "Created"
msgstr ""

#: views/pod-template.html:5
msgid "DNS policy"
msgstr ""

#: views/containers.html:15
msgid "Env vars"
msgstr ""

#: views/_collapse-long-text.html:3
msgid "Expand"
msgstr ""

#: views/volumes.html:15
msgid "GCE persistent disk"
msgstr ""

#: views/volumes.html:18
msgid "Git repository"
msgstr ""

#: views/service.html:12
msgid "IP"
msgstr ""

#: views/pod.html:22
msgid "IP on node"
msgstr ""

#: views/containers.html:5
msgid "Image"
msgstr ""

#: views/service.html:23
msgid "Ingress points"
msgstr ""

#: views/labels.html:1
msgid "Labels"
msgstr ""

#: views/container-statuses.html:9
msgid "Last State"
msgstr ""

#: views/footer.html:2
msgid "More details..."
msgstr ""

#: views/container-statuses.html:3
#: views/containers.html:3
#: views/metadata.html:2
#: views/pod.html:4
#: views/replication-controller.html:4
#: views/service.html:4
#: views/volumes.html:3
msgid "Name"
msgstr "名前"

#: views/metadata.html:4
#: views/pod.html:6
#: views/replication-controller.html:6
#: views/service.html:6
msgid "Namespace"
msgstr ""

#: views/pod.html:19
msgid "Node"
msgstr ""

#: views/service.html:16
msgid "None"
msgstr ""

#: views/volumes.html:8
msgid "Path"
msgstr ""

#: views/pod.html:17
msgid "Phase"
msgstr ""

#: views/containers.html:8
#: views/service.html:14
msgid "Ports"
msgstr ""

#: views/container-statuses.html:13
msgid "Ready"
msgstr ""

#: views/replication-controller.html:10
msgid "Replicas"
msgstr ""

#: views/volumes.html:19
msgid "Repository"
msgstr ""

#: views/container-statuses.html:15
msgid "Restart Count"
msgstr ""

#: views/pod-template.html:3
#: views/pod.html:10
msgid "Restart policy"
msgstr ""

#: views/volumes.html:21
msgid "Revision"
msgstr ""

#: views/container-state.html:9
msgid "Running"
msgstr ""

#: views/replication-controller.html:13
#: views/service.html:29
msgid "Selector"
msgstr ""

#: views/pod-template.html:7
#: views/pod.html:12
msgid "Service account"
msgstr ""

#: views/service.html:21
msgid "Session affinity"
msgstr ""

#: views/container-statuses.html:5
msgid "State"
msgstr ""

#: views/pod.html:15
msgid "Status"
msgstr ""

#: views/container-state.html:13
msgid "Terminated"
msgstr ""

#: views/service.html:10
#: views/volumes.html:11
#: views/volumes.html:14
#: views/volumes.html:17
#: views/volumes.html:6
msgid "Type"
msgstr ""

#: views/pod-template.html:12
msgid "Volumes"
msgstr ""

#: views/container-state.html:5
msgid "Waiting"
msgstr ""

#: views/container-state.html:14
msgid "at {{stateDescription.finishedAt | date:'medium'}}"
msgstr ""

#: views/volumes.html:12
msgid "empty directory"
msgstr ""

#: views/volumes.html:7
msgid "host path"
msgstr ""

#: views/annotations.html:2
#: views/container-state.html:1
#: views/container-statuses.html:1
#: views/containers.html:10
#: views/containers.html:17
#: views/containers.html:7
#: views/labels.html:2
#: views/pod.html:25
#: views/volumes.html:1
msgid "none"
msgstr ""

#: views/volumes.html:24
msgid "not specified"
msgstr ""

#: views/container-state.html:10
msgid "since {{stateDescription.startedAt | date:'medium'}}"
msgstr ""

#: views/containers.html:12
msgid "to host port {{port.hostPort}}"
msgstr ""

#: views/container-state.html:15
msgid "with exit code {{stateDescription.exitCode}}"
msgstr ""
Loading