On #2499639-13: Use correct labels for numeric fields when using a multiple plural forms language and the following few comments, we were discussing the plural formulas in Drupal Core localization files for Turkish.

They are currently set up to say that Turkish has only 1 plural form, and these are also the defaults set up in l10n_pconfig_plural_formulas() [which is why I am currently putting this issue in this project].

However, if you look at:
http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html
http://en.wikibooks.org/wiki/Turkish/Plural
and other sources, you'll see that Turkish does have two forms for nouns (singular and plural like English). They use the singular form if the noun is preceded by a number, but there are two forms.

This means, I believe, that some formatPlural() calls would need to have two forms in Turkish -- theoretically at least, it is not necessary to have @count in the plural form string -- you could be using formatPlural() to format something that doesn't contain the count, and in this case you'd need two forms for Turkish.

So, I think this needs to be changed, but we should consult with the Turkish language community on localize.drupal.org to figure this out.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

The way we source this information is when people ask to add a language, we look at publicly available plural info and then verify that with the person who wanted to start the team. Only then we create the team (and the language on localize.drupal.org). I am not aware of a definite source for plural variant rules, so the best is to check with the natives as far as I see. Unless they have a problem with the current setup, I am not sure why we need to change it?

See #569676: Add Turkish language to l.d.o where we did not discuss the plural form per say, but started off with an export of an existing 3rd party server.

Gábor Hojtsy’s picture

Oh also the l10n_pconfig listing is a copy of languages on localize.drupal.org, so that is where this module sources its data.

jhodgdon’s picture

Perhaps we do not have any format_plural() or formatPlural() string sets that lack the @count in the string currently, in which case in Turkish apparently you wouldn't use the plural form... however ... it would be interesting to see.

Hm...

https://localize.drupal.org/translate/languages/tr/translate?project=dru...

So this indicates that on localize.d.o, when they get a plural string set to translate, they are providing 2 formats in their translations, one with I think the word "one" written out, and one with @count in there.

?????????? How can this be, if Turkish is set up in Drupal to have only one form? What am I missing here?

Gábor Hojtsy’s picture

It may be a bug in l10n_server that even though Turkish on l.d.o is set to (nplurals=1; plural=0; -- I just verified), it still shows 2 fields for plural translation. It also seems to be true that actual downloadable .po files for Turkish have 2 plural variants:

msgid "1 vote"
msgid_plural "@count votes"
msgstr[0] "1 oy"
msgstr[1] "@count oy"

I think this is an l10n_server bug (to not fully adhere to the plural variants count).

Sahin’s picture

As a native speaker of Turkish I'm very sorry to meet this issue :(
Anyway I'll try to provide some more insight.
Yes, as it is put correctly in the definition of the issue,

Turkish does have two forms for nouns (singular and plural like English) ... singular form [is used] if the noun is preceded by a number [including 0].

Which is explained in detail at GNU gettext documentation.

Hungarian does not appear to have a plural if you look at sentences involving cardinal numbers. For example, “1 apple” is “1 alma”, and “123 apples” is “123 alma”. But when the number is not explicit, the distinction between singular and plural exists: “the apple” is “az alma”, and “the apples” is “az almák”. Since ngettext has to support both types of sentences, it is classified here, under “two forms”.
The same holds for Turkish:
“1 apple” is “1 elma”, and
“123 apples” is “123 elma”. But when the number is omitted, the distinction between singular and plural exists:
“the apple” is “elma”, and
“the apples” is “elmalar”.

So, settings for Turkish at function l10n_pconfig_plural_formulas(),
'tr' => $one,
seems wrong, although it works well when it is used only for nouns preceded by a number.
(BTW, it is interesting enough to see Hungarian setting as 'hu' => $default, which means 'nplurals=2; plural=(n!=1);'!)

The reason of this error is obscure but it might have been carried by imported po files at that time.

On the other hand, it can be complicated to define when to use the plural form without firing an error at the parser function. Notice that we use the plural form only when there is no numeric value for the variable.
Maybe we can ask Gábor Hojtsy if we can use something like that:
'tr' => 'nplurals=2; plural=(isset(n));',

kburakozdemir’s picture

I think that this issue should be handled in connection with this one

#3014243: Misconfigured plural forms for Turkish locale

kburakozdemir’s picture

Status: Active » Reviewed & tested by the community

I would like to mention that the similar issue 3014243: Misconfigured plural forms for Turkish locale has been "Reviewed & tested by the community". Thank you.

Gábor Hojtsy’s picture

Title: Turkish may have wrong default plural setup » Turkish may had wrong default plural setup
Gábor Hojtsy’s picture

Title: Turkish may had wrong default plural setup » Turkish had wrong default plural setup

  • Gábor Hojtsy committed 9a00a594 on 7.x-1.x
    Issue #2503057 by Gábor Hojtsy, kburakozdemir, jhodgdon, Sahin: Turkish...
Gábor Hojtsy’s picture

Version: 7.x-1.x-dev » 2.0.x-dev

Merged to 7, needs to get to 2.x too.