Loading dictionary throws 404 not found for languages not present in core components dictionary
Expected Behaviour
Should not try to load dictionary if not present for the language
Actual Behaviour
404 Not Found - for call
https://
Reproduce Scenario (including but not limited to)
We have a page authored with lang=nl-nl , The form on initialization is trying to load languages and throwing 404 not found for languages not present under /apps/core/fd/af-clientlibs/core-forms-components-runtime-all/resources/i18n
Steps to Reproduce
1)Author a page with lang=nl-nl 2)Add Form onto the page 3)Publish the page 4)View in publish
Platform and Version
AEM 6.5.22
AEM Version (mention the exact version in case of cloud SDK)
AEM Forms Version
1.1.66
Sample Code that illustrates the problem
https://github.com/adobe/aem-core-forms-components/blob/84b2898e721f790a0378dc1146fc3fa61caf61a2/ui.frontend/src/LanguageUtils.js#L45
Logs taken while reproducing problem
@shravanthprasad Yes, this was expected as per initial design. Though this should not impact any functionality but I agree that this is a quality + monitoring hygiene issue that should be fixed.
@rismehta do we have anything in plan to address this issue? making it configurable in the component or any other workaround?
@shravanthprasad ~~Could you verify whether this PR — https://github.com/adobe/aem-core-forms-components/pull/1694 — resolves the issue? Please confirm. You can test it locally by building the changes on the 650 branch.~~
[EDIT] Custom locales can exist in the default product locale directory. For instance, you can refer to this test collateral where customers may add their own locales. Because of this, we cannot add an explicit check within the product code
Since formcontainerview.js is customizable, you can add a project-specific check on your side to prevent loading the locale, similar to what I did in the PR I shared.
@rismehta - Tried by cherry picking the commit on top of release tag and I can confirm that the fix is working. But as you said I will try out Option 2 to add a check in formcontainerview.js to fix the above issue and let you know if all good.