Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domain and context function #94

Open
ArmorDarks opened this issue Jun 18, 2015 · 1 comment
Open

Domain and context function #94

ArmorDarks opened this issue Jun 18, 2015 · 1 comment

Comments

@ArmorDarks
Copy link

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)

buma added a commit to buma/jsxgettext that referenced this issue Jun 24, 2015
Working on zaach#94.
Extracting works. But joining joins incorrectly. If I parse both files
they are joined correctly.
@ArmorDarks
Copy link
Author

Just for the note, there seems to be no sense to implement categories, since it's almost unused and most gettext-outputting libraries will simple ignore it.

@ArmorDarks ArmorDarks changed the title Domain or context function Domain and context function Oct 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant