@@ -22,24 +22,36 @@ public void Load(string poFile)
22
22
using ( var reader = new StreamReader ( poFile ) )
23
23
{
24
24
string line ;
25
- while ( ( line = reader . ReadLine ( ) ) != null )
25
+ string NextLine ( ) => line = reader . ReadLine ( ) ? . Trim ( ) ;
26
+ while ( NextLine ( ) != null )
26
27
{
27
- line = line . Trim ( ) ;
28
- if ( line . StartsWith ( "msgid" , StringComparison . InvariantCulture ) )
28
+ if ( ! line . StartsWith ( "msgid" , StringComparison . InvariantCulture ) )
29
29
{
30
- var original = line . Substring ( 7 , line . Length - 8 ) ;
31
- line = reader . ReadLine ( ) ;
32
- if ( line == null || ! line . StartsWith ( "msgstr" , StringComparison . InvariantCulture ) )
33
- {
34
- continue ;
35
- }
36
- var translated = line . Substring ( 8 , line . Length - 9 ) ;
37
- Strings [ original ] = new TranslatableString
38
- {
39
- Original = original ,
40
- Translation = translated
41
- } ;
30
+ continue ;
42
31
}
32
+
33
+ string original = line . Substring ( 7 , line . Length - 8 ) ;
34
+ while ( NextLine ( ) != null && line . StartsWith ( "\" " , StringComparison . InvariantCulture ) )
35
+ {
36
+ original += line . Substring ( 1 , line . Length - 2 ) ;
37
+ }
38
+
39
+ if ( line == null || ! line . StartsWith ( "msgstr" , StringComparison . InvariantCulture ) )
40
+ {
41
+ continue ;
42
+ }
43
+
44
+ string translated = line . Substring ( 8 , line . Length - 9 ) ;
45
+ while ( NextLine ( ) != null && line . StartsWith ( "\" " , StringComparison . InvariantCulture ) )
46
+ {
47
+ translated += line . Substring ( 1 , line . Length - 2 ) ;
48
+ }
49
+
50
+ Strings [ original ] = new TranslatableString
51
+ {
52
+ Original = original ,
53
+ Translation = translated
54
+ } ;
43
55
}
44
56
}
45
57
}
0 commit comments