Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
TranslationServer: Add fast path for comparison of equal locales
  • Loading branch information
RandomShaper committed Sep 2, 2024
commit cfb7443e263b702e880dbe953c09760d6f29033b
5 changes: 5 additions & 0 deletions core/string/translation_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ String TranslationServer::_standardize_locale(const String &p_locale, bool p_add
}

int TranslationServer::compare_locales(const String &p_locale_a, const String &p_locale_b) const {
if (p_locale_a == p_locale_b) {
// Exact match.
return 10;
}

String locale_a = _standardize_locale(p_locale_a, true);
String locale_b = _standardize_locale(p_locale_b, true);

Expand Down