-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLM-8914 Cart Translations Issue #220
base: staging
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any way we can add automated test coverage for this? It's fairly critical that translations work, and it sounds like they weren't properly prior to this fix, so it would be good to ensure we don't regress here in the future. I think if we separated out the steps of reading/writing files we could test only the processing step, e.g.
const translations = await readTranslations();
const result = processTranslations(...); // this is what gets tested
await writeTranslations(result);
@chrisvariety Good idea, should I include this in the scope of this ticket, or create a new ticket to handle this? |
@AlexONeillTI up to you and @rjschill87, my vote would be to include it in this ticket as we generally prefer to ship code changes with corresponding tests. |
@AlexONeillTI Would definitely include tests within the scope of this ticket. |
@rjschill87 I have also added the testing that @chrisvariety has requested. This involved splitting the code into three segments:
If the translations exist, FINAL_TRANSLATIONS is defined and contains all the necessary translations. If the translations do not exist, then FINALTRANSLATIONS = {}, which now throws a new error: "Error('No translations exist!');" I have tested these changes on https://alexoneilsandbox.thoughtindustries.com/cart. |
@rjschill87 The translation keys must be translated directly, rather than passed as a variable. I have moved Will I leave the |
@AlexONeillTI If that was all that was in the |
After investigating the compiled files, I realized that the string that Let me know if there is any drawback to including the .mjs files in this check. |
@AlexONeillTI Thanks for digging into that! Looks good -- just needs some tests and we should be good to go. |
@rjschill87 I pushed the test cases for parse-translations. Few things to note:
Read translations for instance (all keys), process translations (necessary keys), write necessary keys to translations.json, use them, and then reset This makes isolating the testing of I have done my best to test the read, process, and write operations with mock data that should raise an issue if something is broken or not working as expected. Lmk if this is sufficient. |
I had a sync with Aalto university yesterday and they showed me how their translations are not working on their dashboard page. This looked identical to this issue. Is there a possibility of revisiting this to see if it fixes their issue? Can be seen in there production site here: https://aaltoproduction.eu.thoughtindustries.com/learn/dashboard |
It would be good to have @rjschill87 take another look at it, it seems like there were a lot of commits added after the previous review. The challenge when commits are added after review is we never really know when it's ready for re-review unless you request re-review explicitly. |
I have changes implemented and tested locally. When trying to push, I am getting that I don't have permission to push to helium repo. I have messaged @haddadnj and am waiting for a reply. I will update you here when I have successfully pushed the changes. |
@AlexONeillTI fixed your permissions :) |
Thanks Chris! |
Review now up to date. Addressed @rjschill87's comment regarding the call to the parserScript here: #220 (comment) The test suite runs successfully and I also tested the latest changes by deploying an app with the Cart and Dashboard page to my sandbox. Both successfully reflect the translations in locales/translations.json |
Closes CLM-8914
Issue: Cart translations were not working in a deployed environment, but did work locally. Video of issue
The issue is with the
i18nObject
, as it was not picking up all translations. The issue is resolved by using thesourceDefaultNamespace
to map translations instead.I tested this using the
Cart
component as detailed in the ticket, but also tested theCatalog
component to ensure that the translations were still working for other helium components. All looks good in testing.Please let me know if there is any reason why we should use
i18nObject
instead ofsourceDefaultNamespace
.