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

✨ LLM - Thai language added #9345

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

cgrellard-ledger
Copy link
Contributor

@cgrellard-ledger cgrellard-ledger commented Feb 26, 2025

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • Add thai language behind feature flag on the Welcome screen and in the settings
    • It will automatically ask to install the language on the device when switching language once provided by the API
    • External links fallback to english as they are not yet supported in thai
    • When starting the app, it will fallback to english if the user was previously in thai and the FF has been disabled

📝 Description

Thai language added

Scenario Demo
Onboarding https://github.com/user-attachments/assets/d46d54f8-d625-4765-b376-12ff5160715a
Settings https://github.com/user-attachments/assets/d3cabbc2-f422-4048-ae70-cd753f740c49

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copy link

vercel bot commented Feb 26, 2025

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

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2025 9:26am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2025 9:26am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2025 9:26am
web-tools ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2025 9:26am

@live-github-bot live-github-bot bot added mobile Has changes in LLM common Has changes in live-common ledgerjs Has changes in the ledgerjs open source libs translations Translation files have been touched labels Feb 26, 2025
@live-github-bot
Copy link
Contributor

live-github-bot bot commented Feb 26, 2025

Mobile Bundle Checks

Comparing da32add against 46b532d.

⚠️ main.ios.jsbundle bundle size significantly increased: 63.6mb -> 64.3mb. Please check if this is expected.
⚠️ main.android.jsbundle bundle size significantly increased: 63.6mb -> 64.3mb. Please check if this is expected.

Desktop Bundle Checks

Comparing da32add against 46b532d.

✅ Previous issues have all been fixed.

export const useSupportedLocales = () => {
const thaiFeature = useFeature("llmThai");

const supportedLocalesFiltered = supportedLocales.filter(locale => {
Copy link
Member

Choose a reason for hiding this comment

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

Don't we want to use a memo here?

LucasWerey
LucasWerey previously approved these changes Feb 26, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can think a little more generic?
In fact, if we add another language in the future

it might be a bit overkill at the moment, but something along the lines of

export const useSupportedLocales = () => {
  const thaiFeature = useFeature("llmThai");
  const greekFeature = useFeature("llmGreek");
  const arabicFeature = useFeature("llmArabic");
  const lithuanianFeature = useFeature("llmLithuanian");

  const features = {
    th: thaiFeature,
    el: greekFeature,
    ar: arabicFeature,
    lt: lithuanianFeature,
  };

  const supportedLocalesFiltered = useMemo(
    () =>
      supportedLocales.filter(locale => {
        const feature = features[locale];
        if (feature && !feature.enabled) {
          return false;
        }
        return true;
      }),
    [thaiFeature?.enabled, greekFeature?.enabled, arabicFeature?.enabled, lithuanianFeature?.enabled],
  );

  return supportedLocalesFiltered;
};

Copy link
Contributor

Choose a reason for hiding this comment

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

Not mandatory btw ;)

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
75.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Copy link
Contributor

@mcayuelas-ledger mcayuelas-ledger left a comment

Choose a reason for hiding this comment

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

LGTM

@cgrellard-ledger cgrellard-ledger added this pull request to the merge queue Feb 28, 2025
github-merge-queue bot pushed a commit that referenced this pull request Feb 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common ledgerjs Has changes in the ledgerjs open source libs mobile Has changes in LLM translations Translation files have been touched
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants