User:Cmglee/extract lang.py

This Python3 script by user:cmglee extracts and writes a monolingual SVG file from a multilingual SVG file, to let a language version be previewed in a Web browser during its development. (The alternative way to view a non-default language in a multilingual SVG in a Web browser is to install and change the language of the browser and restart it.)

Output filenames are the original filename with "-" added before the last ".".

Usage
ISO639_CODE is as listed on commons:template:list of supported languages. If no codes are provided, all languages found in the file (and the default) are output.

Source code
As Wikimedia does not allow general executable files to be uploaded, the source code is provided below