Git Product home page Git Product logo

gulp-translate's People

Contributors

thomas-darling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gulp-translate's Issues

Automatically replace "translate" with "t="unique id" "

Is it possible to automatically replace the translate tag with translation="unique id" so the id's match the id's in the exported json file?

So to extract something like this:
<h1 translate>Etiam rhoncus. Maecenas tempus</h1> <h2 translate>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h2>

And automatically replace translate with a attribute + id:
<h1 t="211d76eec">Etiam rhoncus. Maecenas tempus</h1> <h2 t="96f37e421">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h2>

This way I can easily combine it with aurelia-i18n which looks for the "t" attribute.

Thanks,
PP

Add extension point for missing content handling

In the readme, we currently hint that one way of dealing with large pieces of content, which is probably better stored in a CMS, could be to export such content from the CMS into a json content file, from which it can then be imported into templates using the import command.

While this definitely works, it would be easier and more flexible to actually have an extension point in the form of a missingContentHandler property on the import config. That way, a custom function can be specified for handling content not found in the import file. This function should return either the content, if found, or undefined if not found. Alternatively, it should return a promise, which will either be resolved with the content, if found, or rejected if not found.

Syntactic sugar for reduced markup size

Hi,

I'm currently using your great plugin for multilanguage/multi tenant frontend and experienced
two difficulties:

  1. If I want to translate single generic word or currencies in sentences I have to add a tag like $.

Could it be possible to also support a configurable tag like <translate>$</translate> which will get completely replaced to $ respectively โ‚ฌ etc?
This would help to reduce the markup and to solve issues when spans ord divs are styled via css.

  1. If I want to translate attributes like href I can use href.translate.
    But sometimes I need to translate <a href="mailto:[email protected]">[email protected]</a>.

My approach end like this <a href.translate href="mailto:[email protected]" translate>[email protected]</a> with two entries in my language file for
mailto:[email protected] and [email protected]. Do i miss here something?
Maybe we can use something like this to address the redundancy : <a mailto.href.translate href="mailto:[email protected]" translate>[email protected]</a> with only one entry to the language file (without the mailto: prefix).

Thanks you for your beautiful and helpful plugin!

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.