', $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], '. ', !empty($settings['show_latest_member']) ? $txt['latest_member'] . ': <strong> ' . $context['common_stats']['latest_member']['link'] . '</strong>' : '', '<br />
Quote from: AngelinaBelle on August 29, 2011, 08:20:36 AMthere are 6 cases in Russian, even more in some other languages (14 in Estonian, I believe). There must be a more complex solution.
I have reported this as a feature for 2.1 -- to distinguish between nominative and dative case of nouns. It could be tough for English-speakers to remember to get this one right.
Quote from: emanuele on September 05, 2011, 08:15:39 AM
Could you list where these cases are so we can have a more comprehensive view of the problem?
Case | Example word: topic | Example: January | Example: author | Example: permissions |
Именительный (Nominative) | тема | январь | автор | права доступа |
Родительный (Genitive) | темы | января | автора | прав доступа |
Дательный (Dative) | теме | январю | автору | правам доступа |
Винительный (Accusative) | тему | январь | автора | права доступа |
Творительный (Instrumental) | темой | январём | автором | правами доступа |
Предложный (Prepositional) | теме | январе | авторе | правах доступа |
Quote from: Dzonny on September 05, 2011, 07:01:50 PM
Well, we don't need all of those cases. We would need just nominative and dative for "members" if i'm right?
Quote
In Finnish:
by 27 members = 27 jäseneltä ( possibly jäsentä )
=> Currently used translation for "19 Posts in 3 Topics by 2 Members."
=> "19 viestiä 3 aihetta kirjoittanut 2 jäsentä."
=> Which would be "19 messages 3 topics written by 2 members" in english.
from X-number of members = Jäseneltä / Jäseniltä depending on context.
to members = Jäsenille
to 1 member = Jäsenelle
Literally "Many members" = Monia jäseniä / Monta jäsentä
One member = Yksi Jäsen
Two members = Kaksi Jäsentä
So in short - No, making extra strings for these does not sound like a viable option IMO. What would sound more doable, would be to allow some flexibility for translators to rewrite the whole sentence. ( For example, containing the whole thing in one language string with expressions to show the right data )
Quote from: poolhall on September 05, 2011, 04:58:25 PMMy question was more: can you point us to the places (the strings or the positions in the templates) in SMF where you know a string is misused because should be translated in two different ways for your language? Sorry for the misunderstanding.Quote from: emanuele on September 05, 2011, 08:15:39 AM
Could you list where these cases are so we can have a more comprehensive view of the problem?
okay, a few examples:
[SNIP]
Quote from: emanuele on September 06, 2011, 05:08:08 AMIn Russian there are no such places, I believe. The translation of a noun every time would be the same, but cases would be different. Example, in boardview, in Replies / Views column, the words views / replies have a wrong case in Russian ~50% of the time.Quote from: poolhall on September 05, 2011, 04:58:25 PMMy question was more: can you point us to the places (the strings or the positions in the templates) in SMF where you know a string is misused because should be translated in two different ways for your language? Sorry for the misunderstanding.Quote from: emanuele on September 05, 2011, 08:15:39 AM
Could you list where these cases are so we can have a more comprehensive view of the problem?
okay, a few examples:
[SNIP]
Quote from: poolhall on September 06, 2011, 10:43:44 AMFine, but please give practical references to code in SMF or at least to a page and a position where the current translation for a string (e.g. $txt['members']) doesn't fit with the Russian grammar rules like ke did in the first post.
From practical point of view, I think it would be enough in Russian language strings to take care of 3 cases for some nouns (such as member, topic, replies, views, names of the months and days) used with numerals.
', $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], '. ', !empty($settings['show_latest_member']) ? $txt['latest_member'] . ': <strong> ' . $context['common_stats']['latest_member']['link'] . '</strong>' : '', '<br />
$txt['posts_made'] = 'Сообщений';
$txt['topics'] = 'Тем';
$txt['members'] = 'Пользователей';
Quote from: emanuele on September 06, 2011, 12:15:00 PM
There are other similar situations in SMF? If so where?
QuoteSo - I agree with the OP. It should be made one big language string instead of a puzzle of many incompatible parts.As Lex said, we will make new string with whole phrase, so translators can deal with that string we're talking about. However, we would like to hear if there is some other specific phrase which should be changed in order to get better translation?
Quote from: Illori on September 06, 2011, 02:42:01 PMSorry, i've missed that, as we discuss about this problem in several boards. :P
I think a thread was posted there already asking for feedback in this thread.
[opinions needed] issue with $txt['members'] (http://www.simplemachines.org/community/index.php?topic=451406.0)
Quote from: AngelinaBelle on September 06, 2011, 02:30:12 PMI think so, about 60. How it should be done, I don't know. Maybe it could be a function that would look up for a correct case depending on a qualifying numeral.
This is adding 60 words, at least? The English-speaking developers will simply not use them "properly", even if they exist in the russian translations. They will never understand how to choose between all the cases of the words.
How will we get it right in some future version of SMF?
Quote from: poolhall on September 06, 2011, 02:01:54 PMThanks and sorry for the confusion, I'm not so good with foreign languages. ;)
emanuele, the same example from the ke's post:
Quote from: emanuele on September 06, 2011, 03:32:51 PMyes
It's what is explained here (http://en.wikibooks.org/wiki/Russian/Numbers#Use_of_numerals_in_context), correct?
Now I see the complexity...
Quote from: Aleksi "Lex" Kilpinen on September 06, 2011, 03:35:41 PMthis construction does not require a coordination, so yes, it would. But I would not call it a sentence ;) those are not grammatical constructions.
The merging to one big string would allow,completely rewording and rearranging the sentence. It could even be made a simple list like Discussions: (number of topics), messages: (number of posts), Users: ( number of members)
This would not work in russian then?
Quote from: Aleksi "Lex" Kilpinen on September 06, 2011, 03:44:42 PMwould you then change the English sentence "2,337,893 messages in 13,418 topics by 10,107 members" to "Messages: 2,337,893, topics: 13,418, members: 10,107"? :)
That's my point exactly :) It's originally a "sentence" that can be translated to anything else that works - does not need to remain a sentence ;)
Quote from: emanuele on September 06, 2011, 05:02:41 PMAs I said I use Facebook in English. I change it to Russian to see how it is done there and saw that FB uses the proper case of the word "пользователи" (people) with various cardinal numerals. Though this word, its plural form, has only two variations with numerals, and I didn't notice Facebook does this for other nouns.
I have no idea how FB deal with this kind of situations...
Just curious: how did you "teach" FB to deal with all these variations?
Quote from: poolhall on September 06, 2011, 11:22:16 PMDon't worry, I'm just thinking aloud. ;)
Don't get me wrong, I am not sure myself what is the best way to handle this problem, and I am not asking or proposing that such function should be developed.
Quote from: poolhall on September 06, 2011, 11:22:16 PMSorry, I thought you contributed to translate FB in Russian, never mind. ;)
As I said I use Facebook in English. I change it to Russian to see how it is done there
Quote from: Aleksi "Lex" Kilpinen on September 06, 2011, 11:31:01 PMYep, that is one of my concern too. I was going to write we would need translator-developers, but then I started writing about other things. :)
First of all, the devs would have to know those languages in order to do that
Quote from: Dzonny on September 07, 2011, 05:07:39 AMRight! :D
I agree with you all, but the most important for now is to know where exactly issues are.
Quote from: Dzonny on September 07, 2011, 05:07:39 AM
I agree with you all, but the most important for now is to know where exactly issues are. When we know about it we will discuss about how those problem should be resolved. I dont think that all 60 words is used in different cases though. I will test this during the day.
Quote from: AngelinaBelle on August 29, 2011, 08:20:36 AMIn the example you give, would it also be proper to use dative form of the noun "topics" following the preposition "in"?
function define_plural ($string, $count, $find, $replace)
{
global $txt;
if (empty($count))
$return = $txt[$string . '_zero'];
elseif ($count == 1)
$return = $txt[$string . '_one'];
else
$return = sprintf($string . '_many', $count);
if (!empty($find) && count($find) == count($replace))
foreach ($find as $key => $val)
$return = str_replace($val, $replace[$key], $return;
return $return;
}
sprintf($txt['welcome_newest_member'], ' ' . $context['common_stats']['latest_member']['link'])
sprintf($txt['welcome_newest_member'], $context['common_stats']['latest_member']['link'])
txt['welcome_newest_member'] = 'Please welcome %1$s, our newest member.';
function define_plural ($string, $count, $find, $replace)
{
global $txt;
if ($count == 1)
$return = $txt[$string . '_one'];
else
{
$last_digit = substr($count, -1);
if (in_array($last_digit, array(2, 3, 4))
$return = sprintf($string . '_many_1', $count);
else
$return = sprintf($string . '_many_2', $count);
}
if (!empty($find) && count($find) == count($replace))
foreach ($find as $key => $val)
$return = str_replace($val, $replace[$key], $return;
return $return;
}
function define_plural ($string, $count, $find, $replace)
{
global $txt;
$count_number = array(
0 => 'zero', //the equivalent Chinese version of course
1 => 'one', //the equivalent Chinese version of course
2 => 'two', //the equivalent Chinese version of course
3 => 'three', //the equivalent Chinese version of course
4 => 'four', //the equivalent Chinese version of course
5 => 'five', //the equivalent Chinese version of course
6 => 'six', //the equivalent Chinese version of course
7 => 'seven', //the equivalent Chinese version of course
8 => 'eight', //the equivalent Chinese version of course
9 => 'nine', //the equivalent Chinese version of course
);
if (empty($count))
$return = $txt[$string . '_zero'];
elseif ($count == 1)
$return = $txt[$string . '_one'];
else
$return = sprintf($string . '_many', $count_number[$count]);
if (!empty($find) && count($find) == count($replace))
foreach ($find as $key => $val)
$return = str_replace($val, $replace[$key], $return;
return $return;
}
Quote from: AngelinaBelle on September 11, 2012, 08:37:27 AMFixed that one (https://github.com/emanuele45/playpen/commit/75bffbff672d9d5729f6ae4b3bd6bb8cfcb2c0af) and added another series of things more or less related.
In SSI.php,Code Selectsprintf($txt['welcome_newest_member'], ' ' . $context['common_stats']['latest_member']['link'])
Code (replace) Selectsprintf($txt['welcome_newest_member'], $context['common_stats']['latest_member']['link'])
BecauseCode Selecttxt['welcome_newest_member'] = 'Please welcome %1$s, our newest member.';
$board['is_redirect'] ? $txt['redirects'] : $txt['posts']
rspack_declension($board['posts'], $board['is_redirect'] ? $txt['rspack_redirect'] : $txt['rspack_post'])
$context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members']
$context['common_stats']['total_posts'], ' ', rspack_declension($context['common_stats']['total_posts'], $txt['rspack_post']), ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', rspack_declension($context['common_stats']['total_topics'], $txt['rspack_topic']), ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', rspack_declension($context['common_stats']['total_members'], isset($txt['rspack_user1']) ? $txt['rspack_user1'] : $txt['rspack_user'])
$txt['rspack_post'] = 'posts, post';
$txt['rspack_user'] = 'members, member';
$txt['rspack_redirect'] = 'redirects, redirect';
$txt['rspack_post'] = 'сообщений, сообщение, сообщения';
$txt['rspack_user'] = 'пользователей, пользователь, пользователя';
$txt['rspack_user1'] = 'пользователей, пользователя';
$txt['rspack_redirect'] = 'переходов, переход, перехода';
$txt['rspack_post'] = 'повідомлень, повідомлення, повідомлення';
$txt['rspack_user'] = 'користувачів, користувач, користувача';
$txt['rspack_user1'] = 'користувачів, користувача';
$txt['rspack_redirect'] = 'переходів, перехід, переходи';
function rspack_declension($num, $str)
{
$exp = explode(',', $str);
$num = (($num < 0) ? $num-$num*2 : $num)%100;
$dig = ($num > 20) ? $num%10 : $num;
if (sizeof($exp) == 2) {
$exp[2] = $exp[0];
}
return trim((($dig == 1) ? $exp[1] : (($dig > 4 || $dig < 1) ? $exp[0] : $exp[2])));
}