Adds ability to extract strings from T() functions to goi18n extract
#327
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
goi18n extract
will now extract strings wrapped in aT
function, in addition to the other cases it extracts strings from.I also added an example CLI application to go with the web application that shows how to embed i18n files, and use T wrapper functions for translations.
Reason
This feature will help people like me migrating from v1 to v2 of this library. V1 encouraged the use of the
T
wrapper, so having a way to easily extract those strings would make my life a lot easier, and I assume others who make the migration as well.Thanks for your time reviewing this issue, and I'll address any issues you may have with the code.
Also thanks for making this library in the first place.