thomas-darling / gulp-translate Goto Github PK
View Code? Open in Web Editor NEWGulp plugin that localizes HTML templates and JSON files by extracting and injecting localizable content.
Gulp plugin that localizes HTML templates and JSON files by extracting and injecting localizable content.
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 support for the industry standard XLIFF format, to eliminate the need for format conversion when integrating with existing translation management systems.
The current support for templating languages is limited to binding expressions.
Would be cool if it could be expanded to also support PHP and Razor templates.
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.
When exporting content, we currently add a source path for each file in which a content instance is found. Ideally though, we should add a source path for each content instance, ideally including the line and column numbers for the beginning and end of the content.
Hi,
I'm currently using your great plugin for multilanguage/multi tenant frontend and experienced
two difficulties:
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.
href
I can use href.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!
Angular 2 supports annotating content by placing a comment before and after the content that should be exported. We should consider whether adding a similar feature to this plugin would be a good idea.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.