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

Support multiple ttag instances #191

Merged
merged 1 commit into from
Dec 27, 2019
Merged

Support multiple ttag instances #191

merged 1 commit into from
Dec 27, 2019

Conversation

OrKoN
Copy link
Contributor

@OrKoN OrKoN commented Dec 20, 2019

No description provided.

@OrKoN OrKoN mentioned this pull request Dec 20, 2019
@codecov
Copy link

codecov bot commented Dec 20, 2019

Codecov Report

Merging #191 into master will increase coverage by 0.28%.
The diff coverage is 99.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #191      +/-   ##
==========================================
+ Coverage    97.8%   98.09%   +0.28%     
==========================================
  Files           4        4              
  Lines         502      525      +23     
  Branches       79       79              
==========================================
+ Hits          491      515      +24     
+ Misses         11       10       -1
Impacted Files Coverage Δ
src/index.js 98.94% <99.12%> (+0.74%) ⬆️

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 d259acd...e30ed3a. Read the comment docs.

@AlexMost AlexMost merged commit c4e1191 into ttag-org:master Dec 27, 2019
@AlexMost
Copy link
Member

you version is published v1.7.22, so you can try to use the separate ttag instance. Let me know if that works for you!

@OrKoN
Copy link
Contributor Author

OrKoN commented Dec 30, 2019

@OrKoN cool! should that work with ttag-cli already?

@AlexMost
Copy link
Member

AlexMost commented Jan 3, 2020

Hi @OrKoN. ttag-cli extracts translations with babel-plugin-ttag. By default it will extract t if you are using ttag import. But there exists is --discover argument (https://github.com/ttag-org/ttag-cli#update-opts-pofile-src). It will discover all t usages.
Here is an example:

console.log(t`hello`)
ttag update --discover=t some.po counter.js

So, you can pass discover opts to extract translations. Will try to investigate and maybe we should add an ability to discover member expressions such as:

(req, res) => {
   req.ttag.t`hello`;
}

@ljani ljani mentioned this pull request Feb 1, 2021
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.

2 participants