diff options
author | Hop311 <Hop3114@gmail.com> | 2023-03-30 15:04:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-30 15:04:58 +0200 |
commit | 3384b21177a160f7192a2e4877eea3b29880bf4e (patch) | |
tree | db9c9a37a187e15ef494a700f8afe5d65c3a8b78 /extension/src/LoadLocalisation.hpp | |
parent | 8f213935bdea2400b6809f9d5db45dde3416dedc (diff) |
Added Localisation (#77)
* Added Localisation
* Removed `.gdignore`s.
* Localisation dir path and Locale name cleanup
* Incomplete entry warnings + README
Diffstat (limited to 'extension/src/LoadLocalisation.hpp')
-rw-r--r-- | extension/src/LoadLocalisation.hpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/extension/src/LoadLocalisation.hpp b/extension/src/LoadLocalisation.hpp new file mode 100644 index 0000000..90f3158 --- /dev/null +++ b/extension/src/LoadLocalisation.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include <godot_cpp/core/class_db.hpp> +#include <godot_cpp/classes/translation.hpp> + +namespace OpenVic2 { + 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); + }; +} |