Skip to content
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

LIVE-2003 - Feature - Pass urls through regex to replace template by locale #74

Conversation

nparigi-ledger
Copy link
Contributor

@nparigi-ledger nparigi-ledger commented May 18, 2022

❓ Context

Substitute url strings by getter function with regex replacing template {locale} by current locale

Ex: ledger.com/{locale}/ become ledger.com/fr/

✅ Checklist

  • Test coverage: Did you write any tests to cover the changes introduced by this pull request?
  • Atomic delivery: Is this pull request standalone? In order words, does it depend on nothing else?
  • Breaking changes: Does this pull request contain breaking changes of any kind? If so, please explain why.

📸 Demo

🚀 Expectations to reach

Please make sure you follow these Important Steps.

Pull Requests must pass the CI and be internally validated in order to be merged.

Note: Migrated from LedgerHQ/ledger-live-mobile#2451

@vercel
Copy link

vercel bot commented May 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ledger-live-github-bot ✅ Ready (Inspect) Visit Preview May 18, 2022 at 3:02PM (UTC)
live-common-tools ✅ Ready (Inspect) Visit Preview May 18, 2022 at 3:02PM (UTC)
2 Ignored Deployments
Name Status Preview Updated
native-ui-storybook ⬜️ Ignored (Inspect) May 18, 2022 at 3:02PM (UTC)
react-ui-storybook ⬜️ Ignored (Inspect) May 18, 2022 at 3:02PM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented May 18, 2022

⚠️ No Changeset found

Latest commit: ee54bc2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link

github-actions bot commented May 18, 2022

@valpinkman

Screenshots: ✅

There are no changes in the screenshots for this PR. If this is expected, you are good to go.

@nparigi-ledger nparigi-ledger added the HODL Do not merge label May 18, 2022
obj["_" + key] = obj[key];
Object.defineProperty(obj, key, {
get() {
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid adding more ts-ignore in our codebase? 🙏 not sure what the error was but we may have to find a better algorithm.

Also, I'm not a huge fan of the usage of get() here. It will not help performance to have a lot of these kind of code.
I totally understand that i was meant not to be breaking change tho. But, we are making urls dynamic, so in a way it's a new feature, it is ok to make it explicit 🤔 I guess that means changing all parts where we get that URL, but I feel it's for the better good.

There are probably different ways to do this, one way could be a function getURL("key", lang). We can also cache per lang / refresh a map per lang. anything that could try to avoid doing this at runtime 🙏

@github-actions
Copy link

github-actions bot commented Jun 5, 2022

There as been no activity on this PR for the last 14 days. Please consider closing this PR.

@github-actions github-actions bot added the Stale label Jun 5, 2022
@github-actions github-actions bot closed this Jun 14, 2022
@valpinkman valpinkman reopened this Jun 14, 2022
@github-actions github-actions bot closed this Jun 24, 2022
@valpinkman valpinkman deleted the feat/LIVE-2003-adapt-links-in-the-app-for-localisation-purposes branch August 29, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HODL Do not merge mobile Has changes in LLM Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants