Ticket #11824: filezilla_thousand_sep.patch

File filezilla_thousand_sep.patch, 989 bytes (added by iqiqiq, 5 years ago)
  • src/engine/sizeformatting_base.cpp

     
    33#include "optionsbase.h"
    44#ifndef FZ_WINDOWS
    55#include <langinfo.h>
     6#include <locale.h>
    67#endif
    78
    89#include <libfilezilla/format.hpp>
     
    240241}
    241242
    242243namespace {
     244
     245static void fz__locale_setuilang() {
     246    static int flag_fz__locale_setuilang = -1;
     247    if (flag_fz__locale_setuilang == -1) {
     248        setlocale(LC_NUMERIC, getenv("LANG"));
     249        flag_fz__locale_setuilang = 0;
     250    }
     251}
     252
    243253std::wstring DoGetThousandsSeparator()
    244254{
    245255    std::wstring sep;
     
    250260        sep = tmp;
    251261    }
    252262#else
     263    fz__locale_setuilang();
    253264    char* chr = nl_langinfo(THOUSEP);
    254265    if (chr && *chr) {
    255266        sep = fz::to_wstring(chr);
     
    275286        sep = tmp;
    276287    }
    277288#else
     289    fz__locale_setuilang();
    278290    char* chr = nl_langinfo(RADIXCHAR);
    279291    if (!chr || !*chr) {
    280292        sep = L".";