Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
0bf293b0
M
minikube
项目概览
Chu Peng 楚鹏
/
minikube
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
minikube
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0bf293b0
编写于
5月 03, 2019
作者:
S
Sharif Elgamal
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move setting locale to start
上级
5cffb33e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
15 deletion
+14
-15
cmd/minikube/cmd/start.go
cmd/minikube/cmd/start.go
+12
-0
pkg/minikube/console/console.go
pkg/minikube/console/console.go
+2
-15
未找到文件。
cmd/minikube/cmd/start.go
浏览文件 @
0bf293b0
...
...
@@ -30,6 +30,7 @@ import (
"time"
"github.com/blang/semver"
"github.com/cloudfoundry-attic/jibber_jabber"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/host"
"github.com/docker/machine/libmachine/state"
...
...
@@ -163,6 +164,8 @@ assumes you have already installed one of the VM drivers: virtualbox/parallels/v
// runStart handles the executes the flow of "minikube start"
func
runStart
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
determineLocale
()
console
.
OutStyle
(
"happy"
,
"minikube %s on %s (%s)"
,
version
.
GetVersion
(),
runtime
.
GOOS
,
runtime
.
GOARCH
)
validateConfig
()
...
...
@@ -691,3 +694,12 @@ func saveConfig(clusterConfig cfg.Config) error {
}
return
nil
}
func
determineLocale
()
{
locale
,
err
:=
jibber_jabber
.
DetectIETF
()
if
err
!=
nil
{
glog
.
Warningf
(
"Getting system locale failed: %s"
,
err
)
locale
=
""
}
console
.
SetPreferredLanguage
(
locale
)
}
pkg/minikube/console/console.go
浏览文件 @
0bf293b0
...
...
@@ -24,7 +24,6 @@ import (
"strconv"
"strings"
"github.com/cloudfoundry-attic/jibber_jabber"
"github.com/golang/glog"
isatty
"github.com/mattn/go-isatty"
"golang.org/x/text/language"
...
...
@@ -89,12 +88,6 @@ func OutStyle(style, format string, a ...interface{}) error {
// Out writes a basic formatted string to stdout
func
Out
(
format
string
,
a
...
interface
{})
error
{
locale
,
err
:=
jibber_jabber
.
DetectIETF
()
if
err
!=
nil
{
glog
.
Warningf
(
"Getting system locale failed: %s"
,
err
)
locale
=
""
}
SetPreferredLanguage
(
locale
)
p
:=
message
.
NewPrinter
(
preferredLanguage
)
if
outFile
==
nil
{
if
_
,
err
:=
p
.
Fprintf
(
os
.
Stdout
,
"(stdout unset)"
+
format
,
a
...
);
err
!=
nil
{
...
...
@@ -102,7 +95,7 @@ func Out(format string, a ...interface{}) error {
}
return
fmt
.
Errorf
(
"no output file has been set"
)
}
_
,
err
=
p
.
Fprintf
(
outFile
,
format
,
a
...
)
_
,
err
:
=
p
.
Fprintf
(
outFile
,
format
,
a
...
)
return
err
}
...
...
@@ -131,12 +124,6 @@ func ErrStyle(style, format string, a ...interface{}) error {
// Err writes a basic formatted string to stderr
func
Err
(
format
string
,
a
...
interface
{})
error
{
locale
,
err
:=
jibber_jabber
.
DetectIETF
()
if
err
!=
nil
{
glog
.
Warningf
(
"Getting system locale failed: %s"
,
err
)
locale
=
""
}
SetPreferredLanguage
(
locale
)
p
:=
message
.
NewPrinter
(
preferredLanguage
)
if
errFile
==
nil
{
if
_
,
err
:=
p
.
Fprintf
(
os
.
Stderr
,
"(stderr unset)"
+
format
,
a
...
);
err
!=
nil
{
...
...
@@ -144,7 +131,7 @@ func Err(format string, a ...interface{}) error {
}
return
fmt
.
Errorf
(
"no error file has been set"
)
}
_
,
err
=
p
.
Fprintf
(
errFile
,
format
,
a
...
)
_
,
err
:
=
p
.
Fprintf
(
errFile
,
format
,
a
...
)
return
err
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录