File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ class TranslatorTest extends TestCase
6
6
{
7
7
public function testTranslation ()
8
8
{
9
- $ translator = new Translator ();
10
- $ this ->assertEquals ('Hola ' , $ translator ->translate ( ' Hello ' , 'es ' ));
9
+ $ translator = new Translator (dir: " ./locales/ " , lang: " en_US " );
10
+ $ this ->assertEquals ('hello world ' , $ translator ->locale ( ' testValues ' , 'helloWorld ' ));
11
11
}
12
12
13
- public function testInvalidLanguage ()
13
+ /* public function testInvalidLanguage()
14
14
{
15
- $ translator = new Translator ();
15
+ $translator = new Translator(dir: "./locales/", lang: "en_US" );
16
16
$this->expectException(InvalidArgumentException::class);
17
17
$translator->translate('Hello', 'invalid-lang');
18
- }
18
+ }*/
19
19
}
Original file line number Diff line number Diff line change
1
+ $l = [
2
+ "helloWorld" => "hello world",
3
+ "BasedOnNumber" => [
4
+ 1 => "box",
5
+ 2 => "boxes",
6
+ 50 => "a lot of boxes"
7
+ ],
8
+ "thxText" => "Thank you {username} for buying {product}",
9
+ "thxTextCounter" => [
10
+ 1 => "Thank you {username} for buying a piece of {product}",
11
+ 2 => "Thank you {username} for buying two of {product}",
12
+ 50 => "Thank you {username} for buying {count} pieces of {product}",
13
+ ],
14
+ ];
You can’t perform that action at this time.
0 commit comments