feat: add String localization support

Signed-off-by: The one with the braid <the-one@with-the-braid.cf>
This commit is contained in:
The one with the braid 2023-08-27 18:58:07 +02:00
parent 78f88305ec
commit e345763813
10 changed files with 173 additions and 13 deletions

View file

@ -0,0 +1,10 @@
abstract class LProjParser {
const LProjParser._();
static Map<String, String> parse(String stringsFile) => Map.fromEntries(
RegExp(r'"((?:\\"|[^"])*)"\s?=\s?"((?:\\"|[^"])*)"\s?;')
.allMatches(stringsFile)
.map(
(match) => MapEntry(match.group(1)!, match.group(2)!),
),
);
}