Git Product home page Git Product logo

gettext-handlebars's People

Contributors

dependabot[bot] avatar gabegorelick avatar hakog77 avatar jiggak avatar patrickfournier avatar smhg avatar svewag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gettext-handlebars's Issues

publish v0.7.1

Can you please release v0.7.1 in order to make only the handlebars update available?

I would like to fix my audit issue.

Unpin node version

The library cannot be installed on any version other than 10.15.1, including 12

Extracting from HTML

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"}}

[Bug] Plural forms is broken for Russian

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.

Support for contexts

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.

Variables inside translated string

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?

Extract comments

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?

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.