Comments (9)
Coolio! I'm just working on the fix, should be ready in an hour. Thank you for your feedback 👍
from js-lingui.
This is related to #65. The CLI doesn't know, that message IDs are translations for cs
language.
I'm thinking about another config variable: sourceLanguage
. When set, translations are taken from message ID for given language during compile. What do you think?
It also means that you'll never get warning for missing translation for that language, but I guess it doesn't matter, because you're using source anyway.
from js-lingui.
Well it has to be working without translations by showing the original, so it could help the translator & don't break the app design before translations are added.
So your solution would be adding sourceLanguage: 'cs'
to the config, and then it would show the original for Czech language (but not the others)? What about showOriginalWhenMissing
?
from js-lingui.
So you would like to see Czech source string even for other languages? 🤔
I'm thinking that maybe it should be the default behavior. When developer what's to get an error about missing translation, they can use lingui compile --strict
. Otherwise, the source string will be used, because missing translation should never happen in production (I guess it's better to see well-formatted message in wrong language, rather than unformatted message in correct language).
from js-lingui.
I guess the sourceLanguage
config is still useful when you use natural language in message IDs. Usually it means, that one message catalog will always be untranslated (the source one - cs
in your case) and you don't want to get an error when validating missing translations.
from js-lingui.
it's better to see well-formatted message in wrong language, rather than unformatted message in correct language
Yes.
So you would like to see Czech source string even for other languages?
For this project, yes. English and other languages will be only marginally used and a few missing translations will not be a problem (of course we will try to have always 100%, but its better to have a minor tooltip/notification in Czech than an unformatted string).
And for a next big project (there will be a team of several devs), that I had also proposed lingui-js to be used 😊, we will use English language as default and we will like to show English messages, if eg. a Spanish one would be missing. We will likely use IDs tho, so this is not yet the problem.
from js-lingui.
Awesome! And yes, sourceLanguage
is still useful, if we would add translation validation into our CI. I already have extract & compile there, so no message should be unformatted, even if someone forgot to do it before pushing.
from js-lingui.
Fixed in [email protected]
Would you like to share the name of your company so I can present it in README as a social proof?
from js-lingui.
Also, new CLI options published in docs
from js-lingui.
Related Issues (20)
- Support Gatsby HOT 2
- Cannot find type definition file for './node_modules/@lingui/macro/global'. HOT 2
- Next.js tutorial HOT 3
- The `catalogsMergePath` option is missing in the documentation
- Support backup messages HOT 3
- Extract removes manual comments from po files HOT 1
- React Fragment (`<>`) inside `<Plural>` is not working HOT 5
- Impossible to use with Vite? HOT 1
- definePlural macro HOT 4
- rspack now supports wasm plugins, lingui integration example could be improved HOT 3
- Escaped curly-braces doesn't preserve in development mode HOT 1
- <Trans> breaks React JSX semantics with regards to booleans HOT 3
- Consider renaming of the macro components HOT 2
- selectOrdinal error HOT 2
- Lingui CLI extraction puts msgid as msgstr HOT 3
- i18n._(id) throws error if id param passed as undefined
- # is being replaced by%__lingui_octothorpe__% outside plural and selectordinal HOT 3
- Setup with webpack
- Order by is not alphabetically HOT 1
- t`` macro doesn't work when load and activate message HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-lingui.