@@ -8,7 +8,8 @@ var translated_character_names: PackedStringArray = []
8
8
var translated_lines : Array [Dictionary ] = []
9
9
10
10
11
- func _parse_file (path : String , msgids : Array , msgids_context_plural : Array ) -> void :
11
+ func _parse_file (path : String ) -> Array [PackedStringArray ]:
12
+ var msgs : Array [PackedStringArray ] = []
12
13
var file : FileAccess = FileAccess .open (path , FileAccess .READ )
13
14
var text : String = file .get_as_text ()
14
15
@@ -25,7 +26,7 @@ func _parse_file(path: String, msgids: Array, msgids_context_plural: Array) -> v
25
26
known_keys .append (character_name )
26
27
27
28
translated_character_names .append (character_name )
28
- msgids_context_plural .append ([character_name .replace ('"' , '\" ' ), "dialogue" , "" ] )
29
+ msgs .append (PackedStringArray ( [character_name .replace ('"' , '\" ' ), "dialogue" , "" , DMConstants . translate ( "translation_plugin.character_name" )]) )
29
30
30
31
# Add all dialogue lines and responses
31
32
var dialogue : Dictionary = data .lines
@@ -41,20 +42,11 @@ func _parse_file(path: String, msgids: Array, msgids_context_plural: Array) -> v
41
42
known_keys .append (translation_key )
42
43
translated_lines .append (line )
43
44
if translation_key == line .text :
44
- msgids_context_plural .append ([line .text .replace ('"' , '\" ' ), "" , "" ] )
45
+ msgs .append (PackedStringArray ( [line .text .replace ('"' , '\" ' ), "" , "" , line . get ( "notes" , "" )]) )
45
46
else :
46
- msgids_context_plural .append ([line .text .replace ('"' , '\" ' ), line .translation_key .replace ('"' , '\" ' ), "" ] )
47
+ msgs .append (PackedStringArray ( [line .text .replace ('"' , '\" ' ), line .translation_key .replace ('"' , '\" ' ), "" , line . get ( "notes" , "" )]) )
47
48
48
-
49
- func _get_comments (msgids_comment : Array [String ], msgids_context_plural_comment : Array [String ]) -> void :
50
- # Add all character names if settings ask for it
51
- if DMSettings .get_setting (DMSettings .INCLUDE_CHARACTERS_IN_TRANSLATABLE_STRINGS_LIST , true ):
52
- for character_name in translated_character_names :
53
- msgids_context_plural_comment .append (DMConstants .translate ("translation_plugin.character_name" ))
54
-
55
- # Add all dialogue lines and responses
56
- for line : Dictionary in translated_lines :
57
- msgids_context_plural_comment .append (line .get ("notes" , "" ))
49
+ return msgs
58
50
59
51
60
52
func _get_recognized_extensions () -> PackedStringArray :
0 commit comments