-
Notifications
You must be signed in to change notification settings - Fork 390
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
Message context (msgctxt) not working #1198
Comments
Thanks, I'll try to fix as soon as I can. Contributions are welcome =) |
For now all I succeed to do is adding more tests to find out where the issue might be. With my little knowledge on lingui's internal, it seems the 1st implementation is wrong: context is used as message way to early in the chain. The context information does not arrive at the catalog build step. I added failing tests that shows this. Catalog to PO is fine according to other tests. With extracted catalog in JS the issue does not pop-up, but for every intermediate or final format other than JS this is broken I think. |
@nakkamarra if you have some time to put on this one I would appreciate ;) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Can anybody help me on this one plz? |
Will find time this week Jérôme, sorry 4 the delay, been really busy |
@semoal I will have a bit a free time next month but I still need help / guidance on this one This is a very nice and awaited feature, let's make it work :) |
Do you have any time soon @semoal or @tricoder42 to help me on this one (at least re-open it, and the MR and prevent stale bot to close it again (about that, you might want to config the bot so it does not close qualified issues) This is really painful when using PO files |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I've verified that the issue remains with version |
We (at my company) have a working fix @tfhult , PR is incoming for the next days. @semoal or @tricoder42 or anyone, are you still maintaining this project? |
Yes, I do. I’ll take care of everything at the end of this week |
Any news @semoal ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@semoal or anyone managing this repository, please prevent stale bot to close this issue, the related PR took days of effort, and we really like to see it integrated into linguijs instead of going with a fork. |
Seriously? Is this project that much dead? |
I've been subscribed to this issue for a long time and I'm disappointed as well. If there is a working fix ready to be reviewed it should not take this long, and the issue should definitely not get autoclosed for being stale. Does stale mean a lack of interest from the community, or lack of response from the maintainers? |
Workaround in the mean time: import { Trans } from "@lingui/react"
export default function App() {
// Workaround for translation context
// until https://github.com/lingui/js-lingui/issues/1198
// is fixed.
const ctxtA = '';
const ctxB = '';
return <div>
<Trans>{ctxtA}My string</Trans>
<Trans>{ctxtB}My string</Trans>
<Trans>My string</Trans>
</div>
} => #: src/App.tsx:11
msgid "My string"
msgstr "My string"
#: src/App.tsx:12
msgid "{ctxtA}My string"
msgstr "{ctxtA}My string"
#: src/App.tsx:13
msgid "{ctxtB}My string"
msgstr "{ctxtB}My string" for example, it could allow to have two keys for |
That is what we used to do before forking and publishing it as a PR, but it does not work well with plural and / or variables. Try using |
😬 context implementation is almost ready, stay tuned ) |
Describe the bug
When providing context to a message, the context is treated like an ID in the generated
en.po
file.To Reproduce
With the version
3.13.1
withcreate-react-app
, and not specifyingorderBy
inlingui.config.js
:Expected behavior
3 messages should be created in the generated
en.po
file, like this:Actual behavior
This is created in the
en.po
file.Additional context
If using
orderBy: 'origin'
inlingui.config.js
, an exception is thrown ingetFirstOrigin()
when runningextract
.3.13.1
create-react-app
The text was updated successfully, but these errors were encountered: