[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-115.7.0esr-13.0-1] 2 commits: Bug 1875306 - Localize numbers in the underflow and overflow error messages. r=emilio



Title: GitLab

richard pushed to branch tor-browser-115.7.0esr-13.0-1 at The Tor Project / Applications / Tor Browser

Commits:

  • e42f5004
    by Pier Angelo Vendrame at 2024-02-07T12:18:39+00:00
    Bug 1875306 - Localize numbers in the underflow and overflow error messages. r=emilio
    
    Differential Revision: https://phabricator.services.mozilla.com/D198965
  • 9af28502
    by Pier Angelo Vendrame at 2024-02-07T12:18:39+00:00
    Bug 1875313 - Use en-US as a fallback when spoof English is enabled in ICUUtils. r=timhuang,tjr
    
    Differential Revision: https://phabricator.services.mozilla.com/D198967
    

2 changed files:

Changes:

  • dom/html/input/NumericInputTypes.cpp
    ... ... @@ -52,11 +52,7 @@ nsresult NumericInputTypeBase::GetRangeOverflowMessage(nsAString& aMessage) {
    52 52
       MOZ_ASSERT(!maximum.isNaN());
    
    53 53
     
    
    54 54
       nsAutoString maxStr;
    
    55
    -  char buf[32];
    
    56
    -  DebugOnly<bool> ok = maximum.toString(buf, ArrayLength(buf));
    
    57
    -  maxStr.AssignASCII(buf);
    
    58
    -  MOZ_ASSERT(ok, "buf not big enough");
    
    59
    -
    
    55
    +  ConvertNumberToString(maximum, maxStr);
    
    60 56
       return nsContentUtils::FormatMaybeLocalizedString(
    
    61 57
           aMessage, nsContentUtils::eDOM_PROPERTIES,
    
    62 58
           "FormValidationNumberRangeOverflow", mInputElement->OwnerDoc(), maxStr);
    
    ... ... @@ -67,11 +63,7 @@ nsresult NumericInputTypeBase::GetRangeUnderflowMessage(nsAString& aMessage) {
    67 63
       MOZ_ASSERT(!minimum.isNaN());
    
    68 64
     
    
    69 65
       nsAutoString minStr;
    
    70
    -  char buf[32];
    
    71
    -  DebugOnly<bool> ok = minimum.toString(buf, ArrayLength(buf));
    
    72
    -  minStr.AssignASCII(buf);
    
    73
    -  MOZ_ASSERT(ok, "buf not big enough");
    
    74
    -
    
    66
    +  ConvertNumberToString(minimum, minStr);
    
    75 67
       return nsContentUtils::FormatMaybeLocalizedString(
    
    76 68
           aMessage, nsContentUtils::eDOM_PROPERTIES,
    
    77 69
           "FormValidationNumberRangeUnderflow", mInputElement->OwnerDoc(), minStr);
    

  • intl/unicharutil/util/ICUUtils.cpp
    ... ... @@ -47,8 +47,13 @@ void ICUUtils::LanguageTagIterForContent::GetNext(nsACString& aBCP47LangTag) {
    47 47
     
    
    48 48
       if (mCurrentFallbackIndex < 2) {
    
    49 49
         mCurrentFallbackIndex = 2;
    
    50
    -    // Else take the app's locale:
    
    51
    -
    
    50
    +    // Else take the app's locale (or en-US, if spoof English applies):
    
    51
    +    const bool spoofLocale = nsContentUtils::SpoofLocaleEnglish() &&
    
    52
    +                             !mContent->OwnerDoc()->AllowsL10n();
    
    53
    +    if (spoofLocale) {
    
    54
    +      aBCP47LangTag.AssignLiteral("en-US");
    
    55
    +      return;
    
    56
    +    }
    
    52 57
         nsAutoCString appLocale;
    
    53 58
         LocaleService::GetInstance()->GetAppLocaleAsBCP47(aBCP47LangTag);
    
    54 59
         return;
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits