2019-06-17 18:43:05 +00:00
|
|
|
/*
|
|
|
|
Copyright 2019 The Kubernetes Authors All rights reserved.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2019-06-20 16:55:29 +00:00
|
|
|
/* This file scans all of minikube's code and finds all strings that need to be able to be translated.
|
|
|
|
It uses the more generic extract.TranslatableStringd, and prints all the translations
|
2019-06-24 22:18:31 +00:00
|
|
|
into every json file it can find in the translations directory.
|
2019-06-20 16:55:29 +00:00
|
|
|
|
|
|
|
Usage: from the root minikube directory, go run cmd/extract/extract.go
|
|
|
|
*/
|
|
|
|
|
2019-06-17 18:43:05 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"k8s.io/minikube/pkg/minikube/extract"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
paths := []string{"cmd", "pkg"}
|
2019-06-20 00:44:34 +00:00
|
|
|
functions := []string{"translate.T"}
|
2019-06-24 22:18:31 +00:00
|
|
|
output := "translations"
|
2019-06-20 00:44:34 +00:00
|
|
|
err := extract.TranslatableStrings(paths, functions, output)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-06-17 18:43:05 +00:00
|
|
|
}
|