diff --git a/bin/python/po_translate.py b/bin/python/po_translate.py index 964dd8664..3adcc490c 100644 --- a/bin/python/po_translate.py +++ b/bin/python/po_translate.py @@ -253,10 +253,7 @@ def translate_with_google(self, english): if self.have_seen.get(english, None): return self.have_seen[english] - if len(english) < 4: - return english - - if self.is_number(english): + if len(english) < 4 and not self.is_number(english): return english if not self.use_google: @@ -281,10 +278,7 @@ def _translate_text(self, english): if english in DONT_TRANSLATE: return english - if len(english) < 4: - return english - - if self.is_number(english): + if len(english) < 4 and not self.is_number(english): return english translated_text = self.have_seen.get(english, None) @@ -345,8 +339,7 @@ def translate_text(self, english): translated_text = self._translate_text(english) if 'QUERY LENGTH' in translated_text: - print('\t********FAILED********') - return english + return '********FAILED********' translated_text = translated_text.replace('Mrv2', 'mrv2') print(f"\tTranslated: {translated_text}") return translated_text diff --git a/src/docs/HISTORY.md b/src/docs/HISTORY.md index 088ca2222..dd9b69bf5 100644 --- a/src/docs/HISTORY.md +++ b/src/docs/HISTORY.md @@ -9,6 +9,10 @@ v1.2.7 was previously open. - Fixed HDR->Auto Normalize with OpenEXR files that had a smaller display window. +- Fixed FPS display not respecting the decimal separator on numeric locales + that use commas. +- Fixed numeric locale for Hindi. +- Fixed numeric locale for all languages. v1.2.6 diff --git a/src/lib/mrvFl/mrvLanguages.cpp b/src/lib/mrvFl/mrvLanguages.cpp index e433247cb..61642ce93 100644 --- a/src/lib/mrvFl/mrvLanguages.cpp +++ b/src/lib/mrvFl/mrvLanguages.cpp @@ -259,11 +259,7 @@ namespace mrv initLocale(language); - const char* numericLocale = setlocale(LC_ALL, NULL); - -#if defined __APPLE__ && defined __MACH__ - numericLocale = setlocale(LC_MESSAGES, NULL); -#endif + const char* numericLocale = language; if (language) { // This is for Apple mainly, as it we just set LC_MESSAGES only @@ -271,6 +267,7 @@ namespace mrv // those locales that use periods in their floating point. if (strcmp(language, "C") == 0 || strncmp(language, "ar", 2) == 0 || strncmp(language, "en", 2) == 0 || + strncmp(language, "hi", 2) == 0 || strncmp(language, "ja", 2) == 0 || strncmp(language, "ko", 2) == 0 || strncmp(language, "zh", 2) == 0) diff --git a/src/lib/mrvWidgets/mrvFPSInput.cpp b/src/lib/mrvWidgets/mrvFPSInput.cpp index 05c8c505c..aeb1e3c8e 100644 --- a/src/lib/mrvWidgets/mrvFPSInput.cpp +++ b/src/lib/mrvWidgets/mrvFPSInput.cpp @@ -8,28 +8,34 @@ #include -namespace mrv +namespace { - namespace decimal + double floorToOnePlace(double number) { - double floorToOnePlace(double number) - { - // Multiply by 10, floor to the nearest integer, - // and then divide by 10 - return std::floor(number * 10.0) / 10.0; - } - } // namespace decimal + // Multiply by 10, floor to the nearest integer, + // and then divide by 10 + return std::floor(number * 10.0) / 10.0; + } +} + +namespace mrv +{ int FPSInput::format(char* buffer) { - std::stringstream ss; + char temp[64]; + int length; + double number = value(); - double rounded = decimal::floorToOnePlace(number); - if (w() < 52) - ss << rounded; - else - ss << number; - return snprintf(buffer, 128, "%s", ss.str().c_str()); + + if (w() < 52.0) { + length = sprintf(temp, "%.1f", floorToOnePlace(number)); + } else { + length = sprintf(temp, "%.3f", number); + } + + strcpy(buffer, temp); + return length; } void FPSInput::resize(int X, int Y, int W, int H) diff --git a/src/po/de.po b/src/po/de.po index 62339ebe9..b36577f05 100644 --- a/src/po/de.po +++ b/src/po/de.po @@ -5051,7 +5051,7 @@ msgid "60" msgstr "60" msgid "59.952" -msgstr "59.952" +msgstr "59,952" msgid "50" msgstr "50" @@ -5060,13 +5060,13 @@ msgid "48" msgstr "48" msgid "47.952" -msgstr "47.952" +msgstr "47,952" msgid "30" msgstr "30" msgid "29.976" -msgstr "29.976" +msgstr "29,976" msgid "25" msgstr "25" @@ -5075,22 +5075,22 @@ msgid "24" msgstr "24" msgid "23.976" -msgstr "23.976" +msgstr "23,976" msgid "15" msgstr "15" msgid "14.988" -msgstr "14.988" +msgstr "14,988" msgid "12.5" -msgstr "12.5" +msgstr "12,5" msgid "12" msgstr "12" msgid "11.988" -msgstr "11.988" +msgstr "11,988" msgid "F:" msgstr "F:" @@ -5349,7 +5349,7 @@ msgid "B44A" msgstr "B44A" msgid "DWAA" -msgstr "L 347 vom 20.12.2013, S. 671." +msgstr "DWAA" msgid "DWAB" msgstr "DWAB" @@ -5499,13 +5499,13 @@ msgid "Large" msgstr "Gro" msgid "59.94" -msgstr "59.94" +msgstr "59.94............................................................................................................................................................................................................................................................." msgid "29.97" -msgstr "29.97" +msgstr "29.97.............................................................................................................................................................................................................................................................." msgid "14.985" -msgstr "14.985" +msgstr "14,985" msgid "Loop" msgstr "Schleife" diff --git a/src/po/fr.po b/src/po/fr.po index 140d0547f..58d3ebf20 100644 --- a/src/po/fr.po +++ b/src/po/fr.po @@ -5045,7 +5045,7 @@ msgid "60" msgstr "60" msgid "59.952" -msgstr "59.952" +msgstr "59,952" msgid "50" msgstr "50" @@ -5054,13 +5054,13 @@ msgid "48" msgstr "48" msgid "47.952" -msgstr "47.952" +msgstr "47,952" msgid "30" msgstr "30" msgid "29.976" -msgstr "29.976" +msgstr "29,976" msgid "25" msgstr "25" @@ -5069,22 +5069,22 @@ msgid "24" msgstr "24" msgid "23.976" -msgstr "23.976" +msgstr "23,976" msgid "15" msgstr "15" msgid "14.988" -msgstr "14.988" +msgstr "14,988" msgid "12.5" -msgstr "12.5" +msgstr "12,5" msgid "12" msgstr "12" msgid "11.988" -msgstr "11.988" +msgstr "11,988" msgid "F:" msgstr "F:" diff --git a/src/po/it.po b/src/po/it.po index d8b856c78..64af2fefa 100644 --- a/src/po/it.po +++ b/src/po/it.po @@ -5054,7 +5054,7 @@ msgid "60" msgstr "60" msgid "59.952" -msgstr "59.952" +msgstr "59,952" msgid "50" msgstr "50" @@ -5063,13 +5063,13 @@ msgid "48" msgstr "48" msgid "47.952" -msgstr "47.952" +msgstr "47,952" msgid "30" msgstr "30" msgid "29.976" -msgstr "29.976" +msgstr "29,976" msgid "25" msgstr "25" @@ -5078,22 +5078,22 @@ msgid "24" msgstr "24" msgid "23.976" -msgstr "23.976" +msgstr "23,976" msgid "15" msgstr "15" msgid "14.988" -msgstr "14.988" +msgstr "14,988" msgid "12.5" -msgstr "12.5" +msgstr "12,5" msgid "12" msgstr "12" msgid "11.988" -msgstr "11.988" +msgstr "11,988" msgid "F:" msgstr "F:" diff --git a/src/po/pt.po b/src/po/pt.po index 0698864cb..1ba4177e6 100644 --- a/src/po/pt.po +++ b/src/po/pt.po @@ -5020,7 +5020,7 @@ msgid "60" msgstr "60" msgid "59.952" -msgstr "59.952" +msgstr "59,952" msgid "50" msgstr "50" @@ -5029,13 +5029,13 @@ msgid "48" msgstr "48" msgid "47.952" -msgstr "47.952" +msgstr "47,952" msgid "30" msgstr "30" msgid "29.976" -msgstr "29.976" +msgstr "29,976" msgid "25" msgstr "25" @@ -5044,22 +5044,22 @@ msgid "24" msgstr "24" msgid "23.976" -msgstr "23.976" +msgstr "23,976" msgid "15" msgstr "15" msgid "14.988" -msgstr "14.988" +msgstr "14,988" msgid "12.5" -msgstr "12.5" +msgstr "12,5" msgid "12" msgstr "12" msgid "11.988" -msgstr "11.988" +msgstr "11,988" msgid "F:" msgstr "F:"