Skip to content

Commit

Permalink
locale patch: portuguese (brazilian)
Browse files Browse the repository at this point in the history
  • Loading branch information
TinyTakinTeller committed Jan 8, 2025
1 parent 1c22d85 commit d95d592
Show file tree
Hide file tree
Showing 19 changed files with 683 additions and 660 deletions.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ audio music tracks ["axes_arr_mstr_loop.mp3", "forest_arr_mstr_loop.mp3", "stron
## Localization (res://assets/i18n/)

- "fr" FRENCH by Marion Veber licensed under CC-BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/)
- "pt" PORTUGUESE (Brazilian) by Maria Oliveira licensed under CC-BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/)
- "zh" CHINESE (SC) by vikky2604 and gloria_1023 (Middlebury Institute of International Studies) licensed under CC-BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/)


Expand Down
1,296 changes: 648 additions & 648 deletions assets/i18n/localization.csv

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/i18n/localization.csv.import
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ uid="uid://bm8lurvgbqh0h"

[deps]

files=["res://assets/i18n/localization.description.translation", "res://assets/i18n/localization.en.translation", "res://assets/i18n/localization.zh.translation", "res://assets/i18n/localization.fr.translation"]
files=["res://assets/i18n/localization.description.translation", "res://assets/i18n/localization.en.translation", "res://assets/i18n/localization.zh.translation", "res://assets/i18n/localization.fr.translation", "res://assets/i18n/localization.pt.translation"]

source_file="res://assets/i18n/localization.csv"
dest_files=["res://assets/i18n/localization.description.translation", "res://assets/i18n/localization.en.translation", "res://assets/i18n/localization.zh.translation", "res://assets/i18n/localization.fr.translation"]
dest_files=["res://assets/i18n/localization.description.translation", "res://assets/i18n/localization.en.translation", "res://assets/i18n/localization.zh.translation", "res://assets/i18n/localization.fr.translation", "res://assets/i18n/localization.pt.translation"]

[params]

Expand Down
Binary file modified assets/i18n/localization.description.translation
Binary file not shown.
Binary file modified assets/i18n/localization.en.translation
Binary file not shown.
Binary file modified assets/i18n/localization.fr.translation
Binary file not shown.
Binary file added assets/i18n/localization.pt.translation
Binary file not shown.
Binary file modified assets/i18n/localization.zh.translation
Binary file not shown.
8 changes: 5 additions & 3 deletions global/autoload/locale/locale.gd
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#gdlint:ignore = max-public-methods
extends Node

const LOCALES: Array[String] = ["en", "fr", "zh"]
const LOCALE_NAME: Dictionary = {"en": "English", "fr": "Français", "zh": "中文"}
const LOCALES: Array[String] = ["en", "fr", "pt", "zh"]
const LOCALE_NAME: Dictionary = {
"en": "English", "fr": "Français", "pt": "Português (BR)", "zh": "中文"
}


func _ready() -> void:
Expand Down Expand Up @@ -32,7 +34,7 @@ func get_localized_array(category: String, id: String) -> Array:
if result == Error.OK:
var result_data: Variant = json.data
return result_data
push_warning("Failed to fetch localized array for: %s" % [key])
push_warning("Failed to fetch localized array for '%s' as: " % [key], raw_string)
return []


Expand Down
7 changes: 7 additions & 0 deletions global/autoload/save_file/save_file.gd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var npc_events: Dictionary = {}
var enemy: Dictionary = {"level": "rabbit", "rabbit": {"damage": 0}}
var metadata: Dictionary = {}
var locale: String = "en"
var _last_locale: String = "en"

@onready var autosave_timer: Timer = %AutosaveTimer

Expand All @@ -54,6 +55,7 @@ func _ready() -> void:

locale = get_locale_from_newest_save_file()
TranslationServer.set_locale(locale)
_last_locale = locale

if Game.PARAMS["debug_logs"]:
print("_AUTOLOAD _READY: " + self.get_name())
Expand Down Expand Up @@ -427,6 +429,11 @@ func initialize(save_file_name: String, metadata_name: String) -> void:
_import_save_data(save_data)
metadata["save_file_name"] = metadata_name

if _last_locale != locale:
TranslationServer.set_locale(_last_locale)
SaveFile.locale = _last_locale
SignalBus.display_language_updated.emit()


func post_initialize() -> void:
prestige_dialog = false
Expand Down
4 changes: 2 additions & 2 deletions global/const/game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const WORKER_RESOURCE_ID: String = "worker"
const WORKER_ROLE_RESOURCE: Array[String] = [WORKER_RESOURCE_ID, "swordsman"]

const VERSION_MAJOR: String = "prototype"
const VERSION_MINOR: String = "release 1.1"
const VERSION_MINOR: String = "release 1.2"

const PARAMS: Dictionary = PARAMS_DEBUG #PARAMS_PROD #PARAMS_DEBUG
const PARAMS: Dictionary = PARAMS_PROD #PARAMS_PROD #PARAMS_DEBUG

const SKIP_BOSS: bool = false

Expand Down
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ master_music_toggle={

[internationalization]

locale/translations=PackedStringArray("res://assets/i18n/localization.en.translation", "res://assets/i18n/localization.zh.translation", "res://assets/i18n/localization.fr.translation")
locale/translations=PackedStringArray("res://assets/i18n/localization.en.translation", "res://assets/i18n/localization.zh.translation", "res://assets/i18n/localization.fr.translation", "res://assets/i18n/localization.pt.translation")

[rendering]

Expand Down
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Inspired by A Dark Room, the Dark Forest is an incremental experimental minimalistic game project.

THE GAME: (current version is `prototype.release.1.1`)
THE GAME: (current version is `prototype.release.1.2`)
- PLAY ON Itch https://tinytakinteller.itch.io/the-best-game-ever
- DEVLOGS ON Itch https://tinytakinteller.itch.io/the-best-game-ever/devlog

Expand All @@ -18,6 +18,8 @@ CONTRIBUTE:
- 09/09/2024 [`prototype.week.20`] **Discontinuing weekly updates going forward.** ⚰️
- 07/10/2024 [`prototype.release.1.0`] **Added final boss fight, a short minigame ending.**
- 05/01/2025 [`prototype.release.1.1`] **Localization Update for French and Chinese (SC).** 🌎
- 08/01/2025 [`prototype.release.1.2`] **Localization Update for Portuguese (Brazilian).** 🌎



## Overview
Expand Down
1 change: 1 addition & 0 deletions scenes/autostart/main/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ layout_mode = 2

[node name="ResourceTracker" parent="CanvasLayer/MainControl/MainUI/MarginContainer/ScrollContainer/VBoxContainer/BodyMarginContainer/HBoxContainer" instance=ExtResource("5_y2bgo")]
unique_name_in_owner = true
custom_minimum_size = Vector2(175, 0)
layout_mode = 2
size_flags_horizontal = 8
theme_override_constants/margin_right = 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ func _on_display_language_updated() -> void:
event_label.autowrap_mode = TextServer.AutowrapMode.AUTOWRAP_WORD
"fr":
event_label.autowrap_mode = TextServer.AutowrapMode.AUTOWRAP_WORD
"pt":
event_label.autowrap_mode = TextServer.AutowrapMode.AUTOWRAP_WORD
"zh":
event_label.autowrap_mode = TextServer.AutowrapMode.AUTOWRAP_ARBITRARY
_:
Expand Down
1 change: 1 addition & 0 deletions scenes/ui/resource_tracker/resource_tracker.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

[node name="ResourceTracker" type="MarginContainer"]
z_as_relative = false
custom_minimum_size = Vector2(100, 0)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ layout_mode = 2

[node name="TitleLabel" parent="HBoxContainer/TitleMarginContainer" instance=ExtResource("2_vnjch")]
unique_name_in_owner = true
custom_minimum_size = Vector2(110, 0)
custom_minimum_size = Vector2(120, 0)
layout_mode = 2
size_flags_horizontal = 4
text = "Audio"
Expand Down Expand Up @@ -55,7 +55,7 @@ layout_mode = 2
text = "-"

[node name="SliderMarginContainer" type="MarginContainer" parent="HBoxContainer"]
custom_minimum_size = Vector2(200, 0)
custom_minimum_size = Vector2(180, 0)
layout_mode = 2

[node name="HSlider" type="HSlider" parent="HBoxContainer/SliderMarginContainer"]
Expand Down
6 changes: 5 additions & 1 deletion scenes/ui/screen/world_screen/npc_dialog/npc_dialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ func _ready() -> void:


func is_event_active() -> bool:
return StringUtils.is_not_empty(_target_id) and StringUtils.is_not_empty(_next_text)
return (
StringUtils.is_not_empty(_target_id)
and StringUtils.is_not_empty(_next_text)
and len(_next_text) > 1
)


func peek(peek_state: int) -> void:
Expand Down
3 changes: 3 additions & 0 deletions scenes/ui/screen/world_screen/world_screen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ func _on_display_language_updated() -> void:
"fr":
_set_padding_margin_left(0)
all_button.reparent(grid_container_2)
"pt":
_set_padding_margin_left(0)
all_button.reparent(grid_container_2)
"zh":
_set_padding_margin_left(32)
all_button.reparent(all_button_margin_container)
Expand Down

0 comments on commit d95d592

Please sign in to comment.