1

format_number_choice私はSymfony1.4で使用する次のコードを持っています:

<?php echo format_number_choice(
        '[0]You do not have any remaining invites.|[1]You have one invite.|(1,+Inf]You have %1% invites.', array('%1%' => $users->getInvitatii()), $users->getInvitatii(), 'nrchoice') ?>

翻訳文字列は次のようになります。

<trans-unit id="2" approved="yes">
        <source>[0]You do not have any remaining invites.|[1]You have one invite.|(1,+Inf]You have %1% invites.</source>
        <target state="translated">[0]Nu mai aveți nicio invitație|[1]Mai aveți o invitație|{n: n % 100 < 20} Mai aveți %1% invitații.|{n: n % 100 > 20} Mai aveți %1% de invitații.</target>
</trans-unit>

ルーマニア語では、複数形には2つのタイプがあります:number%100 < 20number%100 >= 20。唯一の問題は、文字列が翻訳されておらず、構文にエラーがあると思いますが、どこに問題があるのか​​わかりません。この構文はSymfony1.4のドキュメントで見つかりました。

4

1 に答える 1

0

あなたはそれを試していただけますか:

phpコード:

<?php echo format_number_choice(
  '[0]You do not have any remaining invites.|[1]You have one invite|{n: n % 100 < 20} You have %1% invites.|{n: n % 100 > 20} You have %1% invites.', 
  array('%1%' => $users->getInvitatii()), $users->getInvitatii(), 'nrchoice')
?>

翻訳ファイル内:

<trans-unit id="2" approved="yes">
  <source>[0]You do not have any remaining invites.|[1]You have one invite|{n: n % 100 < 20} You have %1% invites.|{n: n % 100 > 20} You have %1% invites.</source>
  <target state="translated">[0]Nu mai aveți nicio invitație|[1]Mai aveți o invitație|{n: n % 100 < 20} Mai aveți %1% invitații.|{n: n % 100 > 20} Mai aveți %1% de invitații.</target>
</trans-unit>
于 2013-02-01T16:00:44.283 に答える