Giter Club home page Giter Club logo

Comments (1)

thomas-darling avatar thomas-darling commented on May 18, 2024 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.