diff options
author | Hop311 <Hop3114@gmail.com> | 2023-09-23 22:53:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 22:53:40 +0200 |
commit | 0b4c30aa02c3ec1dacfc3ac190af4733531753ea (patch) | |
tree | 41aacf220a1f7085c81f2b0f522ad9f36991947b /extension/src/openvic-extension/LoadLocalisation.hpp | |
parent | d56941e60016bf73587c63a36ac5ca9da3f6023e (diff) | |
parent | 6e2ba19d77c36ddc4767a20de040489b574ae0c3 (diff) |
Merge pull request #157 from OpenVicProject/more-dataloading
More dataloading
Diffstat (limited to 'extension/src/openvic-extension/LoadLocalisation.hpp')
-rw-r--r-- | extension/src/openvic-extension/LoadLocalisation.hpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/extension/src/openvic-extension/LoadLocalisation.hpp b/extension/src/openvic-extension/LoadLocalisation.hpp index 04ec5c7..4f09ef3 100644 --- a/extension/src/openvic-extension/LoadLocalisation.hpp +++ b/extension/src/openvic-extension/LoadLocalisation.hpp @@ -2,6 +2,8 @@ #include <godot_cpp/classes/translation.hpp> +#include <openvic-simulation/dataloader/Dataloader.hpp> + namespace OpenVic { class LoadLocalisation : public godot::Object { @@ -9,8 +11,8 @@ namespace OpenVic { 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); + godot::Error _load_file_into_translation(godot::String const& file_path, godot::Ref<godot::Translation> translation) const; + godot::Ref<godot::Translation> _get_translation(godot::String const& locale) const; protected: static void _bind_methods(); @@ -21,8 +23,10 @@ namespace OpenVic { 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); + godot::Error load_file(godot::String const& file_path, godot::String const& locale) const; + godot::Error load_locale_dir(godot::String const& dir_path, godot::String const& locale) const; + godot::Error load_localisation_dir(godot::String const& dir_path) const; + + static bool add_message(std::string_view key, Dataloader::locale_t locale, std::string_view localisation); }; } |