Move gender pronouns to LANGUAGE files

Moderator: GZDoom Developers

User avatar
Kostov
 
 
Posts: 2020
Joined: Thu Dec 26, 2013 3:26 pm
Location: Sweden

Move gender pronouns to LANGUAGE files

Post by Kostov »

There's this piece of code in src\p_interaction.cpp:

Code: Select all

// [RH]
// SexMessage: Replace parts of strings with gender-specific pronouns
//
// The following expansions are performed:
//		%g -> he/she/it
//		%h -> him/her/it
//		%p -> his/her/its
//		%o -> other (victim)
//		%k -> killer
//
void SexMessage (const char *from, char *to, int gender, const char *victim, const char *killer)
{
	static const char *genderstuff[3][3] =
	{
		{ "he",  "him", "his" },
		{ "she", "her", "her" },
		{ "it",  "it",  "its" }
	};
	static const int gendershift[3][3] =
	{
		{ 2, 3, 3 },
		{ 3, 3, 3 },
		{ 2, 2, 3 }
	};
	const char *subst = NULL;

	do
	{
		if (*from != '%')
		{
			*to++ = *from;
		}
		else
		{
			int gendermsg = -1;
			
			switch (from[1])
			{
			case 'g':	gendermsg = 0;	break;
			case 'h':	gendermsg = 1;	break;
			case 'p':	gendermsg = 2;	break;
			case 'o':	subst = victim;	break;
			case 'k':	subst = killer;	break;
			}
			if (subst != NULL)
			{
				size_t len = strlen (subst);
				memcpy (to, subst, len);
				to += len;
				from++;
				subst = NULL;
			}
			else if (gendermsg < 0)
			{
				*to++ = '%';
			}
			else
			{
				strcpy (to, genderstuff[gender][gendermsg]);
				to += gendershift[gender][gendermsg];
				from++;
			}
		}
	} while (*from++);
}
Would it be possible to move the pronouns to the LANGUAGE files for... well, language support?
Kotti
Posts: 86
Joined: Tue Dec 27, 2016 4:08 am

Re: Move gender pronouns to LANGUAGE files

Post by Kotti »

This suggestion is actually rather useless. The entire system is hardlocked to the specifics of the English language. In order to do this properly the entire sentences would have to be duplicated and adjusted in their entirety instead of replacing single words. There's only a small number of languages where this works.
User avatar
Kostov
 
 
Posts: 2020
Joined: Thu Dec 26, 2013 3:26 pm
Location: Sweden

Re: Move gender pronouns to LANGUAGE files

Post by Kostov »

Not sure how it's hardcoded to fit the English language. With the exception of what I mentioned in the original post, almost everything in GZDoom seems to be translatable. The only obstacles I can think of are the pronouns and the lack of Unicode, and those problems don't really seem to be related to each other.

And if the coding generally is as you say it is, that's all the more reason to at least think about making it more language-friendly.
Last edited by Kostov on Mon Jan 01, 2018 1:58 pm, edited 1 time in total.
User avatar
Rachael
Admin
Posts: 12957
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Move gender pronouns to LANGUAGE files

Post by Rachael »

Kotti is right, unfortunately, but even still it helps no one that the entire message is completely hardcoded.

A better solution would be to just allow LANGUAGE entries to take care of it, themselves. There's still some languages where even that might not work (since at least one language I know of actually modifies peoples' names - UGH!) but that would mean the entire string would have to be exported - i.e. "%o had her body immolated by %k's Phoenix rod." and "%o had his body immolated by %k's Phoenix rod." as separate strings.
User avatar
Kostov
 
 
Posts: 2020
Joined: Thu Dec 26, 2013 3:26 pm
Location: Sweden

Re: Move gender pronouns to LANGUAGE files

Post by Kostov »

That solution doesn't seem very simple to carry out, although it could be effective. :)
User avatar
Rachael
Admin
Posts: 12957
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Move gender pronouns to LANGUAGE files

Post by Rachael »

To clarify what I meant, here's an example: (a full 9-out branching for MFN genders)

