Skip to content

Commit 7b803ab

Browse files
ali-fsalamin-derivDerivFEprince-derivamina-deriv
authored
Action cancellation (#20)
* add automatic translation action (binary-com#6649) * Al-amin/36621/added a survey Pop up for English, Spanish and Portuguese (binary-com#6637) * added a survey for English, Spanish and Portuguese * added the survey code snippet * --- * update english survey snippet * translations: 📚 sync translations with crowdin (binary-com#6652) * Prince/ Incorrect error message payment agent transfer (binary-com#6627) * Chore: added validation condition under numbers * Chore: Lint Fix * Chore: Applied form validation on payment agent transfer form * translations: 📚 sync translations with crowdin (binary-com#6656) * Amina/invalid_characters_on_barriers_mobile (binary-com#6645) * input type changed * test * linting fix * removed PA availability notice (binary-com#6639) * percentage_updated (binary-com#6642) * translations: 📚 sync translations with crowdin (binary-com#6658) * translations: 📚 sync translations with crowdin (binary-com#6659) * Akmal / Add responsiveness to last digit stats title (binary-com#6636) * Add responsiveness to last digit stats title * Remove extra padding * Akmal / Disable purchase button when there is no trading (binary-com#6638) * Disable purchase button when there is no trading * Add more spaces * Add client logged in check * translations: 📚 sync translations with crowdin (binary-com#6660) * Revert "Amina/invalid_characters_on_barriers_mobile (binary-com#6645)" (binary-com#6662) This reverts commit 022998e. * translations: 📚 sync translations with crowdin (binary-com#6663) * translations: 📚 sync translations with crowdin (binary-com#6664) * Kevin/Account closure peding withdrawal(s) error message (binary-com#6620) * account closure * fix circleci * add localize on translateable sentence(s) * translations: 📚 sync translations with crowdin (binary-com#6671) * Hubert / Have to refresh MT5 dashboard twice when a server is down, to see dashboard again. (binary-com#6657) * awaiting variable change, so that double refresh is not needed. * account defaults to different one when server is unavailable * refactoring code * changing position of await Co-authored-by: Hubert Koster <hubertkoster@Huberts-MacBook-Pro.local> * translations: 📚 sync translations with crowdin (binary-com#6672) * Amina/ social_icons_text_update (binary-com#6653) * update common.scss * added specific class * Mahdiyeh/ add_stockes_and_indices_in_compare_mt5_accounts (binary-com#6644) * add_stockes_and_indices_in_compare_mt5_accounts * update_message * change_content_for_non_EU_clients * remove dot at the end of the sentence * add_micro_lots_to_EU_clients * Add Localize to strings (binary-com#6667) Co-authored-by: Mohammadreza Ghorbani <reza@firstsource.email> * mitchell/modifing profit table alignment (binary-com#6613) * modifyinh profit table alignment * fixed on mobile * translations: 📚 sync translations with crowdin (binary-com#6673) * Hubert / Invalid unicode characters don't get validated in register email input. (binary-com#6666) * expanding regex with unicode filtering. * refactoring code Co-authored-by: Hubert Koster <hubertkoster@Huberts-MacBook-Pro.local> * translations: 📚 sync translations with crowdin (binary-com#6675) * [Staging] Remove survey pop up (binary-com#6676) * Removed survey pop up * removed the pop up file * translations: 📚 sync translations with crowdin (binary-com#6677) * cancel action Co-authored-by: Al-amin Abdulkareem <81704069+alamin-deriv@users.noreply.github.com> Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com> Co-authored-by: prince-deriv <82309725+prince-deriv@users.noreply.github.com> Co-authored-by: amina-deriv <84661147+amina-deriv@users.noreply.github.com> Co-authored-by: Akmal Djumakhodjaev <akmal@binary.com> Co-authored-by: reza-fs <53177016+reza-fs@users.noreply.github.com> Co-authored-by: Kevin <70131533+kevinw-binary@users.noreply.github.com> Co-authored-by: hubert-deriv <80688204+hubert-deriv@users.noreply.github.com> Co-authored-by: Hubert Koster <hubertkoster@Huberts-MacBook-Pro.local> Co-authored-by: mahdiyeh-fs <82078941+mahdiyeh-fs@users.noreply.github.com> Co-authored-by: Mohammadreza Ghorbani <reza@firstsource.email> Co-authored-by: mitchell-deriv <79144418+mitchell-deriv@users.noreply.github.com>
1 parent a3f1d4e commit 7b803ab

File tree

43 files changed

+634
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+634
-226
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Sync Crowdin translations
2+
3+
This action will automatically extract strings from the binary-static repo and upload them to Crowdin. It will also check whether Crowdin has new translations available, and if so, it will automatically download these translations and create a PR to binary-static's `master` branch to merge them in.
4+
If there are new strings to translate, it will send a slack message to inform the translation team if there is TRANSLATIONS_SLACK_WEBHOOK available.
5+
6+
Required GitHub secrets:
7+
8+
- `PERSONAL_ACCESS_TOKEN`: (GitHub PAT) To allow the action to authenticate with Git for git operations.
9+
- `CROWDIN_API_KEY`: To allow us to download and upload new language files to and from Crowdin.
10+
- `TRANSLATIONS_SLACK_WEBHOOK`: (Optional) To allow send a slack message to inform the translation team in case new strings found.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Sync Crowdin translations
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
sync_crowdin_translations:
11+
# if: github.repository == 'binary-com/binary-static'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Cancel previous running workflow
15+
uses: styfle/cancel-workflow-action@0.9.0
16+
with:
17+
access_token: ${{ github.token }}
18+
- name: Setup node
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: '12'
22+
23+
- name: Checkout master branch
24+
uses: actions/checkout@v2
25+
with:
26+
repository: "ali-fs/binary-static"
27+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
28+
29+
# In this step we're doing a couple things:
30+
# - We generate a new messages.pot
31+
# - We hash the newly generated messages.pot and compare it with the messages.pot on Crowdin.
32+
# - We download the latest translation files from Crowdin, if there are new files, we create a PR.
33+
- name: Generate and push to Crowdin
34+
run: |
35+
branch_name="binary_static_translations"
36+
37+
echo "Setting up Git identity"
38+
git config --global user.name "DerivFE"
39+
git config --global user.email "80095553+DerivFE@users.noreply.github.com"
40+
41+
echo "Installing Crowdin CLI"
42+
sudo npm i -g @crowdin/cli
43+
44+
echo "Installing project dependencies and building the project"
45+
npm install
46+
npm run build
47+
48+
echo "Checking out new branch [$branch_name]"
49+
git checkout -b "$branch_name"
50+
51+
52+
53+
echo "Updating translations source file"
54+
last_messages_hash="$(git hash-object $(git rev-parse --show-toplevel)/src/translations/messages.pot)"
55+
node ./scripts/render.js -t
56+
current_messages_hash="$(git hash-object $(git rev-parse --show-toplevel)/src/translations/messages.pot)"
57+
echo "- [crowdin]: message.pot hash is: $last_messages_hash"
58+
echo "- [generated]: message.pot hash is: $current_messages_hash"
59+
60+
# We compare the generated messages.pot with the last messages.pot.
61+
# Only send a Slack message and upload it to Crowdin if there were any changes made to messages.pot.
62+
if [ "$last_messages_hash" != "$current_messages_hash" ]; then
63+
echo "Hashes are different, uploading to Crowdin"
64+
echo "Uploading new strings to Crowdin"
65+
crowdin upload sources -T ${{ secrets.CROWDIN_API_KEY }}
66+
67+
# Send a message to Slack (granted we have a webhook secret).
68+
# This check also allows a repo admin to disable the Slack message by removing the secret.
69+
if [ -n "${{ secrets.TRANSLATIONS_SLACK_WEBHOOK }}" ]; then
70+
echo "Sending message to Slack (#team_translations)"
71+
curl -X POST -H 'Content-type: application/json' --data '{"text":"There are new or updated strings available for Binary.com (https://crowdin.com/project/binary-static)."}' ${{ secrets.TRANSLATIONS_SLACK_WEBHOOK }}
72+
fi
73+
fi
74+
75+
76+
echo "Downloading translation files from Crowdin (*.po)"
77+
crowdin download -T ${{ secrets.CROWDIN_API_KEY }}
78+
echo "Updating javascript translation files (*.js)"
79+
node ./scripts/render.js -j
80+
81+
82+
83+
if [ -z "$(git status --porcelain)" ]; then
84+
echo "Found no new translation files that need to be merged with master. Not creating a PR."
85+
else
86+
echo "Found updated translation files that need to be merged with master. Creating a PR."
87+
88+
# Commit the newly downloaded files
89+
cd $(git rev-parse --show-toplevel)
90+
git add .
91+
git commit -m "translations: 📚 sync translations with crowdin"
92+
93+
# Force push to this branch in case a previous run created it.
94+
git push --set-upstream origin "$branch_name" -f
95+
96+
sudo apt install gh
97+
gh auth login --with-token <<< ${{ secrets.PERSONAL_ACCESS_TOKEN }}
98+
gh pr close "$branch_name" || true
99+
gh pr create --fill --base "master" --head "binary-com:$branch_name"
100+
101+
echo "Attempting to approve and merge the PR."
102+
gh pr merge "$branch_name" -s
103+
echo "**The translation PR has beed merged successfully.**"
104+
fi

scripts/js_texts/extracted_strings_app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ module.exports = [
533533
'Sorry, no mobile phone bills',
534534
'Sorry, this feature is not available in your jurisdiction.',
535535
'Sorry, withdrawals for this currency are currently disabled.',
536+
'Sorry, your account is not authorised for any further contract purchases.',
536537
'Spot',
537538
'Spot Time',
538539
'Spot Time (GMT)',
@@ -807,13 +808,18 @@ module.exports = [
807808
'numbers',
808809
'or',
809810
'or upload photo – no scans or photocopies',
811+
'position(s)',
812+
'regulated by the Malta Financial Services Authority (MFSA),',
813+
'regulated by the Malta Gaming Authority,',
814+
'regulated by the UK Gaming Commission (UKGC),',
810815
'second',
811816
'seconds',
812817
'space',
813818
'tick',
814819
'ticks',
815820
'time',
816821
'time or create an MT5 account',
822+
'withdrawal(s)',
817823
'{SPAIN ONLY}However, Binary Investments (Europe) Ltd has assessed your knowledge and experience and deems the product appropriate for you.',
818824
'{SPAIN ONLY}This is a product with leverage. You should be aware that losses may be higher than the amount initially paid to purchase the product.',
819825
'{SPAIN ONLY}You are about to purchase a product that is not simple and may be difficult to understand: Contracts for difference and forex. As a general rule, the CNMV considers that such products are not appropriate for retail clients, due to their complexity.',

src/javascript/_autogenerated/ach.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/_autogenerated/es.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/_autogenerated/fr.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/_autogenerated/id.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/_autogenerated/it.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/_autogenerated/pl.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/_autogenerated/pt.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)