@@ -150,57 +150,3 @@ func TestLocaleWithTemplate(t *testing.T) {
150150		assert .Equal (t , c .want , buf .String ())
151151	}
152152}
153- 
154- func  TestLocaleStoreQuirks (t  * testing.T ) {
155- 	const  nl  =  "\n " 
156- 	q  :=  func (q1 , s  string , q2  ... string ) string  {
157- 		return  q1  +  s  +  strings .Join (q2 , "" )
158- 	}
159- 	testDataList  :=  []struct  {
160- 		in    string 
161- 		out   string 
162- 		hint  string 
163- 	}{
164- 		{` xx` , `xx` , "simple, no quote" },
165- 		{`" xx"` , ` xx` , "simple, double-quote" },
166- 		{`' xx'` , ` xx` , "simple, single-quote" },
167- 		{"` xx`" , ` xx` , "simple, back-quote" },
168- 
169- 		{`x\"y` , `x\"y` , "no unescape, simple" },
170- 		{q (`"` , `x\"y` , `"` ), `"x\"y"` , "unescape, double-quote" },
171- 		{q (`'` , `x\"y` , `'` ), `x\"y` , "no unescape, single-quote" },
172- 		{q ("`" , `x\"y` , "`" ), `x\"y` , "no unescape, back-quote" },
173- 
174- 		{q (`"` , `x\"y` ) +  nl  +  "b=" , `"x\"y` , "half open, double-quote" },
175- 		{q (`'` , `x\"y` ) +  nl  +  "b=" , `'x\"y` , "half open, single-quote" },
176- 		{q ("`" , `x\"y` ) +  nl  +  "b=`" , `x\"y`  +  nl  +  "b=" , "half open, back-quote, multi-line" },
177- 
178- 		{`x ; y` , `x ; y` , "inline comment (;)" },
179- 		{`x # y` , `x # y` , "inline comment (#)" },
180- 		{`x \; y` , `x ; y` , `inline comment (\;)` },
181- 		{`x \# y` , `x # y` , `inline comment (\#)` },
182- 	}
183- 
184- 	for  _ , testData  :=  range  testDataList  {
185- 		ls  :=  NewLocaleStore ()
186- 		err  :=  ls .AddLocaleByJSON ("lang1" , "Lang1" , []byte (`{"a":"` + testData .in + `"}` ), nil )
187- 		lang1 , _  :=  ls .Locale ("lang1" )
188- 		assert .NoError (t , err , testData .hint )
189- 		assert .Equal (t , testData .out , lang1 .TrString ("a" ), testData .hint )
190- 		assert .NoError (t , ls .Close ())
191- 	}
192- 
193- 	// TODO: Crowdin needs the strings to be quoted correctly and doesn't like incomplete quotes 
194- 	//       and Crowdin always outputs quoted strings if there are quotes in the strings. 
195- 	//       So, Gitea's `key="quoted" unquoted` content shouldn't be used on Crowdin directly, 
196- 	//       it should be converted to `key="\"quoted\" unquoted"` first. 
197- 	// TODO: We can not use UnescapeValueDoubleQuotes=true, because there are a lot of back-quotes in en-US.ini, 
198- 	//       then Crowdin will output: 
199- 	//       > key = "`x \" y`" 
200- 	//       Then Gitea will read a string with back-quotes, which is incorrect. 
201- 	// TODO: Crowdin might generate multi-line strings, quoted by double-quote, it's not supported by LocaleStore 
202- 	//       LocaleStore uses back-quote for multi-line strings, it's not supported by Crowdin. 
203- 	// TODO: Crowdin doesn't support back-quote as string quoter, it mainly uses double-quote 
204- 	//       so, the following line will be parsed as: value="`first", comment="second`" on Crowdin 
205- 	//       > a = `first; second` 
206- }
0 commit comments