Path: blob/master/editor/translations/localization_editor.h
9896 views
/**************************************************************************/1/* localization_editor.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "editor/translations/editor_locale_dialog.h"33#include "scene/gui/check_box.h"34#include "scene/gui/tree.h"3536class EditorFileDialog;37class FileSystemDock;3839class LocalizationEditor : public VBoxContainer {40GDCLASS(LocalizationEditor, VBoxContainer);4142Tree *translation_list = nullptr;4344EditorLocaleDialog *locale_select = nullptr;45EditorFileDialog *translation_file_open = nullptr;4647Button *translation_res_option_add_button = nullptr;48EditorFileDialog *translation_res_file_open_dialog = nullptr;49EditorFileDialog *translation_res_option_file_open_dialog = nullptr;50Tree *translation_remap = nullptr;51Tree *translation_remap_options = nullptr;5253Tree *translation_pot_list = nullptr;54CheckBox *translation_pot_add_builtin = nullptr;55EditorFileDialog *pot_file_open_dialog = nullptr;56EditorFileDialog *pot_generate_dialog = nullptr;57Button *pot_generate_button = nullptr;5859bool updating_translations = false;60String localization_changed;6162void _translation_file_open();63void _translation_add(const PackedStringArray &p_paths);64void _translation_delete(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button);6566void _translation_res_file_open();67void _translation_res_add(const PackedStringArray &p_paths);68void _translation_res_delete(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button);69void _translation_res_select();70void _translation_res_option_file_open();71void _translation_res_option_add(const PackedStringArray &p_paths);72void _translation_res_option_changed();73void _translation_res_option_delete(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button);74void _translation_res_option_popup(bool p_arrow_clicked);75void _translation_res_option_selected(const String &p_locale);7677void _pot_add(const PackedStringArray &p_paths);78void _pot_delete(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button);79void _pot_file_open();80void _pot_generate_open();81void _pot_add_builtin_toggled();82void _pot_generate(const String &p_file);83void _update_pot_file_extensions();8485void _filesystem_files_moved(const String &p_old_file, const String &p_new_file);86void _filesystem_file_removed(const String &p_file);8788protected:89void _notification(int p_what);90static void _bind_methods();9192public:93void add_translation(const String &p_translation);94void update_translations();95void connect_filesystem_dock_signals(FileSystemDock *p_fs_dock);9697LocalizationEditor();98};99100101