forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[COJ]/likhith/COJ-1231/integrate deriv-translations in account-package (
deriv-com#15448) * chore: integrate deriv-tralstaions in account-package * chore: integrated translation to account * chore: rename ENV variables * fix: failing testcae * fix: translations for deriv-app * fix: formatting of yml file * chore: added a temp token * chore: added a temp token * chore: added a temp token * Update .github/workflows/sync-translations.yml * ci: add permission * chore: synced translations * chore: implemented sync b/w footer and account settings * chore: added comments * chore: updated package version * chore: implemented translation lib changes to Deriv-app * chore: implemented translation lib changes to Deriv-app * chore: implemented translation lib changes to Deriv-app * chore: updated deriv-com/translation * chore: removed implemented TODOs * fix: failing testcases * fix: failing testcases * fix: translation mock * chore: incorporated review comments * chore: added translation cache * fix: caching pattern * chore: reverted cache config * fix: prettier issue --------- Co-authored-by: Ali(Ako) Hosseini <[email protected]>
- Loading branch information
1 parent
c476d10
commit 9fdfacb
Showing
29 changed files
with
177 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Sync translations | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: '0 */12 * * *' | ||
|
||
jobs: | ||
sync_translations: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
environment: Staging | ||
steps: | ||
- name: Sync translations | ||
uses: deriv-com/translations/.github/actions/extract_and_sync_translations@main | ||
with: | ||
PROJECT_NAME: ${{ vars.ACC_R2_PROJECT_NAME }} | ||
CROWDIN_BRANCH_NAME: staging | ||
CROWDIN_PROJECT_ID: ${{ secrets.ACC_CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.ACC_CROWDIN_PERSONAL_TOKEN }} | ||
R2_ACCOUNT_ID: ${{ secrets.ACC_R2_ACCOUNT_ID }} | ||
R2_ACCESS_KEY_ID: ${{ secrets.ACC_R2_ACCESS_KEY_ID }} | ||
R2_SECRET_ACCESS_KEY: ${{ secrets.ACC_R2_SECRET_ACCESS_KEY }} | ||
R2_BUCKET_NAME: ${{ secrets.ACC_R2_BUCKET_NAME }} | ||
PROJECT_SOURCE_DIRECTORY: "packages/account/src" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const Localize = ({ i18n_default_text, values }) => { | ||
// Replace placeholders in the default text with actual values | ||
const localizedText = i18n_default_text.replace(/\{\{(\w+)\}\}/g, (match, key) => values[key] || match); | ||
|
||
return localizedText || null; | ||
}; | ||
|
||
// Mock for useTranslations hook | ||
const useTranslations = () => ({ | ||
localize: jest.fn((text, args) => { | ||
return text.replace(/{{(.*?)}}/g, (_, match) => args[match.trim()]); | ||
}), | ||
currentLang: 'EN', | ||
}); | ||
|
||
const localize = jest.fn(text => text); | ||
|
||
const getAllowedLanguages = jest.fn(() => ({ EN: 'English', VI: 'Tiếng Việt' })); | ||
|
||
export { Localize, localize, useTranslations, getAllowedLanguages }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.