Update locale length test

This commit is contained in:
Vince Grassia 2021-05-13 16:28:36 -04:00
parent 3d66e75ba1
commit cb07bc2300
1 changed files with 13 additions and 18 deletions

View File

@ -48,26 +48,21 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v2
- name: Testing locale lengths
- name: Testing locales - extName length
run: |
errors=0
echo "Testing locales extName lengths"
echo "All must be 40 or less for Safari"
echo "================================="
for file in $(ls src/_locales/);
do
test_string=$(cat src/_locales/$file/messages.json | jq .extName.message | tr -d '"')
if [[ ${#test_string} -gt 40 ]]; then
echo $file: ${#test_string}
errors=1
fi
exit_status=0
echo "extName string must be 40 characters or less"
echo "===================================="
for locale in $(ls src/_locales/); do
string_length=$(jq '.extName.message | length' src/_locales/$locale/messages.json)
if [[ $string_length -gt 40 ]]; then
echo $locale: $string_length
exit_status=1
fi
done
if [[ $errors -eq 1 ]]; then
exit 1
else
echo "Test passed"
fi
exit $exit_status
build:
runs-on: windows-latest