Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-6305

fluid.fetchResources does not use defaultLocale from an individual resourceSpec entry

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      If fluid.fetchResources is called with a resourceSpec entry which specifies a defaultLocale but not a locale, the defaultLocale is not used when attempting the fetch and fallback process.

      On lines 70-74 of FluidRequests.js, the optional override defaultLocale is checked, and if locale is not present, the locale is also overridden. If the optional override is not present, however, there is no further check for setting the locale based on the defaultLocale.

      The intention of the code seems to be as follows:

      • a defaultLocale can be set on an individual resourceSpec entry and will be used if a locale is not also supplied
      • a defaultLocale option can be passed to fluid.fetchResources and will override the defaultLocale of each resourceSpec

      The first does not take place; this issue is obscured in the tests (FluidRequestsTests.js) because of lines 176-178:

              fluid.fetchResources(resourceSpecs, callback, {
                  defaultLocale: "en"
              });
      

      Because a defaultLocale is set and none of the resourceSpec entries in the tests set a defaultLocale other than en, it hasn't been clear that this is an issue until recent multilingual work.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmoss Gregor Moss
                Reporter:
                gmoss Gregor Moss
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0.5d
                  0.5d
                  Remaining:
                  Remaining Estimate - 0.5d
                  0.5d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified