Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid locale file "lang\\zh-CN.json" #111

Closed
li-xunhuan opened this issue Dec 18, 2021 · 4 comments
Closed

Invalid locale file "lang\\zh-CN.json" #111

li-xunhuan opened this issue Dec 18, 2021 · 4 comments
Labels
Bug Report a reproducible bug or regression

Comments

@li-xunhuan
Copy link

Hello,

I encountered an issue with the following code:

// 倒计时
func TestDjs(t *testing.T) {
	lange := carbon.NewLanguage()
	lange.SetLocale("zh-CN")
	car := carbon.SetLanguage(lange)
	now := car.Now()

	offDutyTime := now.StartOfDay().AddHours(20)
	t.Logf("下班时间: %v", offDutyTime)
	t.Logf("距离下班还有: %v", offDutyTime.DiffInString(now))
	t.Log(now.Error)
	t.Log(offDutyTime.Error)
}

golang version: such as 1.16
1.17

carbon version: such as 1.5.0
v2.0.1

time zone: such as Japan
China

logs:

=== RUN   TestDjs
    all_test.go:63: 下班时间: 
    all_test.go:64: 距离下班还有: 
    all_test.go:65: invalid locale file "lang\\zh-CN.json", please make sure the json file exists and is valid
    all_test.go:66: invalid locale file "lang\\zh-CN.json", please make sure the json file exists and is valid
--- PASS: TestDjs (34.18s)
PASS

pic
微信图片_20211218184301

Thanks!

@li-xunhuan li-xunhuan added the Bug Report a reproducible bug or regression label Dec 18, 2021
@lixh00
Copy link

lixh00 commented Jun 13, 2022

这个问题依然存在

image

@Issues-translate-bot
Copy link
Collaborator

The issue body's language is not English, translate it automatically, please use English next time. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The problem still exists

image

@li-xunhuan li-xunhuan changed the title 最新版似乎读不到语言包 最新版似乎读不到语言包 | invalid locale file "lang\\zh-CN.json" Jun 14, 2022
@Issues-translate-bot
Copy link
Collaborator

The issue body's language is not English, translate it automatically, please use English next time. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


window environment?

@gouguoyin gouguoyin reopened this Oct 28, 2022
@gouguoyin gouguoyin changed the title 最新版似乎读不到语言包 | invalid locale file "lang\\zh-CN.json" invalid locale file "lang\\zh-CN.json" Oct 30, 2022
@gouguoyin gouguoyin changed the title invalid locale file "lang\\zh-CN.json" Invalid locale file "lang\\zh-CN.json" Oct 31, 2022
@gouguoyin
Copy link
Collaborator

It has been fixed in v1.7.1 or v2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report a reproducible bug or regression
Projects
None yet
Development

No branches or pull requests

4 participants