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

Handling grammatical gender with Angular-Gettext #39

Closed
CharlesHamel opened this issue Feb 14, 2014 · 5 comments
Closed

Handling grammatical gender with Angular-Gettext #39

CharlesHamel opened this issue Feb 14, 2014 · 5 comments

Comments

@CharlesHamel
Copy link

Hi,

We are starting a big project and thinking seriously about using Angular-Gettext. Our only concern is about handling gender. Is there a simple-proper-elegant way to do it ?

Thank you very much!

@rubenv
Copy link
Owner

rubenv commented Feb 16, 2014

Not currently. Gettext doesn't natively support that.

That being said, my inspiration partly comes from vernacular, which does do that: https://github.com/rdio/vernacular

Might be interesting to see how vernacular does it and whether or not that's something we can apply to angular-gettext.

So far, I haven't had clients requesting gender support, nor have I felt inclined to add it myself: most gender-handling solutions quickly turn the translation support into something enormously complex. I'd love to have it, but only if a really simple and usable system can be found.

@rubenv rubenv added the feature label Feb 19, 2014
@julian-hj
Copy link

We are using angular-gettext, and we very quickly hit gender translation problems on a relatively simple project. Currently we are getting push-back from our l10n team about the appraoch we are using because of this very issue.

It seems to me that having a declarative framework to handle gender the way that plural is handled would be pointless and bad--the same word often has different genders in different languages, or even for different choices of word. For example, when translating "girl" into German, you could choose Fraulein, which is female, or Maedschen, which is neutral.

It seems to me that angular-gettext would really benefit from some generic way to specify context, rather than a specific way to specify gender. That way, when we hit words or phrases that are the same in English, but need to be translated differently in other languages like "all" or "none" or "delete it", we can add some context that will split the uasages into 2 or more translation targets.

So, you could add an additional attribute value that would help to distinguish the context like so:
none
none

This feature is already supported in other implementations of gettext:
https://wiki.phpmyadmin.net/pma/Gettext_for_developers#Different_contexts

@cristiano2lopes
Copy link
Contributor

#103 is flexible enough to handle this case. We just need a little more work on the grunt tools part to extract the contexts from filters.

@rubenv
Copy link
Owner

rubenv commented Oct 2, 2014

Closing as this is a duplicate of #53.

@rubenv rubenv closed this as completed Oct 2, 2014
@flaviodev
Copy link

a solution with context:

without gender:
en: + New Profile
pt: + Novo Perfil

with gender:
en: + New Institute
pt: + Nova Instituição

html:
{{'New' | translate:'female'}}

translation.js:
gettextCatalog.setStrings("pt", {
"New" : {"female":"Nova","male":"Novo",'$$noContext':"Novo" }
}

the '$$noContext' is for simple invocation:
{{'New' | translate'}}

soved !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants