feat: language support via locale config (#96)
Co-authored-by: hiroki osame <hiroki.osame@gmail.com>
This commit is contained in:
committed by
GitHub
parent
4876e8d966
commit
58ce61eab8
@@ -26,6 +26,12 @@ const configParsers = {
|
||||
|
||||
return key;
|
||||
},
|
||||
locale(key: string) {
|
||||
parseAssert('locale', key, 'Cannot be empty');
|
||||
parseAssert('locale', /^[a-z-]+$/i.test(key), 'Must be a valid locale (letters and dashes/underscores). You can consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes');
|
||||
|
||||
return key;
|
||||
},
|
||||
generate(key: string) {
|
||||
parseAssert('generate', key, 'Cannot be empty');
|
||||
parseAssert('generate', /^\d+$/.test(key), 'Must be an integer');
|
||||
|
||||
Reference in New Issue
Block a user