-
Notifications
You must be signed in to change notification settings - Fork 394
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
Feature request: Allow no-op/lazy translations #60
Comments
IMHO the method should be named most closely to what it actually does, which in this case is something like 'markForTranslation/Extraction', 'addTranslation', 'linguiString', or even 'internationalize', rather than 'noop'... Looking at this example code I would have no idea what it does. Just an opinion. |
Yeah I have similar concern. I know this naming from Django, but there is It's basically From your examples I'm considering |
May I ask, how is this feature looking? I am really looking forward to it 👍 😊 |
I was a bit busy in last few weeks, so I was happy to find at least some time to refactor cli. However, this should be very easy, I'll take a look this week. If you want to work on this, it's basically just:
I would go with following syntax: import { i18n_noop } from 'lingui-i18n'
const languages = {
en: i18n_noop('English'),
cs: i18n_noop('Czech')
} which would be transformed to const languages = {
en: 'English',
cs: 'Czech'
} Question is, how to handle translations with variables? 🤔 Should |
Thats ok, its still cool, you have time to improve this lib and push it further 👍 Doesnt have to be all at once..
Given the typical usage of such function, I guess it should not be a problem. I would make it static and create an enhancement issue with a very low priority on it supporting even variables and tags. Just to keep all functions consistent, because I can imagine (in the future) people misusing this function and wondering why it doesnt work with variables. |
Alright, added in latest releases: The function is named |
Awesome! |
Followup from #53
Sometimes it's necessary to mark strings which will be translated in the future, but leave them intact for now:
The text was updated successfully, but these errors were encountered: