Граф коммитов

1383 Коммитов

Автор SHA1 Сообщение Дата
Ed Lee 96460bcff8 Bug 1784901 - Show Language Mismatch Screen with negotiated language on left secondary section and switch button r=pdahiya
As part of installing the lang pack, add the negotiated language as string args and convert to raw if it wants to use the lang pack.

Differential Revision: https://phabricator.services.mozilla.com/D155021
2022-08-19 22:07:10 +00:00
Mark Banner 53b35796e0 Bug 1784699 - Add more ESLint worker annotations to test files. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D154601
2022-08-15 16:50:31 +00:00
André Bargull 8c3a6dad95 Bug 1784375: Call LocaleParser::TryParse() with a new, empty Locale. r=platform-i18n-reviewers,dminor
For this to work, we need to add a move-constructor to `Locale`, so that it's
possible to write `loc = {}`. (We need move instead of copy semantics, because
`Locale` has UniquePtr members.) All other `Locale` members except for
`LanguageTagSubtag` already support move semantics. Add copy-constructors to
`LanguageTagSubtag`, so defaulted move-constructor/assignment works for `Locale`.
`LanguageTagSubtag` gets copy- instead of move-constructors, because there isn't
a good reason to disallow copying when moving is allowed.

Also add extra assertions and comments to document the requirement that `TryParse`
expects a new, empty `Locale`.

Differential Revision: https://phabricator.services.mozilla.com/D154496
2022-08-15 15:37:20 +00:00
Nika Layzell c15823d075 Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-07-30 00:12:48 +00:00
Nika Layzell 997047e2a4 Bug 1772006 - Part 4: Simplify and move the string comparison APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,dragana,barret
This patch moves EqualsIgnoreCase to ns[T]StringObsolete, and removes
the aCount argument, instead migrating callers to use `StringBeginsWith`
with a case-insensitive comparator.

In addition, nsTStringRepr::Compare was removed and replaced with either
calls to methods like `StringBeginsWith` or the global `Compare` method.

These changes required some modifications at call-sites but should make
the behaviour less surprising and more consistent.

Differential Revision: https://phabricator.services.mozilla.com/D148299
2022-07-30 00:12:48 +00:00
Dan Minor 043ae52e12 Bug 1779621 - Migrate intl/locale from jsm to esm; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D151865
2022-07-26 12:28:41 +00:00
Tooru Fujisawa 54623364da Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-12 04:21:34 +00:00
Andreea Pavel 7738a75fdd Backed out 11 changesets (Bug 1777486) for failing bc at browser_startup.js on a CLOSED TREE
Backed out changeset b6c4c386f1a6 (Bug 1777486)
Backed out changeset 195cc2de8433 (Bug 1777486)
Backed out changeset 20c746fb1648 (Bug 1777486)
Backed out changeset d5fd8173d62d (Bug 1777486)
Backed out changeset 6d758fab5a3e (Bug 1777486)
Backed out changeset e938b601ba15 (Bug 1777486)
Backed out changeset 0c4ea0b9416b (Bug 1777486)
Backed out changeset 0559c53cc668 (Bug 1777486)
Backed out changeset eea573d3a9f9 (Bug 1777486)
Backed out changeset 9ce3a6496a49 (bug 1777486)
Backed out changeset b0867652fc48 (bug 1777486)
2022-07-11 22:24:40 +03:00
Tooru Fujisawa 8cd6ed7409 Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-11 15:09:13 +00:00
Tooru Fujisawa bf93d07148 Bug 1667455 - Part 5: Stop importing Services.jsm from chrome-priv JS code, top-level single-line cases. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,pip-reviewers,twisniewski,m_kato,jdescottes,mconley,AlexandruIonescu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D150894
2022-07-11 12:41:50 +00:00
Tooru Fujisawa f3a8c52c53 Bug 1667455 - Part 4: Stop importing Services.jsm from JSM. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,application-update-reviewers,pip-reviewers,twisniewski,devtools-reviewers,m_kato,jdescottes,ochameau,mconley,sfoster,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D150893
2022-07-11 12:41:50 +00:00
Narcis Beleuzu 2838b177f3 Backed out changeset 94420b6eff4c (bug 1297520) for xpcshell failures on test_snap.js 2022-07-06 19:16:34 +03:00
Mike Kaply 288d325a1c Bug 1297520 - For Snap, only install language for system locale. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D151052
2022-07-06 13:34:18 +00:00
criss c6b2c5db61 Backed out 9 changesets (bug 1772006) causing build bustages on nsTString.cpp. CLOSED TREE
Backed out changeset f17c7565707b (bug 1772006)
Backed out changeset c725fe1f5882 (bug 1772006)
Backed out changeset d19663161261 (bug 1772006)
Backed out changeset b6611ab002d9 (bug 1772006)
Backed out changeset 790f42b64af9 (bug 1772006)
Backed out changeset 79a734b4e4d9 (bug 1772006)
Backed out changeset 42730aae16ea (bug 1772006)
Backed out changeset b2542aef3054 (bug 1772006)
Backed out changeset 962bfea4a309 (bug 1772006)
2022-06-11 01:13:42 +03:00
Nika Layzell b3c13bf114 Bug 1772006 - Part 6: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-06-10 21:12:08 +00:00
Tooru Fujisawa 0acf5d541a Bug 1772313 - Part 10: Stop calling XPCOMUtils.defineLazyModuleGetters for Services in intl/. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D148163
2022-06-06 04:42:08 +00:00
Molnar Sandor 77402a5caa Backed out 15 changesets (bug 1772313, bug 1772351, bug 1772360) for causing xpc failures in telemetry/tests/unit/test_SocketScalars.js CLOSED TREE
Backed out changeset c8b0a2ed239e (bug 1772360)
Backed out changeset 1922adad6abe (bug 1772351)
Backed out changeset 6d3634cce489 (bug 1772351)
Backed out changeset f03968a9d053 (bug 1772351)
Backed out changeset e7a38ef90fe4 (bug 1772351)
Backed out changeset b389e7654771 (bug 1772313)
Backed out changeset 59a33598ff51 (bug 1772313)
Backed out changeset ab60885a8a93 (bug 1772313)
Backed out changeset aad8efac9d05 (bug 1772313)
Backed out changeset 4378e519a8e7 (bug 1772313)
Backed out changeset 302ac54741f8 (bug 1772313)
Backed out changeset 74c59f9fd51c (bug 1772313)
Backed out changeset 575fb877c56c (bug 1772313)
Backed out changeset 2eaa68f10b19 (bug 1772313)
Backed out changeset 4a8b3ba193dc (bug 1772313)
2022-06-06 07:04:25 +03:00
Tooru Fujisawa d332568199 Bug 1772313 - Part 10: Stop calling XPCOMUtils.defineLazyModuleGetters for Services in intl/. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D148163
2022-06-06 02:49:12 +00:00
Tooru Fujisawa b844fd7815 Bug 1772102 - Use plain object for lazy getter in intl/locale/. r=platform-i18n-reviewers,dminor
Depends on D147889

Differential Revision: https://phabricator.services.mozilla.com/D147890
2022-06-01 16:56:14 +00:00
Greg Tatum d621733e7f Bug 1767537 - Dispatch intl:app-locales-changed for pseudo-locale changes; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D145371
2022-05-05 16:25:31 +00:00
Greg Tatum f30d9ead28 Bug 1764920 - Install the langpack even if it is the fallback; r=platform-i18n-reviewers,preferences-reviewers,mstriemer,dminor
The fallback locale is not guaranteed to have all of the strings for
non-fluent files, even if it is one of the available locales. This patch
shares the logic with about:preferences for getting the available
locales.

Differential Revision: https://phabricator.services.mozilla.com/D143910
2022-04-28 15:00:57 +00:00
Noemi Erli b72aebe50e Backed out changeset 015c2c72a2a2 (bug 1761835) for causing failures in browser_stringBundleInvalidation.js CLOSED TREE 2022-04-21 04:32:28 +03:00
Greg Tatum 85d131c3dc Bug 1761835 - Add a test for switching locales and string bundles; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D144032
2022-04-20 18:02:02 +00:00
Greg Tatum 852ecad7f2 Bug 1762659 - Use MozIntl for stand-alone display names in LangPackMatcher.jsm; r=Mardak,nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D142730
2022-04-01 21:39:17 +00:00
Greg Tatum 3a2de7b49d Bug 1755961 - Delete the format cache in AppDateTimeFormat; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D142470
2022-03-30 21:10:46 +00:00
Greg Tatum 4ab6ee38f3 Bug 1759577 - Create logic to check if live reloading is supported; r=platform-i18n-reviewers,dminor
Depends on D141003

Differential Revision: https://phabricator.services.mozilla.com/D141004
2022-03-22 15:26:09 +00:00
Greg Tatum 0737dd81d2 Bug 1755181 - Invalidate locale cache in AppDateTimeFormat; r=platform-i18n-reviewers,nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D140666
2022-03-22 15:19:47 +00:00
Emilio Cobos Álvarez 1353b25e32 Bug 1758997 - Remove RoInitialize/RoUninitialize from OSPreferences_win. r=Jamie
As per bug 1757647 comment 4, the main thread already initializes COM
early, and we should be able to rely on it in OSPreferences.

Differential Revision: https://phabricator.services.mozilla.com/D140745
2022-03-11 10:02:32 +00:00
Greg Tatum 669f31b897 Bug 1755519 - Add JSM for langpack matching logic; r=platform-i18n-reviewers,nordzilla
The TestUtils file is broken out as it will be shared with the
about:welcome browser chrome tests.

Differential Revision: https://phabricator.services.mozilla.com/D138830
2022-03-02 15:52:43 +00:00
Iulian Moraru 51fd8df2e2 Backed out 2 changesets (bug 1755519) for causing node test failures (About:welcome bundle out of date). CLOSED TREE
Backed out changeset 67e6561012ad (bug 1755519)
Backed out changeset 873d83eaa24e (bug 1755519)
2022-03-02 17:08:47 +02:00
Greg Tatum 2aa7af8502 Bug 1755519 - Add JSM for langpack matching logic; r=platform-i18n-reviewers,nordzilla
The TestUtils file is broken out as it will be shared with the
about:welcome browser chrome tests.

Differential Revision: https://phabricator.services.mozilla.com/D138830
2022-03-02 13:54:16 +00:00
Jonathan Kew 9f7ae29b2c Bug 1757578 - For resolving font prefs, accept lang attribute with underscore in place of hyphen separators. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D139951
2022-03-02 13:15:27 +00:00
Francesco Lodolo (:flod) b7b8c80192 Bug 1059603: Add pt-PT to available Accept-Languages locale, r=eemeli
Differential Revision: https://phabricator.services.mozilla.com/D138027
2022-02-07 16:45:07 +00:00
Greg Tatum 3839eb0a11 Bug 1715892 - Add thread safety notice and asserts for AppDateTimeFormat; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D131672
2021-12-01 17:41:38 +00:00
Greg Tatum d642b72ac3 Bug 1715892 - Unify locale/DateTimeFormat to mozilla::intl::AppDateTimeFormat; r=platform-i18n-reviewers,dminor
I considered removing this class initially, but it's actually a pretty
useful abstraction over the DateTimeFormat interface when used
specifically with Gecko. It applies the OS preferences and provides some
caching behavior.

Differential Revision: https://phabricator.services.mozilla.com/D131671
2021-12-01 17:41:37 +00:00
Greg Tatum 7562365f64 Bug 1715892 - Naively rename intl/locale/DateTimeFormat to AppDateTimeFormat; r=platform-i18n-reviewers,dminor
This will not build, but will provide a better diff for the changes.

Differential Revision: https://phabricator.services.mozilla.com/D131670
2021-12-01 17:41:37 +00:00
Marian-Vasile Laza 3bfa529b3e Backed out 6 changesets (bug 1715892, bug 1719735) for causing bc test failures. CLOSED TREE
Backed out changeset 196952bd8c9c (bug 1715892)
Backed out changeset 9105fe01c025 (bug 1715892)
Backed out changeset 4c15d1a24ccd (bug 1715892)
Backed out changeset 2c328b84285f (bug 1715892)
Backed out changeset 8fcdcdf44b62 (bug 1719735)
Backed out changeset c48f398e301f (bug 1719735)
2021-11-30 23:30:59 +02:00
Greg Tatum ca46c4a669 Bug 1715892 - Add thread safety notice and asserts for AppDateTimeFormat; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D131672
2021-11-30 19:05:58 +00:00
Greg Tatum 9b5497020e Bug 1715892 - Unify locale/DateTimeFormat to mozilla::intl::AppDateTimeFormat; r=platform-i18n-reviewers,dminor
I considered removing this class initially, but it's actually a pretty
useful abstraction over the DateTimeFormat interface when used
specifically with Gecko. It applies the OS preferences and provides some
caching behavior.

Differential Revision: https://phabricator.services.mozilla.com/D131671
2021-11-30 19:05:58 +00:00
Greg Tatum 8589e5b393 Bug 1715892 - Naively rename intl/locale/DateTimeFormat to AppDateTimeFormat; r=platform-i18n-reviewers,dminor
This will not build, but will provide a better diff for the changes.

Differential Revision: https://phabricator.services.mozilla.com/D131670
2021-11-30 19:05:58 +00:00
Greg Tatum e61871c813 Bug 1719553 - Use unified Intl API in OSPreferences_gtk.cpp; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D132038
2021-11-29 20:43:07 +00:00
Dan Minor e12f42285c Bug 1733659 - Clean up naming style in Locale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D131511
2021-11-23 12:36:41 +00:00
Sandor Molnar 2594d2ac61 Backed out 2 changesets (bug 1733659) for causing build bustages. CLOSED TREE
Backed out changeset 9e23aa79fda9 (bug 1733659)
Backed out changeset e316768591c0 (bug 1733659)
2021-11-22 20:51:20 +02:00
Dan Minor bcbfdb6d73 Bug 1733659 - Clean up naming style in Locale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D131511
2021-11-22 18:32:41 +00:00
Dan Minor 2266940c0d Bug 1736017 - Remove MozLocale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129213
2021-11-04 16:36:05 +00:00
Dan Minor 690f8a34f1 Bug 1736017 - Replace MozLocale with Locale in OSPreferences_win.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129212
2021-11-04 16:36:05 +00:00
Dan Minor b82d0c7706 Bug 1736017 - Replace MozLocale with Locale in nsLanguageAtomService.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129211
2021-11-04 16:36:04 +00:00
Dan Minor 45d66d673c Bug 1736017 - Replace MozLocale with Locale in Quotes.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129210
2021-11-04 16:36:04 +00:00
Dan Minor ef542a2f3b Bug 1736017 - Replace MozLocale with Locale in LocaleService.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129209
2021-11-04 16:36:04 +00:00
Jonathan Kew 0511cbc54e Bug 1738903 - Update locale-specific quotation-mark data to CLDR release 40.0. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D130304
2021-11-04 14:06:21 +00:00