projectfluent / fluent

Fluent — planning, spec and documentation
https://projectfluent.org
Apache License 2.0
1.4k stars 45 forks source link

Formal vs informal language #300

Open jtynkkynen opened 4 years ago

jtynkkynen commented 4 years ago

Is there a way to handle politeness or formality of language, like formal and informal? This is very typical feature in languages like Japanese and Korean.

alerque commented 4 years ago

You could handle this with attributes similar to some of the gender examples floating around. Is there some usage that would not be covered by attributes?

jtynkkynen commented 4 years ago

Thanks. I was thinking I could do that. I believe it covers all that is needed.

alerque commented 4 years ago

@jtynkkynen Do you happen to know if the Unicode CLDR data includes information about what languages have formal/informal variants for what pars of speech?

jtynkkynen commented 4 years ago

@alerque I don't think they have that. I do not know other languages than Korean and Japanese that have honorifics to the level of verb endings, but Tamil and Thai at least have some kind of honorifics.

gandaro commented 4 years ago

@jtynkkynen Do you have an example for a use case where you would want the translator to be able to provide both formal and informal versions?

In software translations to German, we usually decide on the tone we want to use at the beginning and use that consistently.

jtynkkynen commented 4 years ago

@gandaro If you have an app that greets the user, it might need to be in different levels of honorifics for an older user and a younger user. Also software that sends emails or messages to users might need to send them in different levels of speech.

Pike commented 4 years ago

One way to potentially hook this up is to add a TONE() function at the Localization class level, which you prime with metadata it needs to decide which tone to use for which language. I'd expect that function to return different values for different languages, and with cross-language fallback in Fluent, you might end up in a situation where that matters.

This is obviously delicate to implement on the top-level stack, as you can't re-use bindings between users, for example.

Also, the nature of this function is to return seemingly unbound values, so this is going to also challenge the product cycle on the localization tool side. And if your implementation wants to be as strictly typed as possible, this might be a blocker.

rugk commented 4 years ago

Do you have an example for a use case where you would want the translator to be able to provide both formal and informal versions?

Actually, I know many software projects that are translated to German that offer both "German (du)" and "German (Sie)", i.e. a formal and informal version to users to select. The best example/one good one may be Nextcloud.

zbraniecki commented 4 years ago

As Axel suggested, in Fluent, this could be:

key = { TONE() ->
        [formal] ...
       *[informal] ...
    }
jtynkkynen commented 4 years ago

Yes, this could even handle the honorifics levels of Korean and Japanese which are a bit more complex than formal and informal.

tukusejssirs commented 3 years ago

Just to note: even Slovak, Czech, Hungarian, Italian, Spanish (and probably even Polish) distinguish between formal and informal communication to another person (singular you).

Some languages change only the pronoun (you), others change even the verb suffix.

rkh commented 3 years ago

FWIW, I am working on a Ruby implementation at the moment, and decided to go with the the custom function:

hello =
  Hallo {$name}! Wie geht es {TONE() ->
    [informal] dir
   *[formal] Ihnen
  }?

Accepted values are formal, informal and avoid (in German and probably other languages it is often possible to phrase sentences in a way that avoid addressing the user directly.)

I've also added a private locale extension (de-DE-x-informal) to select the tone. This should cover languages like German, Slovak, Czech, Hungarian, Italian, Spanish, etc just fine, but wouldn't extend to the more complex situation in Korean and Japanese. Though I'm not sure whether those extend beyond the honorific used to address a person.