Improve POT Generation dialog
* Avoid "property not found" warnings when adding a file for the first time. * When no file is added, disable the Generate POT button instead of printing a warning.
This commit is contained in:
@ -55,7 +55,9 @@ void POTGenerator::_print_all_translation_strings() {
|
||||
#endif
|
||||
|
||||
void POTGenerator::generate_pot(const String &p_file) {
|
||||
if (!ProjectSettings::get_singleton()->has_setting("internationalization/locale/translations_pot_files")) {
|
||||
Vector<String> files = GLOBAL_GET("internationalization/locale/translations_pot_files");
|
||||
|
||||
if (files.is_empty()) {
|
||||
WARN_PRINT("No files selected for POT generation.");
|
||||
return;
|
||||
}
|
||||
@ -63,8 +65,6 @@ void POTGenerator::generate_pot(const String &p_file) {
|
||||
// Clear all_translation_strings of the previous round.
|
||||
all_translation_strings.clear();
|
||||
|
||||
Vector<String> files = GLOBAL_GET("internationalization/locale/translations_pot_files");
|
||||
|
||||
// Collect all translatable strings according to files order in "POT Generation" setting.
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
Vector<String> msgids;
|
||||
|
||||
Reference in New Issue
Block a user