Problem/Motivation
White screen of death when using a key for a brand new project with no assets in it
Steps to reproduce
When setting up this module I pointed it at an empty Loco project to test. This causes a division by zero error in the template.
{% set percent = (locale.progress.translated / variables.assets|length * 100)|number_format(2, '.') %}
Proposed resolution
Wrap the twig snippet in an if statement with proposed action to add some assets..
Remaining tasks
Code. Test
User interface changes
Wording to explain empty project.
API changes
None
Data model changes
None
Comments
Comment #2
wengerkMR in review on https://git.drupalcode.org/project/loco_translate/-/merge_requests/13/diffs
Comment #3
wengerkComment #4
wengerkHere's the patch
Comment #5
wengerkMerged in dev branch 3.0.x