Comments (1)
Hi @pptimmermans,
This is a very good idea, and something I've actually had on my own wish list for a while too.
You can already get some of what you are looking for today, by specifying this export option:
replaceWithIds: "${'*' | t}",
Given a template such as this:
<template>
<span translate>Text</span>
<img alt.translate="Text"></img>
<img alt="Text" alt.translate></img>
</template>
The export task will output this:
<template>
<span>${'0a328f243' | t}</span>
<img alt="${'0a328f243' | t}"></img>
<img alt="${'0a328f243' | t}"></img>
</template>
While this should work perfectly for static text, I think you might run into some issues if you have binding expressions within your text, as it seems Aurelia then also needs a t-params
attribute added.
I'll look into it a bit more in the very near future, and see if I can come up with something - maybe a hook where you can specify a custom function, which receives the element and annotation info, and then has the opportunity to manipulate the element and its attributes in any way it wants. I'll have to look into this a bit more before promising too much though :-)
from gulp-translate.
Related Issues (7)
- Add support for the XLIFF file format
- Consider supporting content annotation using comments or an element HOT 2
- Add support for line and column numbers in exported content source paths.
- Add extension point for missing content handling
- Syntactic sugar for reduced markup size HOT 2
- Add support for templating languages such as PHP and Razor
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 gulp-translate.