Skip to content

Commit

Permalink
fix: use default text for dialog options if text is untranslated
Browse files Browse the repository at this point in the history
fix: delete .translation files
fix: delete unused translated texts
fix: typo in one translated text
  • Loading branch information
enekonieto authored and StraToN committed Oct 28, 2023
1 parent 1544609 commit 77eaa4c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const REGEX = \


# Option displayed in the HUD
var option: String setget ,get_option
var option: String setget ,get_translated_text

# Conditions to show this dialog
var conditions: Array = []
Expand Down Expand Up @@ -51,9 +51,19 @@ func load_string(option_string: String):
)


func get_option():
func get_translated_text():
# Check if text has a key
if ":" in option:
return tr(option.split(":")[0])
var splitted_text = option.split(":")
var key = splitted_text[0]
var translated_text = tr(key)

# If no translation is found use default text
if key != translated_text:
return tr(key)
if splitted_text.size() > 1:
return splitted_text[1]

return option


Expand Down
2 changes: 1 addition & 1 deletion game/rooms/room06/esc/worker.esc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ turn_to worker player
- "I know enough about Loom." [!loom_conversation_done]
set_global loom_conversation_done true
!
- "I'm done."
- ROOM6_dialog_bye:"I'm done."
say player "Bye!"
turn_to worker worker_face_down
stop
Expand Down
5 changes: 2 additions & 3 deletions game/translations/game.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ keys,en,fr,de,es
ROOM1_look_wall_item_1,"I don't know what that stuff is.","Je ne sais pas ce que c'est.","Ich habe keine Ahnung, was das ist.","No sé que esta cosa."
ROOM1_look_wall_item_2,"I REALLY don't know what that stuff is.","Je ne sais VRAIMENT pas ce que c'est.","Ich habe WIRKLICH keine Ahnung, was das ist!","REALMENTE no se que es esta cosa."
ROOM1_look_wall_item_3,"No, SERIOUSLY, I have no idea what that is!","Non, SÉRIEUSEMENT, je n'ai aucune idée de ce que c'est !","IM ERNST! Ich habe keine Ahnung, was das ist!","No, EN SERIO, no tengo ni idea de lo que es!"
ROOM1_look_wall_item_4,"Please stop asking me that!","Arrêtez de me demander !","Bite hör' auf, mich danach zu fragen!","Porfa deja de preguntarmelo!"
ROOM6_dialog_1,"What are you doing here?","Que faites-vous ici ?","Was machst Du hier?","¿Qué haces aquí?"
ROOM6_dialog_2,"I'm selling these fine leather jackets.", "Je vends ces superbes blousons en cuir.","Ich verkaufe diese schicken Lederjacken.","Vendo estas estupendas chaquetas de cuero."
ROOM1_look_wall_item_4,"Please stop asking me that!","Arrêtez de me demander !","Bite hör' auf, mich danach zu fragen!","Porfa deja de preguntármelo!"
ROOM6_dialog_bye,,,,
Binary file removed game/translations/game.de.translation
Binary file not shown.
Binary file removed game/translations/game.en.translation
Binary file not shown.
Binary file removed game/translations/game.fr.translation
Binary file not shown.
Binary file removed game/translations/main_menu.de.translation
Binary file not shown.
Binary file removed game/translations/main_menu.en.translation
Binary file not shown.
Binary file removed game/translations/main_menu.fr.translation
Binary file not shown.

0 comments on commit 77eaa4c

Please sign in to comment.