Cypress Rails Localization en.yml LOOK AT ME!

Hello to all,
I have a Cypress/Rails localization question. I am attempting to localize a small application. In Rails, that means pulling strings from the en.yml file versus writing the string out. In rails I using the t() method i.e. t(“”) which lives in the en.yml file as ” New Case”This Rails application has Cypress tests; I need to write the correct code to allow Cypress to place “New Case” into the test

  1. Can Cypress pull the string from an en.yml file and the syntax used in .yml? Or do i need to create a new JSON file for these strings?
  2. If I am able to pull this string from the en.yml file is the syntax for Cypress/JS $.i18n(“”) VS rails t(“”)? #ruby

That’s regarding just a React app, but you’ll have exactly the same issue. The i18n js lib I’m assuming is the one you’re using for that Rails app does it’s stuff at runtime based on browser intl settings. I think your going to have to create a utils file as suggested in that thread that basically shims a version of the i18n function that always use a specific string, which will be whatever language you’re testing in. Disclosure: we have this issue in our apps where I work, solution is that we don’t bother searching for specific strings in the E2E tests as that’s just going to make them insanely fragile, we use test IDs instead; I would strongly suggest doing that if you’ve more than a handful of translations (we have hundreds)