Closed Bug 1761835 Opened 3 years ago Closed 2 years ago

Create a LocaleTestingUtils.jsm with utilities for testing live language switching

Categories

(Core :: Internationalization, task, P2)

task

Tracking

()

RESOLVED WONTFIX

People

(Reporter: gregtatum, Assigned: gregtatum)

References

Details

Attachments

(1 obsolete file)

Testing the features for live language switching has been pretty tough. It would be much better to have testing utils to make this easy. I've started working on these locally, but haven't been able to get them done in time for Firefox 100. This bug is for tracking following up with these utilities.

This would do something like:

const { LocaleTestUtils } = ChromeUtils.import(
  "resource://testing-common/LocaleTestUtils.jsm"
);

const langpack = LocaleTestUtils.createLangpack({
  locale: "es-ES",
  files: [
    {
      path: `browser/chrome/features/formautofill@mozilla.org/es-ES/locale/es-ES/formautofill.properties`,
      contents: `autofillHeader=Bueno`,
    },
  ],
});

Services.locale.requestedLocales = ["es-ES"]
Depends on: 1762282

I'm doing this in Bug 1764802.

I moved the patch over here to land it before Bug 1764802.

Pushed by gtatum@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/015c2c72a2a2 Add a test for switching locales and string bundles; r=platform-i18n-reviewers,dminor

This may still be worth completing, but I realized that you can reliably test locale changes with pseudo-locales if you remove the pref observers and always trigger intl:app-locale-changed.

Flags: needinfo?(gtatum)

I'm going to close this since I'm not going to get to addressing the review feedback, and intl:app-locale-changed should be good enough.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
Attachment #9273118 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: