diff options
author | Hop311 <Hop3114@gmail.com> | 2023-09-14 21:17:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 21:17:04 +0200 |
commit | 9de41a0ed5f050f205219ab2a9f114800d048c14 (patch) | |
tree | 559681d5a2569adc307409d818311760edc12654 /extension/src/openvic-extension/LoadLocalisation.hpp | |
parent | 1013b3c21226f703caba954664628694aedde469 (diff) | |
parent | 70c040d042cb536e5ce16b0cfff0e0afa39e8ed7 (diff) |
Merge pull request #151 from OpenVicProject/dataloading
Build system cleanup + dataloading scaffolding + JSON dataloading removed
Diffstat (limited to 'extension/src/openvic-extension/LoadLocalisation.hpp')
-rw-r--r-- | extension/src/openvic-extension/LoadLocalisation.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/LoadLocalisation.hpp b/extension/src/openvic-extension/LoadLocalisation.hpp new file mode 100644 index 0000000..04ec5c7 --- /dev/null +++ b/extension/src/openvic-extension/LoadLocalisation.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include <godot_cpp/classes/translation.hpp> + +namespace OpenVic { + class LoadLocalisation : public godot::Object { + + GDCLASS(LoadLocalisation, godot::Object) + + static LoadLocalisation* singleton; + + godot::Error _load_file_into_translation(godot::String const& file_path, godot::Ref<godot::Translation> translation); + godot::Ref<godot::Translation> _get_translation(godot::String const& locale); + + protected: + static void _bind_methods(); + + public: + static LoadLocalisation* get_singleton(); + + LoadLocalisation(); + ~LoadLocalisation(); + + godot::Error load_file(godot::String const& file_path, godot::String const& locale); + godot::Error load_locale_dir(godot::String const& dir_path, godot::String const& locale); + godot::Error load_localisation_dir(godot::String const& dir_path); + }; +} |