File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -179,3 +179,22 @@ msgstr ""
179
179
t .Errorf ("Exported PO format does not match. Received:\n \n %v\n \n \n Expected:\n \n %v" , string (poBytes ), expectedOutput )
180
180
}
181
181
}
182
+
183
+ func TestDomain_GetWithVar (t * testing.T ) {
184
+ po := NewPo ()
185
+ po .ParseFile (enUSFixture )
186
+
187
+ domain := po .GetDomain ()
188
+
189
+ // Test singular with variable
190
+ v := "My Text"
191
+ tr := domain .Get (v )
192
+ if tr != "My Text" {
193
+ t .Errorf ("Expected 'MyText' but got '%s'" , tr )
194
+ }
195
+
196
+ tr = po .Get (v )
197
+ if tr != "My Text" {
198
+ t .Errorf ("Expected 'MyText' but got '%s'" , tr )
199
+ }
200
+ }
Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ func TestPo_Get(t *testing.T) {
34
34
if tr != translatedText {
35
35
t .Errorf ("Expected '%s' but got '%s'" , translatedText , tr )
36
36
}
37
+
38
+ v := "My text"
39
+ tr = po .Get (v )
40
+ if tr != translatedText {
41
+ t .Errorf ("Expected '%s' but got '%s'" , translatedText , tr )
42
+ }
43
+
37
44
// Test translations
38
45
tr = po .Get ("language" )
39
46
if tr != "en_US" {
You can’t perform that action at this time.
0 commit comments