nicksnyder / go-i18n

Translate your Go program into multiple languages.
MIT License
3.03k stars 277 forks source link

Fix Localize regression with empty default message #305

Closed KuSh closed 1 year ago

KuSh commented 1 year ago

Behavior has changed with #189. Before that, an empty default message returned nil and an error, now it returns "" without error.

This has been detected by mattermost test suit in https://github.com/mattermost/mattermost/pull/21327 which tries to switch all code base to go-i18n v2, see related discussion

codecov[bot] commented 1 year ago

Codecov Report

Merging #305 (517a79b) into main (5ee16aa) will increase coverage by 0.04%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #305      +/-   ##
==========================================
+ Coverage   82.41%   82.46%   +0.04%     
==========================================
  Files          15       15              
  Lines        1183     1186       +3     
==========================================
+ Hits          975      978       +3     
  Misses        145      145              
  Partials       63       63              
Files Coverage Δ
v2/i18n/localizer.go 92.95% <100.00%> (+0.31%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

nicksnyder commented 1 year ago

Thanks for the fix!