smhg / gettext-handlebars Goto Github PK
View Code? Open in Web Editor NEWExtract translatable strings from Handlebars template strings
License: MIT License
Extract translatable strings from Handlebars template strings
License: MIT License
Can you please release v0.7.1 in order to make only the handlebars update available?
I would like to fix my audit issue.
The library cannot be installed on any version other than 10.15.1, including 12
New in Handlebars 1.3.0.
I extract translatable strings from my HTML template strings (I make PhoneGap application) by your tool. But I need rename my index.html to index.hbs each time. Could you expand the scope of your tool for html files? In the parser, no changes are needed, just add the html file. Now everything works fine with these lines:
{{_ "Settings"}}
I see that English plural form is working correctly (and probably other languages with two forms) but Russian has three forms and it doesn't work correctly.
I'd imagine that this is something that you could easily fix with just several lines of code.
Contexts in gettext are best described in the official docs, but in short they allow you to disambiguate homonyms.
gettext defines the pgettext
family of functions for localizing messages with contexts:
const char *pgettext (const char *msgctxt, const char *msgid);
const char *dpgettext (const char *domain_name, const char *msgctxt, const char *msgid);
const char *dcpgettext (const char *domain_name, const char *msgctxt, const char *msgid, int category);
Of course, until domains are implemented we have no use for the second two functions.
Handle domain parameter.
npm finds several vulnerabilities in handlebars below 4.5.2
I have the following string that I would like to translate:
{{authorName}} has created '{{groupName}}' in your group.
Variables would make the string render like this: Matthias has created "Summerparty" in your group
I tried the following, which didn't work:
{{_ "{{authorName}} has created '{{groupName}}' in your group."}}
Any ideas?
gettext has the notion of "extracted comments." These are comments from the developers designed to aid the translators, e.g:
// Please leave %s in your translation. It is a variable.
gettext("Foo %s");
Obviously, you need to get creative in how the same is done in a markup language. Maybe a sub-expression?
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.