BartyCrouch icon indicating copy to clipboard operation
BartyCrouch copied to clipboard

Integrate with Tests to create screenshots for translation keys

Open Jeehut opened this issue 4 years ago • 0 comments

The idea is that for translators, it would be great to have some context for the translations. For this, automated unit / UI tests could be used where the accessory APIs could help finding the translations and match them to the Strings files. Then, a JSON file could be created that contains both the translation key, different translations per language and also a file name of the screenshot. Then, another tool or service could use these outputs (JSON file and screenshots) to show screenshots related to keys.

An alternative output method could be that the screenshots are automatically named after the keys (+ language), e.g. the key onboarding.page_1.title could result in a JPG file (so save space) named onboarding.page_1.title-de.jpg for the language German. The image then should have some kind of hint to the position of the string, e.g. the bounds could be used to draw a rectangle, whose color and line width could be made configurable.

Actually, probably no JSON output is needed if the images just follow the key names and include the language name as well.

Note that there should also be a statistics stating the "Translation Screenshot Coverage" of all the tests in a given project. This value would be similar to "Code Coverage" but only related to translation keys. Also a command could output the list of not-yet covered translation keys.

Jeehut avatar Feb 06 '20 07:02 Jeehut