Comments (1)
The main reasons we didn't add support for nested objects are the following :
- What happened if we ask in your example
t('fruits')
? Handled byonMissingKey()
? - What happened if we currently have a key named
"fruits.apple"
in the table ? Which one should have priority, the key or the nested resolution ? - Need some checks to avoid TypeError
t('fruits.undefinedKey.typeerror')
or object escapingt('fruits.constructor.constructor.name') === 'Function'
- Need to implement nested support in extends function.
- To keep the implementation fast and avoid re-parsing the key at each call, we need to store the generated function in an inline cache object (
cache['fruits.apple'] = <generated function>
) leading to problems while updating the table, deleting parent of nested entries or erasing the parent with a string.
For this reason, and because I don't really get the point of nested objects except developers comfort, we didn't feel the need to implement it in the first version.
But still, it's on the roadmap, even if I'm not sure about the first two questions.
from frenchkiss.js.
Related Issues (12)
- Extraction Tool HOT 6
- "I did not bought apples!" is not English HOT 1
- [Suggestion] Change the order of parameters HOT 4
- [Suggestion] Add typescript support
- CSP compatibly HOT 3
- [Suggestion] pass params to onMissingKey HOT 1
- [Feature Request] Export the getCompiledCode method HOT 3
- Can the key be considered as a fallback to a language HOT 1
- Code generation from strings disallowed for this context
- Add github actions to validate PRs through the tests
- Ordinal suffix configuration
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 frenchkiss.js.