Sfoglia il codice sorgente

Fix translation script for weird OS encodings

tags/v0.11.0-beta
Daniel Oaks 6 anni fa
parent
commit
379dd73b36
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3
    3
      updatetranslations.py

+ 3
- 3
updatetranslations.py Vedi File

42
             for fname in files:
42
             for fname in files:
43
                 filepath = subdir + os.sep + fname
43
                 filepath = subdir + os.sep + fname
44
                 if filepath.endswith('.go'):
44
                 if filepath.endswith('.go'):
45
-                    content = open(filepath, 'r').read()
45
+                    content = open(filepath, 'r', encoding='UTF-8').read()
46
 
46
 
47
                     matches = re.findall(r'\.t\("((?:[^"]|\\")+)"\)', content)
47
                     matches = re.findall(r'\.t\("((?:[^"]|\\")+)"\)', content)
48
                     for match in matches:
48
                     for match in matches:
64
             for fname in files:
64
             for fname in files:
65
                 filepath = subdir + os.sep + fname
65
                 filepath = subdir + os.sep + fname
66
                 if fname == 'help.go':
66
                 if fname == 'help.go':
67
-                    content = open(filepath, 'r').read()
67
+                    content = open(filepath, 'r', encoding='UTF-8').read()
68
 
68
 
69
                     matches = re.findall(r'\`([^\`]+)\`', content)
69
                     matches = re.findall(r'\`([^\`]+)\`', content)
70
                     for match in matches:
70
                     for match in matches:
83
             for fname in files:
83
             for fname in files:
84
                 filepath = subdir + os.sep + fname
84
                 filepath = subdir + os.sep + fname
85
                 if fname == 'nickserv.go':
85
                 if fname == 'nickserv.go':
86
-                    content = open(filepath, 'r').read()
86
+                    content = open(filepath, 'r', encoding='UTF-8').read()
87
 
87
 
88
                     matches = re.findall(r'\`([^\`]+)\`', content)
88
                     matches = re.findall(r'\`([^\`]+)\`', content)
89
                     for match in matches:
89
                     for match in matches:

Loading…
Annulla
Salva