OBIT_PHOENIX_MM = "Melvin had his body immolated by Jared's phoenix rod and his resulting fire."
OBIT_PHOENIX_MF = "Melvin had his body immolated by Tanya's phoenix rod and her resulting fire."
OBIT_PHOENIX_MN = "Melvin had his body immolated by Cyborg's phoenix rod and its resulting fire."
OBIT_PHOENIX_FM = "Sara had her body immolated by Jared's phoenix rod and his resulting fire."
OBIT_PHOENIX_FF = "Sara had her body immolated by Tanya's phoenix rod and her resulting fire."
OBIT_PHOENIX_FN = "Sara had her body immolated by Cyborg's phoenix rod and its resulting fire."
OBIT_PHOENIX_NM = "System 1A had its body immolated by Jared's phoenix rod and his resulting fire."
OBIT_PHOENIX_NF = "System 1A had its body immolated by Tanya's phoenix rod and her resulting fire."
OBIT_PHOENIX_NN = "System 1A had its body immolated by Cyborg's phoenix rod and its resulting fire."

And while yes, it would be better to use gender-neutrality whereever possible, it's not always possible, but where it is you could substitute the gender with A, using any combination (MA, FA, AF, AA, etc) and make gender-neutral statements like this:

OBIT_PHOENIX_AA = "%o was obliterated in %k's hailstorm of fire."

Alternatively, calling a language string could also just call a ZScript function that localizes it if it is loaded for that particular language, i.e. "FString portugese_phoenix_obit (FString victim, FString killer, int gendervictim, int genderkiller) {}"
Gez
 
 
Posts: 17654
Joined: Fri Jul 06, 2007 3:22 pm

Re: Move gender pronouns to LANGUAGE files

Post by Gez »

Note that in English, the possessive pronoun depends on the gender of the possessor, but that's not necessarily the case. In French for example, it's the gender (or number) of the possessed that counts. So for Melvin, Sara, and System 1A, you'd use "son corps" and for Jared, Tanya, and Cyborg you'd use "ses flammes" regardless. In some languages, both possessor and possessed have to be taken into account.

Gendered forms can also be found on other places than pronouns, too. Take a sentence like "%o was added to %k's victim list", in French you'd have gender agreement on "added" (either "ajouté" or "ajoutée").

You can have other issues, too. For example, in some languages, pronouns have declensions, which mean that (independently on any gender consideration) the pronoun can have different forms depending on its place in the sentence.

Lastly, ZDoom offering three genders (masculine, feminine, and neutral) is also an English language thing. Many languages don't have a neutral gender at all, for example. In some, the genders are fully divorced from sex, and can correspond to different categories such as "animated" and "inanimate", or "people", "animal", and "things".
User avatar
GFD
Posts: 343
Joined: Mon May 31, 2010 7:42 pm
Location: Canada

Re: Move gender pronouns to LANGUAGE files

Post by GFD »

Rachael wrote:(since at least one language I know of actually modifies peoples' names - UGH!)
Finnish would be one of those, I think? I found Besquit's brief intro to his Finnish translation of Chrono Trigger quite interesting. Definitely shows how localization to different languages can become extremely complicated.
I would think that using ZScript or something to allow strings to be formatted programmatically for different languages is the only way to achieve a system that can facilitate accurate localizations.
Kotti
Posts: 86
Joined: Tue Dec 27, 2016 4:08 am

Re: Move gender pronouns to LANGUAGE files

Post by Kotti »

Location is a tricky thing which in software development often gets compounded by programmers with weak language skills.

I am working in the marketing department of a company which sells a big business app all over the world and that obviously necessitates translating the texts into a multitude of languages, not limited to those using the Latin alphabet. As a result I often need to be the intermediary between the users and the programmers and learned a lot about the pitfalls of robust localization.

With most European languages, even the more 'exotic' ones it is still relatively simple because the overall sentence structure is mostly the same, but once you have to start to deal with Asian languages, many of the assumptions being made no longer apply. And programmers seem to have a tendency to 'optimize' by piecing texts together out of various fragments and, not surprisingly, oftentimes the results lead to customer complaints. It was hard work to convince them to stop doing this.

So by now the obvoius specification is to check the translation lists for incomplete or split-up sentences and have the programmers fix those before anything gets translated.

But in this particular case even that won't make things foolproof because the whole system can substitute names - and as has been pointed out, some languages actually alter the names in a non-trivial way based on context that cannot be dealt with in a generic, language independent fashion.

Even in a language like German which upon first sight appears to be relatively free of problems, there's one gotcha that's easy to miss: The possessive form of a name is normally created by appending an 's' to the name. But wait, there's one exception: If a name ends with an 's' or some other consonant that sounds like an 's', not an 's' needs to be appended but an apostrophe. And that's just one of the simpler rules to observe. The things to look out for in other languages are far more involved and far more tricky.

So ultimately the entire obituary system may just not be fully localizable. It is just making too many assumptions about how the English language works.
User avatar
Kostov
 
 
Posts: 2020
Joined: Thu Dec 26, 2013 3:26 pm
Location: Sweden

Re: Move gender pronouns to LANGUAGE files

Post by Kostov »

It'd still be helpful to change the system in some way, and so far we've got two different ideas. I support Rachael's.
User avatar
Matt
Posts: 9670
Joined: Sun Jan 04, 2004 5:37 pm
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Move gender pronouns to LANGUAGE files

Post by Matt »

This seems like one of those things where the status quo is just barely tolerably lousy, and any suggestion for an improvement gets swamped with what-abouts and ultimately nothing is done.

It could still be worthwhile to do this even just for English (with room for incremental improvement with other m/f/n pronoun languages), opening up possibilities not just for custom genders (if I had a dollar every time I've wanted to suggest adding a they in there...) but also things like matching up playerclasses that are supposed to represent specific characters and whatnot. (Or even make a mapset specifically exploring gender dysphoria......)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48041
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Move gender pronouns to LANGUAGE files

Post by Graf Zahl »

The entire idea is just broken by design, it cannot be localized so it makes no sense to even try. And adding more genders is definitely out.
I'd rather spend the time on defining a system that does not depend on piecing together some sentences.
User avatar
Kostov
 
 
Posts: 2020
Joined: Thu Dec 26, 2013 3:26 pm
Location: Sweden

Re: Move gender pronouns to LANGUAGE files

Post by Kostov »

Graf Zahl wrote:I'd rather spend the time on defining a system that does not depend on piecing together some sentences.
What kind of system do you have in mind?
User avatar
Matt
Posts: 9670
Joined: Sun Jan 04, 2004 5:37 pm
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Move gender pronouns to LANGUAGE files

Post by Matt »

Just commenting here since it happens to be the most recent thread on the topic, in case it makes anyone feel any better about the status quo:
Samuel Taylor Coleridge wrote:QUÆRE – whether we may not, nay ought not, to use a neutral pronoun, relative or representative, to the word "Person", where it hath been used in the sense of homo, mensch, or noun of the common gender, in order to avoid particularising man or woman, or in order to express either sex indifferently? If this be incorrect in syntax, the whole use of the word Person is lost in a number of instances, or only retained by some stiff and strange position of the words, as – "not letting the person be aware wherein offense has been given" – instead of – "wherein he or she has offended". In my [judgment] both the specific intention and general etymon of "Person" in such sentences fully authorise the use of it and which instead of he, she, him, her, who, whom.
-- Anima Poetæ: From the Unpublished Note-Books of Samuel Taylor Coleridge, edited by Ernest Hartley Coleridge (1895), p. 190. ["Homo" and "Mensch" are Latin and German words respectively which mean `man' in a general sex-neutral sense, as opposed to "vir" and "Mann", which mean `man' in the specifically masculine sense.]

One author who consistently wrote in this manner was the children's author E. Nesbit, who often wrote of mixed groups of children, and would write, e.g., "Everyone got its legs kicked or its feet trodden on in the scramble to get out of the carriage." (Five Children and It, p. 1). This usage (in all capital letters, as if an acronym) also occurs in District of Columbia police reports.

In earlier Middle English, arising from Old English, the pronoun was hit (similar to Dutch "het" and West Frisian "hit" with the same meaning), with the unaspirated it being an unaccented form. The genitive was his, with the new form its only arising by analogy in later Middle English.
[links omitted]

Return to “Closed Feature Suggestions”