Skip to content

Commit 9c3720d

Browse files
committed
Support internationalization of labels
1 parent d6b4c95 commit 9c3720d

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

TextEditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4757,7 +4757,7 @@ bool TextEditor::Autocomplete::render(Document& document, Cursors& cursors, cons
47574757
}
47584758

47594759
} else {
4760-
ImGui::TextUnformatted("No suggestions");
4760+
ImGui::TextUnformatted(configuration.noSuggestionsLabel.c_str());
47614761
}
47624762
}
47634763

TextEditor.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ class TextEditor {
500500
// delay in milliseconds between autocomplete trigger and suggestions popup
501501
std::chrono::milliseconds triggerDelay{200};
502502

503+
// text label used when no suggestions are available (this allows for internationalization)
504+
std::string noSuggestionsLabel = "No suggestions";
505+
503506
// called when autocomplete is configured, active and the editor needs an updated suggestions list
504507
// callback must populate and order suggestions in state object
505508
// suggestion list is not cleared by editor between callbacks

docs/autocomplete.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public:
5353
// delay in milliseconds between autocomplete trigger and suggestions popup
5454
std::chrono::milliseconds triggerDelay{200};
5555

56+
// text label used when no suggestions are available (this allows for internationalization)
57+
std::string noSuggestionsLabel = "No suggestions";
58+
5659
// called when autocomplete is configured, active and the editor needs an updated suggestions list
5760
// callback must populate and order suggestions in state object
5861
// suggestion list is not cleared by editor between callbacks

0 commit comments

Comments
 (0)