mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #112092 from timothyqiu/ts-nums
Move localized number formatting methods to `TranslationServer`
This commit is contained in:
commit
8327dfa215
27 changed files with 348 additions and 394 deletions
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/input/input_map.h"
|
||||
#include "core/string/translation_server.h"
|
||||
#include "editor/docks/inspector_dock.h"
|
||||
#include "editor/docks/scene_tree_dock.h"
|
||||
#include "editor/editor_node.h"
|
||||
|
|
@ -1749,7 +1750,9 @@ void EditorPropertyEasing::_draw_easing() {
|
|||
} else {
|
||||
decimals = 1;
|
||||
}
|
||||
f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), TS->format_number(rtos(exp).pad_decimals(decimals)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color);
|
||||
|
||||
const String &formatted = TranslationServer::get_singleton()->format_number(rtos(exp).pad_decimals(decimals), _get_locale());
|
||||
f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), formatted, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color);
|
||||
}
|
||||
|
||||
void EditorPropertyEasing::update_property() {
|
||||
|
|
@ -1767,7 +1770,7 @@ void EditorPropertyEasing::_set_preset(int p_preset) {
|
|||
|
||||
void EditorPropertyEasing::_setup_spin() {
|
||||
spin->setup_and_show();
|
||||
spin->get_line_edit()->set_text(TS->format_number(rtos(get_edited_property_value())));
|
||||
spin->get_line_edit()->set_text(TranslationServer::get_singleton()->format_number(rtos(get_edited_property_value()), _get_locale()));
|
||||
spin->show();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue