From 660a82412e2b6db454d642a59912120d09aff81b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Tue, 20 Jun 2023 11:40:46 -0400 Subject: [PATCH 01/28] en file --- lang/en_US.json | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lang/en_US.json diff --git a/lang/en_US.json b/lang/en_US.json new file mode 100644 index 0000000..5453d6b --- /dev/null +++ b/lang/en_US.json @@ -0,0 +1,46 @@ +{ + "profile": { + "my_profile": "My Profile", + "upload_profile_photo": "Upload profile photo", + "basic_information": "Basic Information", + "username": "Username", + "given_name": "First Name", + "family_name": "Last Name", + "email_primary": "Primary Email", + "email_secondary": "Secondary Email", + "send_email_to_secondary": "Send Email to Secondary Address", + "access_level": "Access Level", + "change_password": "Change Password", + "timezone": "Time Zone", + "utc_offset": "UTC Offset", + "select_timezone": "Select Timezone", + "color_theme": "Color Theme", + "choose_color_theme": "Choose a color theme", + "color_themes": { + "system": "Follow Device Theme", + "light": "Light Mode", + "dark": "Dark Mode", + "black": "(Black)" + }, + "pwa_messages": { + "browser_support": { + "a": "Submitty supports an installable Progressive Web App (PWA) which requires Chrome, see ", + "b": "here", + "c": " for installation instructions" + }, + "install_app": "Install App", + "uninstall_lable": { + "a": "The Submitty Progressive Web App (PWA) has already been installed, see ", + "b": "here", + "c": " to uninstall it" + } + }, + "image_flagged_msg": "Your preferred image was flagged as inappropriate." + }, + "globals": { + "bools": { + "true": "True", + "false": "False" + } + } +} \ No newline at end of file From be0524102240fed155e0484d15de90589b80bd7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Fri, 23 Jun 2023 19:57:21 -0400 Subject: [PATCH 02/28] bump-submitty --- .github/workflows/bump-submitty.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/bump-submitty.yml diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml new file mode 100644 index 0000000..8409c69 --- /dev/null +++ b/.github/workflows/bump-submitty.yml @@ -0,0 +1,12 @@ +name: Bump Submitty + +on: + repository_dispatch: + types: [version-up] + workflow_dispatch: + +jobs: + stub: + runs-on: ubuntu-20.04 + steps: + - run: echo "Test" \ No newline at end of file From e48fa01432bb409fb21ef456daff499a58760de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Fri, 23 Jun 2023 21:35:05 -0400 Subject: [PATCH 03/28] update version --- .github/workflows/bump-submitty.yml | 25 +++++++++++++++++++++++-- bin/update-version.py | 25 +++++++++++++++++++++++++ version.json | 3 +++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 bin/update-version.py create mode 100644 version.json diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index 8409c69..d1b83e5 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -6,7 +6,28 @@ on: workflow_dispatch: jobs: - stub: + update-submitty: runs-on: ubuntu-20.04 + name: Update Submitty steps: - - run: echo "Test" \ No newline at end of file + - name: Checkout Submitty Repository + uses: actions/checkout@v3 + with: + repository: ${{ github.repository_owner }}/Submitty + sparse-checkout: | + site/app/templates + sparse-checkout-cone-mode: false + ref: ${{ github.event.client_payload.ref }} + path: Submitty + + - name: Checkout Localization Repository + uses: actions/checkout@v3 + with: + path: Localization + + - uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Update Version + run: python3 Localization/bin/update-version.py \ No newline at end of file diff --git a/bin/update-version.py b/bin/update-version.py new file mode 100644 index 0000000..6b99295 --- /dev/null +++ b/bin/update-version.py @@ -0,0 +1,25 @@ +import argparse +import json +from pathlib import Path + +def get_args(): + parser = argparse.ArgumentParser(prog='update-version') + parser.add_argument('-v', '--version', required=True) + return parser.parse_args() + +def main(): + args = get_args() + + repo_path = Path(__file__).parent.parent + if not repo_path.is_dir(): + raise NotADirectoryError("Could not locate repository.") + + # Update version in JSON file + with (repo_path / 'version.json').open() as file: + data = json.load(file) + data['submitty_version'] = args.version + with (repo_path / 'version.json').open('w') as file: + json.dump(data, file, indent=2) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/version.json b/version.json new file mode 100644 index 0000000..a548d77 --- /dev/null +++ b/version.json @@ -0,0 +1,3 @@ +{ + "submitty_version": "v23.06.01" +} \ No newline at end of file From 42f30272a00337a89f7678fe4f056a8773959451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Fri, 23 Jun 2023 21:36:56 -0400 Subject: [PATCH 04/28] ref arg --- .github/workflows/bump-submitty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index d1b83e5..fc37cb0 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -30,4 +30,4 @@ jobs: python-version: 3.11 - name: Update Version - run: python3 Localization/bin/update-version.py \ No newline at end of file + run: python3 Localization/bin/update-version.py -v ${{ github.event.client_payload.ref }} \ No newline at end of file From b5c1f15579652c53834c0314c43a9f720d1c48d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Fri, 23 Jun 2023 21:42:21 -0400 Subject: [PATCH 05/28] style --- bin/update-version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/update-version.py b/bin/update-version.py index 6b99295..db2dcd9 100644 --- a/bin/update-version.py +++ b/bin/update-version.py @@ -12,7 +12,7 @@ def main(): repo_path = Path(__file__).parent.parent if not repo_path.is_dir(): - raise NotADirectoryError("Could not locate repository.") + raise NotADirectoryError('Could not locate repository.') # Update version in JSON file with (repo_path / 'version.json').open() as file: From 982ec667ed0cd2f9073a4cf4aabdce063513a496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Fri, 23 Jun 2023 22:53:27 -0400 Subject: [PATCH 06/28] rename to config json --- version.json => config.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename version.json => config.json (100%) diff --git a/version.json b/config.json similarity index 100% rename from version.json rename to config.json From 3a1b9139da169e822599ac7af19d1b7c975d6d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 01:20:50 -0400 Subject: [PATCH 07/28] update lang json data --- bin/update-version.py | 93 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 7 deletions(-) diff --git a/bin/update-version.py b/bin/update-version.py index db2dcd9..9281c43 100644 --- a/bin/update-version.py +++ b/bin/update-version.py @@ -1,12 +1,83 @@ -import argparse import json +import re +from argparse import ArgumentParser, Namespace +from collections import OrderedDict from pathlib import Path -def get_args(): - parser = argparse.ArgumentParser(prog='update-version') + +def get_args() -> Namespace: + parser = ArgumentParser(prog='update-version') parser.add_argument('-v', '--version', required=True) return parser.parse_args() + +def get_template_data() -> dict: + pattern = re.compile(r"localize\s*?\(\s*?(?P[\'\"])(?P[\w\.]+?)\s*?(?P=q1),\s*?(?P[\'\"])(?P.+?)(? OrderedDict: + result = OrderedDict() + + # Update existing keys + for key, val in original.items(): + if key not in updated: + continue + + if isinstance(val, OrderedDict) and isinstance(updated[key], dict): + result[key] = update_data(val, updated[key]) + else: + result[key] = updated[key] + + # Add new keys + for key, val in updated.items(): + if key not in original: + if isinstance(val, dict): + result[key] = OrderedDict(val) + else: + result[key] = val + + return result + + def main(): args = get_args() @@ -15,11 +86,19 @@ def main(): raise NotADirectoryError('Could not locate repository.') # Update version in JSON file - with (repo_path / 'version.json').open() as file: - data = json.load(file) + with (repo_path / 'config.json').open() as file: + data = json.load(file, object_pairs_hook=OrderedDict) data['submitty_version'] = args.version - with (repo_path / 'version.json').open('w') as file: + with (repo_path / 'config.json').open('w') as file: json.dump(data, file, indent=2) + # Update default lang data + with (repo_path / 'lang' / 'en_US.json').open() as file: + json_data = json.load(file, object_pairs_hook=OrderedDict) + json_data = update_data(json_data, get_template_data()) + with (repo_path / 'lang' / 'en_US.json').open('w') as file: + json.dump(json_data, file, indent=4) + + if __name__ == '__main__': - main() \ No newline at end of file + main() From 3cbc76a105b506f9ea2fe01dbcf452dff9c15bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 01:26:21 -0400 Subject: [PATCH 08/28] separate ref name --- .github/workflows/bump-submitty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index fc37cb0..75e8ac7 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -30,4 +30,4 @@ jobs: python-version: 3.11 - name: Update Version - run: python3 Localization/bin/update-version.py -v ${{ github.event.client_payload.ref }} \ No newline at end of file + run: python3 Localization/bin/update-version.py -v ${{ github.event.client_payload.ref_name }} \ No newline at end of file From 0b8a8b8ef2c59976b19b621ed752c1d084f4af9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 01:52:15 -0400 Subject: [PATCH 09/28] create pr --- .github/workflows/bump-submitty.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index 75e8ac7..7236e9a 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -24,10 +24,28 @@ jobs: uses: actions/checkout@v3 with: path: Localization + + - name: Load config data + id: config + run: | + echo 'CONFIG<> $GITHUB_ENV + cat Localization/config.json >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV + + echo 'version=${{ fromJson(env.CONFIG).submitty_version }}' >> $GITHUB_OUTPUT - uses: actions/setup-python@v4 with: python-version: 3.11 - - name: Update Version - run: python3 Localization/bin/update-version.py -v ${{ github.event.client_payload.ref_name }} \ No newline at end of file + - name: Run Version Update + run: python3 Localization/bin/update-version.py -v ${{ github.event.client_payload.ref_name }} + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.PAT }} + commit-message: update version and base lang to ${{ github.event.client_payload.ref_name }} + branch: bump-submitty/${{ github.event.client_payload.ref_name }} + title: "[Dependency] Update Submitty from ${{ steps.config.outputs.submitty_version }} to ${{ github.event.client_payload.ref_name }}" + body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) to version ${{ steps.config.outputs.submitty_version }} to ${{ github.event.client_payload.ref_name }}." \ No newline at end of file From d3b69f90461fc98a699913cffbed2e866bcd1223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 02:03:35 -0400 Subject: [PATCH 10/28] show config --- .github/workflows/bump-submitty.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index 7236e9a..e77ca01 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -32,6 +32,7 @@ jobs: cat Localization/config.json >> $GITHUB_ENV echo 'EOF' >> $GITHUB_ENV + echo "Config ${{ env.CONFIG }}" echo 'version=${{ fromJson(env.CONFIG).submitty_version }}' >> $GITHUB_OUTPUT - uses: actions/setup-python@v4 From bc53530ba7023a271f6ca01ccc0cc1b87bb9f6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 02:04:56 -0400 Subject: [PATCH 11/28] update --- .github/workflows/bump-submitty.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index e77ca01..a178ece 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -33,7 +33,6 @@ jobs: echo 'EOF' >> $GITHUB_ENV echo "Config ${{ env.CONFIG }}" - echo 'version=${{ fromJson(env.CONFIG).submitty_version }}' >> $GITHUB_OUTPUT - uses: actions/setup-python@v4 with: From 9b126cbb1b29aa4124ede2ba76f9596d08ffdb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 02:11:55 -0400 Subject: [PATCH 12/28] json prop action --- .github/workflows/bump-submitty.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index a178ece..4831d0f 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -25,14 +25,12 @@ jobs: with: path: Localization - - name: Load config data - id: config - run: | - echo 'CONFIG<> $GITHUB_ENV - cat Localization/config.json >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - - echo "Config ${{ env.CONFIG }}" + - name: Get version + id: version + uses: notiz-dev/github-action-json-property@v0.2.0 + with: + path: Localization/config.json + prop_path: submitty_version - uses: actions/setup-python@v4 with: @@ -47,5 +45,5 @@ jobs: token: ${{ secrets.PAT }} commit-message: update version and base lang to ${{ github.event.client_payload.ref_name }} branch: bump-submitty/${{ github.event.client_payload.ref_name }} - title: "[Dependency] Update Submitty from ${{ steps.config.outputs.submitty_version }} to ${{ github.event.client_payload.ref_name }}" - body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) to version ${{ steps.config.outputs.submitty_version }} to ${{ github.event.client_payload.ref_name }}." \ No newline at end of file + title: "[Dependency] Update Submitty from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}" + body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) to version ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." \ No newline at end of file From d9947f3c4ce9e829f53245428c90d199fd8f55ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 02:14:38 -0400 Subject: [PATCH 13/28] pr path --- .github/workflows/bump-submitty.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index 4831d0f..9007fb2 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -43,6 +43,7 @@ jobs: uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.PAT }} + path: Localization commit-message: update version and base lang to ${{ github.event.client_payload.ref_name }} branch: bump-submitty/${{ github.event.client_payload.ref_name }} title: "[Dependency] Update Submitty from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}" From 7f2d1ecdf4d9389eaded96de56390fd9a3c9c8bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 02:19:23 -0400 Subject: [PATCH 14/28] committer --- .github/workflows/bump-submitty.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index 9007fb2..d257fb8 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -47,4 +47,5 @@ jobs: commit-message: update version and base lang to ${{ github.event.client_payload.ref_name }} branch: bump-submitty/${{ github.event.client_payload.ref_name }} title: "[Dependency] Update Submitty from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}" - body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) to version ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." \ No newline at end of file + body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." + committer: GitHub \ No newline at end of file From a7ffa19d6e0e7521d9ab059a3a2266c4b304e01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 02:21:39 -0400 Subject: [PATCH 15/28] author --- .github/workflows/bump-submitty.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index d257fb8..f4e00f7 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -48,4 +48,5 @@ jobs: branch: bump-submitty/${{ github.event.client_payload.ref_name }} title: "[Dependency] Update Submitty from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}" body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." - committer: GitHub \ No newline at end of file + committer: GitHub + author: GitHub \ No newline at end of file From ae2f01c36cdae68f38cc3571584ced71f790f6d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 02:25:49 -0400 Subject: [PATCH 16/28] Revert "author" This reverts commit a7ffa19d6e0e7521d9ab059a3a2266c4b304e01f. --- .github/workflows/bump-submitty.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index f4e00f7..d257fb8 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -48,5 +48,4 @@ jobs: branch: bump-submitty/${{ github.event.client_payload.ref_name }} title: "[Dependency] Update Submitty from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}" body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." - committer: GitHub - author: GitHub \ No newline at end of file + committer: GitHub \ No newline at end of file From 3e0d2257b9363e029e0b027c51945332dad6f1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 02:25:54 -0400 Subject: [PATCH 17/28] Revert "committer" This reverts commit 7f2d1ecdf4d9389eaded96de56390fd9a3c9c8bb. --- .github/workflows/bump-submitty.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index d257fb8..9007fb2 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -47,5 +47,4 @@ jobs: commit-message: update version and base lang to ${{ github.event.client_payload.ref_name }} branch: bump-submitty/${{ github.event.client_payload.ref_name }} title: "[Dependency] Update Submitty from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}" - body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." - committer: GitHub \ No newline at end of file + body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) to version ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." \ No newline at end of file From 6653177e3fb56bf8c0f5c42ad9c1c29266911e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 05:10:07 -0400 Subject: [PATCH 18/28] typo --- .github/workflows/bump-submitty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index 9007fb2..3f6e348 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -47,4 +47,4 @@ jobs: commit-message: update version and base lang to ${{ github.event.client_payload.ref_name }} branch: bump-submitty/${{ github.event.client_payload.ref_name }} title: "[Dependency] Update Submitty from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}" - body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) to version ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." \ No newline at end of file + body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) from version ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." \ No newline at end of file From 5e9242756c8e5d9386ec55c614b03a3aae5dee3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 05:23:32 -0400 Subject: [PATCH 19/28] link versions --- .github/workflows/bump-submitty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index 3f6e348..080a4c4 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -47,4 +47,4 @@ jobs: commit-message: update version and base lang to ${{ github.event.client_payload.ref_name }} branch: bump-submitty/${{ github.event.client_payload.ref_name }} title: "[Dependency] Update Submitty from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}" - body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) from version ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}." \ No newline at end of file + body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) from version [${{ steps.version.outputs.prop }}](https://github.com/${{ github.repository_owner }}/Submitty/releases/tag/${{ steps.version.outputs.prop }}) to [${{ github.event.client_payload.ref_name }}](https://github.com/${{ github.repository_owner }}/Submitty/releases/tag/${{ github.event.client_payload.ref_name }})." \ No newline at end of file From 2a8b6bbed58897ca054f6b82190a3c018ae35474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 15:28:51 -0400 Subject: [PATCH 20/28] split path --- bin/update-version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/update-version.py b/bin/update-version.py index 9281c43..cd57544 100644 --- a/bin/update-version.py +++ b/bin/update-version.py @@ -14,7 +14,7 @@ def get_args() -> Namespace: def get_template_data() -> dict: pattern = re.compile(r"localize\s*?\(\s*?(?P[\'\"])(?P[\w\.]+?)\s*?(?P=q1),\s*?(?P[\'\"])(?P.+?)(? Date: Sat, 24 Jun 2023 15:33:47 -0400 Subject: [PATCH 21/28] ubuntu-latest --- .github/workflows/bump-submitty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index 080a4c4..0299295 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -7,7 +7,7 @@ on: jobs: update-submitty: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: Update Submitty steps: - name: Checkout Submitty Repository From c5e620b50fa7eba7f689b77d4db30ea0440feb59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 15:49:51 -0400 Subject: [PATCH 22/28] venv --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0cafc1c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.venv/ \ No newline at end of file From e11649b9d52a292bc0039228d8185ea08a8c28d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 15:50:49 -0400 Subject: [PATCH 23/28] linting --- .flake8 | 4 +++ .github/workflows/localization-ci.yml | 37 +++++++++++++++++++++++++++ .yamllint | 10 ++++++++ 3 files changed, 51 insertions(+) create mode 100644 .flake8 create mode 100644 .github/workflows/localization-ci.yml create mode 100644 .yamllint diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..7851445 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +exclude= + .git, + .venv \ No newline at end of file diff --git a/.github/workflows/localization-ci.yml b/.github/workflows/localization-ci.yml new file mode 100644 index 0000000..e5fa45e --- /dev/null +++ b/.github/workflows/localization-ci.yml @@ -0,0 +1,37 @@ +name: Localization CI + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + checkout: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + yaml-lint: + name: YAML Lint + runs-on: ubuntu-latest + steps: + - name: Install yamllint + run: sudo apt-get install -y yamllint + - name: Run yamllint + run: yamllint . + + python-lint: + name: Python Lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install flake8 + run: | + python3 -m pip install --upgrade pip + python3 -m pip install flake8 flake8-bugbear + - name: Run flake8 + run: python3 -m flake8 diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..95af6ab --- /dev/null +++ b/.yamllint @@ -0,0 +1,10 @@ +extends: default + +rules: + line-length: disable + truthy: disable + document-start: disable + +ignore: + .git + .venv From 5ffe5da46dc7deaea671cb6db3152632cea6fcb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 15:51:49 -0400 Subject: [PATCH 24/28] fix checkout --- .github/workflows/localization-ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/localization-ci.yml b/.github/workflows/localization-ci.yml index e5fa45e..2a72e49 100644 --- a/.github/workflows/localization-ci.yml +++ b/.github/workflows/localization-ci.yml @@ -8,15 +8,11 @@ on: workflow_dispatch: jobs: - checkout: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - yaml-lint: name: YAML Lint runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - name: Install yamllint run: sudo apt-get install -y yamllint - name: Run yamllint @@ -26,6 +22,7 @@ jobs: name: Python Lint runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: 3.11 From a56825c33241ee9eed7224dd4f93d549da2f7240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 15:53:21 -0400 Subject: [PATCH 25/28] yaml lint fix --- .github/workflows/bump-submitty.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump-submitty.yml b/.github/workflows/bump-submitty.yml index 0299295..3ac7ade 100644 --- a/.github/workflows/bump-submitty.yml +++ b/.github/workflows/bump-submitty.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v3 with: path: Localization - + - name: Get version id: version uses: notiz-dev/github-action-json-property@v0.2.0 @@ -47,4 +47,4 @@ jobs: commit-message: update version and base lang to ${{ github.event.client_payload.ref_name }} branch: bump-submitty/${{ github.event.client_payload.ref_name }} title: "[Dependency] Update Submitty from ${{ steps.version.outputs.prop }} to ${{ github.event.client_payload.ref_name }}" - body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) from version [${{ steps.version.outputs.prop }}](https://github.com/${{ github.repository_owner }}/Submitty/releases/tag/${{ steps.version.outputs.prop }}) to [${{ github.event.client_payload.ref_name }}](https://github.com/${{ github.repository_owner }}/Submitty/releases/tag/${{ github.event.client_payload.ref_name }})." \ No newline at end of file + body: "Bumps [Submitty](https://github.com/${{ github.repository_owner }}/Submitty) from version [${{ steps.version.outputs.prop }}](https://github.com/${{ github.repository_owner }}/Submitty/releases/tag/${{ steps.version.outputs.prop }}) to [${{ github.event.client_payload.ref_name }}](https://github.com/${{ github.repository_owner }}/Submitty/releases/tag/${{ github.event.client_payload.ref_name }})." From 1c67fdfb6734fdad894fd5f5c3ac7055ea6bc046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Sat, 24 Jun 2023 16:05:02 -0400 Subject: [PATCH 26/28] py lint fix --- .flake8 | 1 + bin/update-version.py | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.flake8 b/.flake8 index 7851445..7e8348b 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,5 @@ [flake8] +max-line-length=100 exclude= .git, .venv \ No newline at end of file diff --git a/bin/update-version.py b/bin/update-version.py index cd57544..a81b428 100644 --- a/bin/update-version.py +++ b/bin/update-version.py @@ -12,14 +12,15 @@ def get_args() -> Namespace: def get_template_data() -> dict: - pattern = re.compile(r"localize\s*?\(\s*?(?P[\'\"])(?P[\w\.]+?)\s*?(?P=q1),\s*?(?P[\'\"])(?P.+?)(?[\'\"])(?P[\w\.]+?)\s*?(?P=q1)" + r",\s*?(?P[\'\"])(?P.+?)(? dict: last_key = tree.pop() - loc = data # Current location in tree (should always be dict) + loc = data # Current location in tree (should always be dict) for key in tree: if key in loc: loc = loc[key] @@ -46,11 +47,11 @@ def get_template_data() -> dict: else: loc[key] = dict() loc = loc[key] - + if not isinstance(loc, dict): raise KeyError('Duplicate template key found: ' + key) loc[last_key] = val - + return data From ed312872bd2e5edd1f07c41f0155da33b1b1af60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1tvik=20Karanam?= <89281036+skara9@users.noreply.github.com> Date: Mon, 26 Jun 2023 14:13:58 -0400 Subject: [PATCH 27/28] Update config.json --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index a548d77..8e49d06 100644 --- a/config.json +++ b/config.json @@ -1,3 +1,3 @@ { - "submitty_version": "v23.06.01" -} \ No newline at end of file + "submitty_version": "v0.0.1" +} From e6bd397e32585ff3af541cfd7c37d784e35ccc2d Mon Sep 17 00:00:00 2001 From: skara9 Date: Mon, 26 Jun 2023 18:16:03 +0000 Subject: [PATCH 28/28] update version and base lang to v0.0.2 --- config.json | 4 ++-- lang/en_US.json | 47 +---------------------------------------------- 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/config.json b/config.json index 8e49d06..aa9292c 100644 --- a/config.json +++ b/config.json @@ -1,3 +1,3 @@ { - "submitty_version": "v0.0.1" -} + "submitty_version": "v0.0.2" +} \ No newline at end of file diff --git a/lang/en_US.json b/lang/en_US.json index 5453d6b..9e26dfe 100644 --- a/lang/en_US.json +++ b/lang/en_US.json @@ -1,46 +1 @@ -{ - "profile": { - "my_profile": "My Profile", - "upload_profile_photo": "Upload profile photo", - "basic_information": "Basic Information", - "username": "Username", - "given_name": "First Name", - "family_name": "Last Name", - "email_primary": "Primary Email", - "email_secondary": "Secondary Email", - "send_email_to_secondary": "Send Email to Secondary Address", - "access_level": "Access Level", - "change_password": "Change Password", - "timezone": "Time Zone", - "utc_offset": "UTC Offset", - "select_timezone": "Select Timezone", - "color_theme": "Color Theme", - "choose_color_theme": "Choose a color theme", - "color_themes": { - "system": "Follow Device Theme", - "light": "Light Mode", - "dark": "Dark Mode", - "black": "(Black)" - }, - "pwa_messages": { - "browser_support": { - "a": "Submitty supports an installable Progressive Web App (PWA) which requires Chrome, see ", - "b": "here", - "c": " for installation instructions" - }, - "install_app": "Install App", - "uninstall_lable": { - "a": "The Submitty Progressive Web App (PWA) has already been installed, see ", - "b": "here", - "c": " to uninstall it" - } - }, - "image_flagged_msg": "Your preferred image was flagged as inappropriate." - }, - "globals": { - "bools": { - "true": "True", - "false": "False" - } - } -} \ No newline at end of file +{} \ No newline at end of file