@@ -66,27 +66,31 @@ $l = new wUFr\Translator(dir: "./locales/", lang: "en_US");
66
66
echo $l->locale(
67
67
"someFolder/testValues",
68
68
"translate_this"
69
- ) // outputs "translated value"
69
+ )
70
+ // outputs "translated value"
70
71
71
72
72
73
// STRING BASED ON "AMOUNT" OF SOMETHING
73
74
echo $l->locale(
74
75
"someFolder/testValues",
75
76
"BasedOnNumber",
76
77
["_counter" => 0]
77
- ) // outputs "box"
78
+ )
79
+ // outputs "box"
78
80
79
81
echo $l->locale(
80
82
"someFolder/testValues",
81
83
"BasedOnNumber",
82
84
["_counter" => 50]
83
- ) // outputs "a lot of boxes"
85
+ )
86
+ // outputs "a lot of boxes"
84
87
85
88
echo $l->locale(
86
89
"someFolder/testValues",
87
90
"BasedOnNumber",
88
91
["_counter" => 51]
89
- ) // outputs "a lot of boxes" as well
92
+ )
93
+ // outputs "a lot of boxes" as well
90
94
91
95
92
96
// 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(
97
101
"username" => "John Doe",
98
102
"product" => "AMD Epyc Server"
99
103
]
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
+ */
101
115
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
105
116
echo $l->locale(
106
117
"someFolder/testValues",
107
118
"thxTextCounter",
@@ -111,5 +122,6 @@ echo $l->locale(
111
122
"username" => "John Doe",
112
123
"product" => "AMD Epyc Server"
113
124
]
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