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

Extract command improvement: collecting values from constants in other package files #355

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dmji
Copy link

@dmji dmji commented Jan 1, 2025

There is a way to use constants as identifiers or other fields, and it works if they are in the same file as the message.
I've run into the problem that if the constants are defined in a different file, it doesn't work.

The problem is that in ast such an object (263 line) will be nil and this requires resolving individually, as I understood from google.

Such values are marked with the format “varname:::unresolved:::pkgname” to be matched with constants from all files.

Changes have been made to the extractor.Visit file, which collects constants from all files targeted by the extractor and then replaces the values in the fields.

Copy link

codecov bot commented Jan 1, 2025

Codecov Report

Attention: Patch coverage is 85.50725% with 10 lines in your changes missing coverage. Please review.

Project coverage is 75.32%. Comparing base (d096e3f) to head (7d0eed8).

Files with missing lines Patch % Lines
goi18n/extract_command.go 85.50% 6 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #355      +/-   ##
==========================================
+ Coverage   75.01%   75.32%   +0.31%     
==========================================
  Files          20       20              
  Lines        2061     2124      +63     
==========================================
+ Hits         1546     1600      +54     
- Misses        452      457       +5     
- Partials       63       67       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dmji dmji marked this pull request as draft January 1, 2025 23:16
@dmji dmji marked this pull request as ready for review January 2, 2025 00:32
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.

1 participant