Skip to content

Commit 7acf226

Browse files
committed
readme updated
1 parent ec3cbef commit 7acf226

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,31 @@ $l = new wUFr\Translator(dir: "./locales/", lang: "en_US");
6666
echo $l->locale(
6767
"someFolder/testValues",
6868
"translate_this"
69-
) // outputs "translated value"
69+
)
70+
// outputs "translated value"
7071

7172

7273
// STRING BASED ON "AMOUNT" OF SOMETHING
7374
echo $l->locale(
7475
"someFolder/testValues",
7576
"BasedOnNumber",
7677
["_counter" => 0]
77-
) // outputs "box"
78+
)
79+
// outputs "box"
7880

7981
echo $l->locale(
8082
"someFolder/testValues",
8183
"BasedOnNumber",
8284
["_counter" => 50]
83-
) // outputs "a lot of boxes"
85+
)
86+
// outputs "a lot of boxes"
8487

8588
echo $l->locale(
8689
"someFolder/testValues",
8790
"BasedOnNumber",
8891
["_counter" => 51]
89-
) // outputs "a lot of boxes" as well
92+
)
93+
// outputs "a lot of boxes" as well
9094

9195

9296
// STRING WITH REPLACABLE VALUES (IDEAL FOR USE IN TEMPLATING ENGINES, SO YOU DONT HAVE TO SPLIT TEXT INTO MULTIPLE KEY-STRINGS IN CONFIG)
@@ -97,11 +101,18 @@ echo $l->locale(
97101
"username" => "John Doe",
98102
"product" => "AMD Epyc Server"
99103
]
100-
) // outputs "Thank you John Doe for buying AMD Epyc Server"
104+
)
105+
// outputs "Thank you John Doe for buying AMD Epyc Server"
106+
107+
/*
108+
CAN BE COMBINED WITH COUNTER AS WELL
109+
110+
WARNING: "_counter" cant be used in replacable values, you always have to specify it again
111+
112+
its only used to decide which string should be returned, not for replacint
113+
114+
*/
101115

102-
// CAN BE COMBINED WITH COUNTER AS WELL
103-
// WARNING: "_counter" cant be used in replacable values, you always have to specify it again
104-
// its only used to decide which string should be returned, not for replacint
105116
echo $l->locale(
106117
"someFolder/testValues",
107118
"thxTextCounter",
@@ -111,5 +122,6 @@ echo $l->locale(
111122
"username" => "John Doe",
112123
"product" => "AMD Epyc Server"
113124
]
114-
) // outputs: "Thank you John Doe for buying 50 pieces of AMD Epyc Server"
115-
```
125+
)
126+
// outputs: "Thank you John Doe for buying 50 pieces of AMD Epyc Server"
127+
```

0 commit comments

Comments
 (0)