@@ -45,7 +45,7 @@ public function testTransWithoutCaching()
4545 {
4646$ translator =$ this ->getTranslator ($ this ->getLoader ());
4747$ translator ->setLocale ('fr ' );
48- $ translator ->setFallbackLocales (array ('en ' ,'es ' ,'pt-PT ' ,'pt_BR ' ,'fr.UTF-8 ' ));
48+ $ translator ->setFallbackLocales (array ('en ' ,'es ' ,'pt-PT ' ,'pt_BR ' ,'fr.UTF-8 ' , ' sr@latin ' ));
4949
5050$ this ->assertEquals ('foo (FR) ' ,$ translator ->trans ('foo ' ));
5151$ this ->assertEquals ('bar (EN) ' ,$ translator ->trans ('bar ' ));
@@ -55,14 +55,15 @@ public function testTransWithoutCaching()
5555$ this ->assertEquals ('foobarfoo (PT-PT) ' ,$ translator ->trans ('foobarfoo ' ));
5656$ this ->assertEquals ('other choice 1 (PT-BR) ' ,$ translator ->transChoice ('other choice ' ,1 ));
5757$ this ->assertEquals ('foobarbaz (fr.UTF-8) ' ,$ translator ->trans ('foobarbaz ' ));
58+ $ this ->assertEquals ('foobarbax (sr@latin) ' ,$ translator ->trans ('foobarbax ' ));
5859 }
5960
6061public function testTransWithCaching ()
6162 {
6263// prime the cache
6364$ translator =$ this ->getTranslator ($ this ->getLoader (),array ('cache_dir ' =>$ this ->tmpDir ));
6465$ translator ->setLocale ('fr ' );
65- $ translator ->setFallbackLocales (array ('en ' ,'es ' ,'pt-PT ' ,'pt_BR ' ,'fr.UTF-8 ' ));
66+ $ translator ->setFallbackLocales (array ('en ' ,'es ' ,'pt-PT ' ,'pt_BR ' ,'fr.UTF-8 ' , ' sr@latin ' ));
6667
6768$ this ->assertEquals ('foo (FR) ' ,$ translator ->trans ('foo ' ));
6869$ this ->assertEquals ('bar (EN) ' ,$ translator ->trans ('bar ' ));
@@ -72,12 +73,13 @@ public function testTransWithCaching()
7273$ this ->assertEquals ('foobarfoo (PT-PT) ' ,$ translator ->trans ('foobarfoo ' ));
7374$ this ->assertEquals ('other choice 1 (PT-BR) ' ,$ translator ->transChoice ('other choice ' ,1 ));
7475$ this ->assertEquals ('foobarbaz (fr.UTF-8) ' ,$ translator ->trans ('foobarbaz ' ));
76+ $ this ->assertEquals ('foobarbax (sr@latin) ' ,$ translator ->trans ('foobarbax ' ));
7577
7678// do it another time as the cache is primed now
7779$ loader =$ this ->getMock ('Symfony\Component\Translation\Loader\LoaderInterface ' );
7880$ translator =$ this ->getTranslator ($ loader ,array ('cache_dir ' =>$ this ->tmpDir ));
7981$ translator ->setLocale ('fr ' );
80- $ translator ->setFallbackLocales (array ('en ' ,'es ' ,'pt-PT ' ,'pt_BR ' ,'fr.UTF-8 ' ));
82+ $ translator ->setFallbackLocales (array ('en ' ,'es ' ,'pt-PT ' ,'pt_BR ' ,'fr.UTF-8 ' , ' sr@latin ' ));
8183
8284$ this ->assertEquals ('foo (FR) ' ,$ translator ->trans ('foo ' ));
8385$ this ->assertEquals ('bar (EN) ' ,$ translator ->trans ('bar ' ));
@@ -87,6 +89,7 @@ public function testTransWithCaching()
8789$ this ->assertEquals ('foobarfoo (PT-PT) ' ,$ translator ->trans ('foobarfoo ' ));
8890$ this ->assertEquals ('other choice 1 (PT-BR) ' ,$ translator ->transChoice ('other choice ' ,1 ));
8991$ this ->assertEquals ('foobarbaz (fr.UTF-8) ' ,$ translator ->trans ('foobarbaz ' ));
92+ $ this ->assertEquals ('foobarbax (sr@latin) ' ,$ translator ->trans ('foobarbax ' ));
9093 }
9194
9295public function testGetLocale ()
@@ -185,6 +188,13 @@ protected function getLoader()
185188'foobarbaz ' =>'foobarbaz (fr.UTF-8) ' ,
186189 ))))
187190 ;
191+ $ loader
192+ ->expects ($ this ->at (6 ))
193+ ->method ('load ' )
194+ ->will ($ this ->returnValue ($ this ->getCatalogue ('sr@latin ' ,array (
195+ 'foobarbax ' =>'foobarbax (sr@latin) ' ,
196+ ))))
197+ ;
188198
189199return $ loader ;
190200 }
@@ -216,6 +226,7 @@ public function getTranslator($loader, $options = array())
216226$ translator ->addResource ('loader ' ,'foo ' ,'pt-PT ' );// European Portuguese
217227$ translator ->addResource ('loader ' ,'foo ' ,'pt_BR ' );// Brazilian Portuguese
218228$ translator ->addResource ('loader ' ,'foo ' ,'fr.UTF-8 ' );
229+ $ translator ->addResource ('loader ' ,'foo ' ,'sr@latin ' );// Latin Serbian
219230
220231return $ translator ;
221232 }