Topic: Storing/displaying titles respecting masculine/feminine forms

I need to emit strings in english and spanish for people's titles/roles. In english, there is no concept of "feminine" or "masculine" with regard to grammar. In many other languages, there is such a concept and it's a real problem for english native speakers learning those languages (what do you mean a chair is feminine?). It carries over into people as well. For example, "teacher" in spanish is maestro/profesor if male, maestra/profesora if female, and so on.

While I definitely don't need full internationalization (the site is somewhat a static one and is definitely not super interactive/application like), I do want to be able to assign a title & gender to a person and have their title be displayed appropriately.

Mrs. Jones, Teacher/Maestra
Mr. Smith, Nurse/Enfermero

Etc.

What do you think the best approach would be? I was thinking just a simple lookpu from a table with english, spanish feminine and spanish masculine forms in it. Then, when displaying the person's info, globbing the stuff back together.

Am I missing anything?

Re: Storing/displaying titles respecting masculine/feminine forms

More questions:
Is title a reserved word?

What should I call this model? Do I need to be more verbose in naming it, such as job title or position or some such?

With regard to modeling this, it looks like person belongs_to title. Anything else I should be aware of?

Last edited by lrivers (2007-06-19 19:14:40)

Re: Storing/displaying titles respecting masculine/feminine forms

I feel your pain.. despite years of fluent spanish speaking I still get caught out there by the occasional gender slipup with my nouns. You would think that words ending with "a" are feminine and "o" is masculine, but words like "tema" and "manos" give you a run for your money!

http://errtheblog.com/post/4396

Neat localization plugin there... not sure how it would handle gender rules though.

Re: Storing/displaying titles respecting masculine/feminine forms

Localization is not what I need, because I want to display both english & spanish together. I looked at that one, though, thanks anyway.

Re: Storing/displaying titles respecting masculine/feminine forms

How will you get the profession of each of your users? Will they it in themselves or will they choose from a multiple-select, for instance?

Other than this... if it is merely restricted to 2 languages... why not just make a professions table with 4 columns: id, eng_name, span_male, span_female. Or something like this. In your User model you can have the profession_id and the gender set to either "male" or "female". Output the values as needed then.

Another approach could be: set up the professions table the same and just have a profession column in your User model. There is no relation between User and Profession, but you can query the professions table when a new user is created/updated, etc. and fetch the correct English and Spanish names for it and merely enter it into the profession column of the users table. This way you save yourself another query when displaying the user attributes.

Re: Storing/displaying titles respecting masculine/feminine forms

Professions is a better name than title, thanks. I think I'm going to go with User belongs to Profession model-wise.

Re: Storing/displaying titles respecting masculine/feminine forms

Has another project handled this in English with the -ess titles? Like waiter/waitress ? Perhaps in German with -er/-in, Kellner/Kellnerin?

I'm not really sure how to approach the issue, but thats one more way to search that might yield a solution.

Re: Storing/displaying titles respecting masculine/feminine forms

jbartels wrote:

Has another project handled this in English with the -ess titles? Like waiter/waitress ? Perhaps in German with -er/-in, Kellner/Kellnerin?

I'm not really sure how to approach the issue, but thats one more way to search that might yield a solution.

Going merely via the noun-endings is no solution, because there are words that are irregular and do not fit into this pattern.

Another way could be to do the following (not sure if thats THE way to go as I am no language expert). Make a professions table (by definition English is the base language). The professions table would look like the following: id | profession_id | male | female | language

The professions table is self-referencing and the language column states en_US, de_DE, etc. Now you enter the English male/female words first and then reference any other language to the just created one:
id | language_id | male   | female     | country
1  | NULL            | waiter  | waitress  | en_US
2  | 1                  | Kellner | Kellnerin  | de_DE

Now you can reference all other language versions, too, by using English as the base. The French version would be id = 3, profession_id = 1 again, language = "fr_FR", and so forth.