Skip to content

fix(goi18n): could not extract constant message id #202

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

Conversation

ksegun
Copy link
Contributor

@ksegun ksegun commented Sep 29, 2019

If you specified a constant for message id e.g

package main

import "github.com/nicksnyder/go-i18n/v2/i18n"

const constID = "ConstantID"
			
var m = &i18n.Message{
    ID: constID,
    Other: "ID is a constant",
}

goi18n extract failed with failed to marshal en strings to toml: toml: Key '' is not a valid table name. Key names cannot be empty.

@codecov
Copy link

codecov bot commented Sep 29, 2019

Codecov Report

Merging #202 into master will decrease coverage by 0.04%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #202      +/-   ##
==========================================
- Coverage    82.9%   82.85%   -0.05%     
==========================================
  Files          14       14              
  Lines        1293     1301       +8     
==========================================
+ Hits         1072     1078       +6     
- Misses        158      159       +1     
- Partials       63       64       +1
Impacted Files Coverage Δ
v2/goi18n/extract_command.go 69.31% <75%> (+0.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f2fe62...45a7edd. Read the comment docs.

Copy link
Owner

@nicksnyder nicksnyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@nicksnyder nicksnyder merged commit 275c8ec into nicksnyder:master Oct 13, 2019
@ksegun ksegun deleted the fix-cannot-specify-message-id-using-constant branch October 16, 2019 04:44
@ozankasikci
Copy link

Having this same problem. Please release a new version including this fix.

@nicksnyder
Copy link
Owner

2.0.3 is released

adrianpk added a commit to adrianpk/go-i18n that referenced this pull request May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants