|
15 | 15 | dialogs = f"{tx}/{lang}/dialogs.json"
|
16 | 16 | vocs = f"{tx}/{lang}/vocabs.json"
|
17 | 17 | regexes = f"{tx}/{lang}/regexes.json"
|
18 |
| - os.makedirs(f"{locale}/{lang}", exist_ok=True) |
| 18 | + os.makedirs(f"{locale}/{lang.lower()}", exist_ok=True) |
19 | 19 | if os.path.isfile(intents):
|
20 | 20 | with open(intents) as f:
|
21 | 21 | data = json.load(f)
|
22 | 22 | for fid, samples in data.items():
|
23 | 23 | if samples:
|
24 | 24 | samples = [s for s in samples if s] # s may be None
|
25 |
| - with open(f"{locale}/{lang}/{fid}", "w") as f: |
| 25 | + with open(f"{locale}/{lang.lower()}/{fid}", "w") as f: |
26 | 26 | f.write("\n".join(sorted(samples)))
|
27 | 27 |
|
28 | 28 | if os.path.isfile(dialogs):
|
|
31 | 31 | for fid, samples in data.items():
|
32 | 32 | if samples:
|
33 | 33 | samples = [s for s in samples if s] # s may be None
|
34 |
| - with open(f"{locale}/{lang}/{fid}", "w") as f: |
| 34 | + with open(f"{locale}/{lang.lower()}/{fid}", "w") as f: |
35 | 35 | f.write("\n".join(sorted(samples)))
|
36 | 36 |
|
37 | 37 | if os.path.isfile(vocs):
|
|
40 | 40 | for fid, samples in data.items():
|
41 | 41 | if samples:
|
42 | 42 | samples = [s for s in samples if s] # s may be None
|
43 |
| - with open(f"{locale}/{lang}/{fid}", "w") as f: |
| 43 | + with open(f"{locale}/{lang.lower()}/{fid}", "w") as f: |
44 | 44 | f.write("\n".join(sorted(samples)))
|
45 | 45 |
|
46 | 46 | if os.path.isfile(regexes):
|
|
49 | 49 | for fid, samples in data.items():
|
50 | 50 | if samples:
|
51 | 51 | samples = [s for s in samples if s] # s may be None
|
52 |
| - with open(f"{locale}/{lang}/{fid}", "w") as f: |
| 52 | + with open(f"{locale}/{lang.lower()}/{fid}", "w") as f: |
53 | 53 | f.write("\n".join(sorted(samples)))
|
54 | 54 |
|
0 commit comments