Comments (8)
Content keys are evaluated at build time and can't be based on runtime data. Why not just move the content to a country specific template instead?
from makara.
There are more use cases that a fix here would benefit beyond the example I gave of separating country-specific content, but I guess even then, using foo-specific partial templates and loading one dynamically would be a valid alternative to using a logical structure for selecting one of multiple foos.
I mainly just wanted this limitation to be documented somewhere. This can be closed.
from makara.
Well country-specfic template is the main use-case. Is there a solution for that?
from makara.
Actually in our case, we have one line per state, so 50 files with 1 property each seems a bit crazy, but I guess the current best option. Our approach is to just read the properties in the controller and send down the current value as a variable. Kind of lame, but easier than creating 50 new files!
from makara.
Country specific templates are available as of kraken 1.0 (in beta) with specialization.
from makara.
Closing this out though, per @tsullivan's point.
from makara.
@xjamundx I trust the PayPal team will have better way to solve but short term, feel free to use a helper I just created to solve similar. The model injection is incomplete but perhaps someone can fork and complete the helper. Find at https://github.com/mikesparr/Kraken_Example_i18n_Helper
You can choose your bundle and key so it's at least a start.
from makara.
Awesome. Thanks, @mikesparr!
We're actually moving toward more runtime evaluation of some of this, which will help immensely.
from makara.
Related Issues (20)
- multi
- Plan for makara deprecation HOT 6
- Add support for formatPath in Bundalo.
- dust helpers documentation is wrong HOT 1
- Express app stops responding if there are too many partial includes HOT 6
- specialization seems to be broken HOT 24
- Makara doesn't look up localised templates HOT 3
- Problem with format path HOT 3
- Makara 2 and Dust @provide helper HOT 3
- Makara 2 with locale from cookie is not localizing templates HOT 1
- Upgrading makara: client side HOT 9
- Locale specific templates HOT 4
- Build task on windows fails due to OS path separator issue HOT 4
- is there a concept of fallback at the level of the Country HOT 3
- Question: what are the various ways to manually set the expressjs-res's locale HOT 4
- I can't pass the enableMetadata parameter HOT 2
- Don't load req.locale HOT 1
- Update the bundalo to 1.x to remove dependency from dustjs-linkedin HOT 1
- is makara only for dustjs template engine?
- Update bundalo for security issue
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 makara.