Comments (4)
Extract
& Inline
tools use a parser built specifically for this library. Should we extend it into a compiler to cover cases such as null coalescing?
Rather, I think it's simpler and more correct to initialize the signal, instead of adding null coalescing wherever it's used:
const number = useSignal<number>(0)
const p = usePlural()
return <div>{p(number.value, 'app.someKey')}</div>
from qwik-speak.
@robisim74 If your backend delivers something which can be null, you have to add a useComputed only for duplicating the same value. If it's to complex, we can work with it, but I was very confused seeing this files.
from qwik-speak.
t
& p
closure functions are only placeholders that will be replaced with simple texts in production. They expect as first param a value or an identifier for now.
You can manage null values also in jsx (in my opinion more appropriate):
{number.value && <div>{p(number.value, 'app.someKey')}</div>}
Note. You can't extend a library to cover every single case that occurs (because otherwise it would grow indefinitely). To implement a request you need to:
- that the case is probable to occur
- that there are no simple alternative solutions
- that the implementation covers all analogous cases, in our example null coalescing, logical or, ternary operator and so on
from qwik-speak.
Maybe I still not understand how the whole workflow is and I have to read it first.
from qwik-speak.
Related Issues (20)
- Error since latest version HOT 5
- Issue with runtime translation in some scenarios HOT 7
- Does qwik-speak-extract takes into account arrays? HOT 3
- Upgrade to qwik 1.3 HOT 2
- Showing 404 page in localized routing with lang param HOT 3
- Fix failing tests on pipeline HOT 1
- Conditional rendering children shows keys instead values HOT 3
- Feat: autoassign-keys HOT 36
- FYI: DeepL translator for qwik-speak HOT 3
- Qwik-speak-extract: Maximum call stack exceeded HOT 4
- If/else - condition HOT 3
- URL rewrite translations arent working
- extractFromUrl API is awkward to use HOT 4
- Text reverts back to default value on components containing modular-form HOT 19
- Support for Zero case in plural HOT 2
- Qwik Speak resolving locale multiple times on first render HOT 1
- Sitemap is not generating / finding routes when using localized routing HOT 2
- NX monorepo, only default translations are served on client in js files when run locally HOT 2
- `localizePath()` for "/" causes `Invalid URL` error in preview mode or production. HOT 2
- [Feature request] Domain-based routing HOT 18
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 qwik-speak.