1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-29 12:55:21 +01:00

Update release workflow with locales test

This commit is contained in:
Vince Grassia 2021-05-13 17:08:18 -04:00
parent 1c3db8e18e
commit 1a4e8debd6

View File

@ -71,28 +71,30 @@ jobs:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Testing locale lengths - name: Testing locales - extName length
run: | run: |
errors=0 found_error=false
echo "Testing locales extName lengths"
echo "All must be 40 or less for Safari" echo "Locales Test"
echo "=================================" echo "============"
for file in $(ls src/_locales/); echo "extName string must be 40 characters or less"
do echo
test_string=$(cat src/_locales/$file/messages.json | jq .extName.message | tr -d '"') for locale in $(ls src/_locales/); do
if [[ ${#test_string} -gt 40 ]]; then string_length=$(jq '.extName.message | length' src/_locales/$locale/messages.json)
echo $file: ${#test_string} if [[ $string_length -gt 40 ]]; then
errors=1 echo "$locale: $string_length"
found_error=true
fi fi
done done
if [[ $errors -eq 1 ]]; then if $found_error; then
echo
echo "Please fix 'extName' for the locales listed above."
exit 1 exit 1
else else
echo "Test passed" echo "Test passed!"
fi fi
build: build:
runs-on: windows-latest runs-on: windows-latest
needs: [ setup, locales-test ] needs: [ setup, locales-test ]