Skip to content

Commit

Permalink
feat: crowdin ota
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Oct 11, 2024
1 parent 2d3b844 commit 7eb7f53
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 4,147 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ jobs:
- name: Lint Prettier
run: pnpm format:check

check-translation-strings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision
- name: Check translation strings extraction
run: pnpm --dir ./apps/mobile run lingui:extract
- name: Fail if there are uncommited translations
run: git diff-index --quiet HEAD --

lint-syncpack:
runs-on: ubuntu-latest
steps:
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/crowdin-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Provision
uses: ./.github/actions/provision

- name: Extract lingui strings
working-directory: ./apps/mobile
run: |
pnpm lingui
- name: crowdin action
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: false
download_translations: true
localization_branch_name: chore/l10n_crowdin_translations
commit_message: chore/crowdin-translations
create_pull_request: true
pull_request_title: 'chore: crowdin translations'
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_base_branch_name: 'dev'
download_translations: false
create_pull_request: false
config: apps/mobile/crowdin.yml
env:
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"typecheck": "tsc --noEmit -p ./tsconfig.json"
},
"dependencies": {
"@crowdin/ota-client": "2.0.0",
"@expo/vector-icons": "14.0.0",
"@leather.io/bitcoin": "workspace:*",
"@leather.io/constants": "workspace:*",
Expand Down
11 changes: 6 additions & 5 deletions apps/mobile/src/app/(home)/developer-console/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { BrowserMessage } from '@/components/browser/browser-in-use';
import { PressableListItem } from '@/components/developer-console/list-items';
import { useToastContext } from '@/components/toast/toast-context';
import { usePushNotifications } from '@/hooks/use-push-notifications';
import { LOCALES } from '@/locales';
import { getAvailableLocales } from '@/locales';
import { AppRoutes } from '@/routes';
import { TestId } from '@/shared/test-id';
import { useSettings } from '@/store/settings/settings';
Expand Down Expand Up @@ -55,14 +55,15 @@ export default function DeveloperConsoleScreen() {
}, []);

Check warning on line 55 in apps/mobile/src/app/(home)/developer-console/index.tsx

View workflow job for this annotation

GitHub Actions / lint-eslint

React Hook useEffect has missing dependencies: 'cleanupNotificationReceivedListener', 'setNotificationReceivedListener', and 'toast'. Either include them or remove the dependency array

Check warning on line 55 in apps/mobile/src/app/(home)/developer-console/index.tsx

View workflow job for this annotation

GitHub Actions / lint-eslint

React Hook useEffect has missing dependencies: 'cleanupNotificationReceivedListener', 'setNotificationReceivedListener', and 'toast'. Either include them or remove the dependency array

function toggleLocalization() {
const locIdx = LOCALES.findIndex(loc => loc.locale === i18n.locale);
const isLastItem = locIdx === LOCALES.length - 1;
const locales = getAvailableLocales();
const locIdx = locales.findIndex(loc => loc === i18n.locale);
const isLastItem = locIdx === locales.length - 1;
const nextIdx = isLastItem ? 0 : locIdx + 1;
const nextLocale = LOCALES[nextIdx];
const nextLocale = locales[nextIdx];
if (!nextLocale) {
throw new Error("Didn't find next locale for some reason");
}
i18n.activate(nextLocale.locale);
i18n.activate(nextLocale);
}

const locale = i18n.locale;
Expand Down
4 changes: 0 additions & 4 deletions apps/mobile/src/locales/en/messages.d.ts

This file was deleted.

Loading

0 comments on commit 7eb7f53

Please sign in to comment.