Skip to content

Commit

Permalink
Translate 2 minute adventure voice transcript
Browse files Browse the repository at this point in the history
  • Loading branch information
pfertyk committed Feb 23, 2020
1 parent 55ef592 commit 345c2f6
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 5 deletions.
13 changes: 13 additions & 0 deletions demo/locale/2ma.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
keys,en,de,pl
"Just a few steps more and I will open the portal!","Just a few steps more and I will open the portal!","Nur noch ein paar Schritte und ich werde das Portal öffnen!","Jeszcze tylko kilka kroków i otworzę portal!"
"I should power it up first.","I should power it up first.","Ich sollte es zuerst einschalten.","Powinnam najpierw włączyć zasilanie."
"Mmmm, delicious!","Mmmm, delicious!","Mmmm, lecker!","Mmmm, pyszne!"
"It's useless without a battery.","It's useless without a battery.","Ohne Batterie ist es nutzlos.","Bez baterii jest bezużyteczny."
"I should upload the coordinates first.","I should upload the coordinates first.","Ich sollte zuerst die Koordinaten hochladen.","Powinnam najpierw wgrać współrzędne."
"The portal is active! Almost there...","The portal is active! Almost there...","Das Portal ist aktiv! Fast dort...","Portal jest aktywny! Już prawie…"
"The coordinates are uploaded. Now, where is the remote...","The coordinates are uploaded. Now, where is the remote...","Die Koordinaten werden hochgeladen. Wo ist die Fernbedienung…","Współrzędne są wgrane. Gdzie podział się pilot…"
"It's going to be a long journey, I should eat something first.","It's going to be a long journey, I should eat something first.","Es wird eine lange Reise, ich sollte zuerst etwas essen.","To będzie długa podróż, powinnam najpierw coś zjeść."
"Finally! This is actually happening! Another world awaits!","Finally! This is actually happening! Another world awaits!","Schließlich! Das passiert tatsächlich! Eine andere Welt erwartet Sie!","Nareszcie! To się dzieje naprawdę! Inny świat czeka!"
"But why?","But why?","Aber warum?","Ale dlaczego?"
"What for?","What for?","Wofür?","W jakim celu?"
"This doesn't make sense...","This doesn't make sense...","Das macht keinen Sinn…","To nie ma sensu..."
16 changes: 16 additions & 0 deletions demo/locale/2ma.csv.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[remap]

importer="csv_translation"
type="Translation"

[deps]

files=[ "res://demo/locale/2ma.en.translation", "res://demo/locale/2ma.de.translation", "res://demo/locale/2ma.pl.translation" ]

source_file="res://demo/locale/2ma.csv"
dest_files=[ "res://demo/locale/2ma.en.translation", "res://demo/locale/2ma.de.translation", "res://demo/locale/2ma.pl.translation" ]

[params]

compress=true
delimiter=0
Binary file added demo/locale/2ma.de.translation
Binary file not shown.
Binary file added demo/locale/2ma.en.translation
Binary file not shown.
Binary file added demo/locale/2ma.pl.translation
Binary file not shown.
10 changes: 5 additions & 5 deletions goat/globals/goat_voice.gd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func _process(_delta):
play_default()


func register(audio_name: String, transcript) -> void:
func register(audio_name: String, transcript: String) -> void:
"""
Registers an audio file and associates it with a transcript. Reads files
from the `voice` directory (audio_name and file name have to match).
Expand Down Expand Up @@ -79,7 +79,7 @@ func play(audio_names) -> void:
emit_signal("started", audio_name)


func play_default():
func play_default() -> void:
"""Plays one of the default audio files"""
if _default_audio_names:
play(_default_audio_names)
Expand All @@ -106,11 +106,11 @@ func set_default_audio_names(default_audio_names: Array) -> void:


func get_transcript(audio_name: String) -> String:
"""Returns transcript associated with the given audio name"""
return _audio_mapping[audio_name]["transcript"]
"""Returns localized transcript associated with the given audio name"""
return tr(_audio_mapping[audio_name]["transcript"])


func connect_default(signal_object, signal_name):
func connect_default(signal_object: Object, signal_name: String) -> void:
"""
Configures default audio files to be played when signal_object emits
signal_name. This can be called several times to play default audio in
Expand Down
4 changes: 4 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ goat_dismiss={
]
}

[locale]

translations=PoolStringArray( "res://demo/locale/2ma.en.translation", "res://demo/locale/2ma.de.translation", "res://demo/locale/2ma.pl.translation" )

[rendering]

quality/filters/use_nearest_mipmap_filter=true
Expand Down

0 comments on commit 345c2f6

Please sign in to comment.