Skip to content

Domain and context function #94

@ArmorDarks

Description

@ArmorDarks

It's great that plurals were finally implemented.

I believe there left only one crucial piece, without which most projects will suffer: domain or context.

Those are:

// domain
dgettext    = function ( domain, key )
dngettext   = function ( domain, singular_ley, plural_key, value )

// or context
pgettext    = function ( context, key )
npgettext   = function ( context, singular_key, plural_key, value )

// or both
dpgettext   = function ( domain, context, key )
dnpgettext  = function ( domain, context, singular_key, plural_key, value )

// or with category
dcgettext   = function ( domain, key, category )
dcngettext  = function ( domain, singular_key, plural_key, value, category )
dcnpgettext = function ( domain, context, singular_key, plural_key, value, category )

I'm not sure about category. Don't remember I've seen it used somewhere, since usually it's enough to have just context.

Domains (which are, in fact, language codes) aren't interesting for us during extraction, but crucial for output. So, in case of domain jsxgettext should be able to simply skip it.

So, I'd say, it's crucial to have at least context and domains, since without domains it's impossible for devs to load string from specific domain, and without context it's impossible to implement context-aware strings and feminine forms.

Edited: sorry, there were error in domains description. I always forgetting that they are in fact languages, into which string should be outputted)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions