-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependencies for repo root * Update dependencies for system-tests * Update dependencies for cms * npm audit for cms * Update dependencies for course-material * npm audit for course-material * Update dependencies for example-exercise * npm audit for example-exercise * Update dependencies for main-frontend * npm audit for main-frontend * Update dependencies for quizzes * npm audit for quizzes * Update dependencies for tmc * npm audit for tmc * Update dependencies for shared-module * npm audit for shared-module * Cargo upgrade * Cargo update * Update rust version, downgrade resvg and usvg * Downgrade next for cms * Generate gutenberg types * System test fixes * Eslint fixes * Storybook fixes * Cargo test fixes * Retry multiple-choice dropdown test * Retry more tests * Add playwright-install * Fix eslint-plugin-i18next * Add missing translations * fix * Test stability fix * Test stability fix
- Loading branch information
Showing
133 changed files
with
8,968 additions
and
7,398 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
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,11 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
source "$(dirname "$0")/.common" | ||
|
||
BASEDIR="$(dirname "${BASH_SOURCE[0]}")" | ||
FOLDER_PATH="$BASEDIR/../system-tests" | ||
RELATIVE_PATH=$(realpath --relative-to="$(pwd)" "$FOLDER_PATH") | ||
|
||
run_command cd "$RELATIVE_PATH" || exit | ||
|
||
run_command npx playwright install "$@" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
source "$(dirname "$0")/.common" | ||
#!/usr/bin/env python3 | ||
|
||
BASEDIR="$(dirname "${BASH_SOURCE[0]}")" | ||
TRANSLATIONS_EN_PATH="$BASEDIR/../shared-module/src/locales/en" | ||
TRANSLATIONS_EN_RELATIVE_PATH=$(realpath --relative-to="$(pwd)" "$TRANSLATIONS_EN_PATH") | ||
FOLDERS_PATH="$BASEDIR/../shared-module/src/locales" | ||
FOLDERS_RELATIVE_PATH=$(realpath --relative-to="$(pwd)" "$FOLDERS_PATH") | ||
import os | ||
import subprocess | ||
import glob | ||
import json | ||
|
||
ensure_program_in_path jq | ||
ensure_program_in_path find | ||
ensure_program_in_path sponge | ||
BASEDIR = os.path.dirname(os.path.realpath(__file__)) | ||
TRANSLATIONS_EN_PATH = os.path.join(BASEDIR, "../shared-module/src/locales/en") | ||
TRANSLATIONS_EN_RELATIVE_PATH = os.path.relpath(TRANSLATIONS_EN_PATH) | ||
FOLDERS_PATH = os.path.join(BASEDIR, "../shared-module/src/locales") | ||
FOLDERS_RELATIVE_PATH = os.path.relpath(FOLDERS_PATH) | ||
|
||
EN_PATHS=$(find "$TRANSLATIONS_EN_RELATIVE_PATH" -name '*.json') | ||
# Find all localization folders that are not the source en folder | ||
FOLDERS_PATH=$(find "$FOLDERS_RELATIVE_PATH" -maxdepth 1 -mindepth 1 -type d ! -name 'en') | ||
def ensure_program_in_path(program): | ||
if not any(os.access(os.path.join(path, program), os.X_OK) for path in os.environ["PATH"].split(os.pathsep)): | ||
raise Exception(f"{program} not found in PATH") | ||
|
||
for original_file in $EN_PATHS; do | ||
for target_folder in $FOLDERS_PATH; do | ||
target_folder_language=$(basename "$target_folder") | ||
target_file="${original_file/\/en\//\/$target_folder_language\/}" | ||
echo "Adding translations $original_file > $target_file" | ||
echo "> jq -s 'add' \"$original_file\" \"$target_file\" | sponge \"$target_file\"" | ||
jq --sort-keys -s 'add' "$original_file" "$target_file" | sponge "$target_file" | ||
done | ||
done | ||
ensure_program_in_path('jq') | ||
ensure_program_in_path('sponge') | ||
|
||
echo "" | ||
echo "Important: remember to translate the new strings before adding them to version control" | ||
EN_PATHS = glob.glob(f"{TRANSLATIONS_EN_RELATIVE_PATH}/*.json") | ||
FOLDERS_PATH = [name for name in glob.glob(f"{FOLDERS_RELATIVE_PATH}/*") if os.path.isdir(name) and not name.endswith('/en')] | ||
|
||
for original_file in EN_PATHS: | ||
for target_folder in FOLDERS_PATH: | ||
target_folder_language = os.path.basename(target_folder) | ||
target_file = original_file.replace("/en/", f"/{target_folder_language}/") | ||
print(f"Adding translations {original_file} > {target_file}") | ||
with open(original_file) as f1, open(target_file) as f2: | ||
data1 = json.load(f1) | ||
data2 = json.load(f2) | ||
missing_keys = [key for key in data1 if key not in data2] | ||
for key in missing_keys: | ||
data2[key] = data1[key] | ||
with open(target_file, 'w') as f: | ||
json.dump(data2, f, indent=2, ensure_ascii=False) | ||
|
||
print("\nImportant: remember to translate the new strings before adding them to version control") |
Oops, something went wrong.