File tree 10 files changed +70
-7
lines changed
TranslationChecker/TranslationChecker
10 files changed +70
-7
lines changed Original file line number Diff line number Diff line change
1
+ name : Translate
2
+ on : [push]
3
+
4
+ jobs :
5
+ update :
6
+ runs-on : windows-latest
7
+ permissions :
8
+ contents : write
9
+ steps :
10
+ - name : Checkout
11
+ uses : actions/checkout@v4
12
+
13
+ - uses : actions/setup-java@v4
14
+ with :
15
+ distribution : ' temurin'
16
+ java-version : ' 21'
17
+
18
+ - name : Generate template
19
+ run : |
20
+ git clone https://github.com/x64dbg/translations --branch translations
21
+ git clone --depth 1 https://github.com/x64dbg/x64dbg
22
+ cd x64dbg
23
+ mkdir bin\translations
24
+ git ls-files *.java *.jui *.ui *.c *.c++ *.cc *.cpp *.cxx *.ch *.h *.h++ *.hh *.hpp *.hxx *.js *.qs *.qml *.qrc > bin\translations\files.lst
25
+ ..\lupdate.exe @bin\translations\files.lst -locations absolute -ts x64dbg.ts
26
+ Copy-Item ".\x64dbg.ts" -Destination "..\x64dbg.ts" -Force
27
+
28
+ - name : Crowdin sync
29
+ env :
30
+ CROWDIN_API_KEY : ${{ secrets.CROWDIN_API_KEY }}
31
+ run : |
32
+ .\crowdin-sync.bat
33
+
34
+ - name : Push translations
35
+ shell : bash
36
+ run : cd translations && ./update.sh
37
+
38
+ - name : Upload Qt translations
39
+ uses : actions/upload-artifact@v4
40
+ with :
41
+ name : translations-qm
42
+ path : translations/*.qm
43
+
44
+ - name : Upload crowdin translations
45
+ uses : actions/upload-artifact@v4
46
+ with :
47
+ name : translations-ts
48
+ path : translations/*.ts
49
+
50
+
51
+
52
+
Original file line number Diff line number Diff line change 1
1
* .ts
2
2
* .qm
3
- * .jar
4
3
* .zip
5
4
* .log
6
5
translations /
6
+ x64dbg /
Original file line number Diff line number Diff line change @@ -95,7 +95,20 @@ static bool CheckSerialize(string tsFile)
95
95
XmlSerializer serializer = new XmlSerializer ( typeof ( QtTranslations ) ) ;
96
96
using ( var reader = new StringReader ( xml ) )
97
97
{
98
- var test = ( QtTranslations ) serializer . Deserialize ( reader ) ;
98
+ QtTranslations test = null ;
99
+ try
100
+ {
101
+ test = ( QtTranslations ) serializer . Deserialize ( reader ) ;
102
+ }
103
+ catch ( Exception x )
104
+ {
105
+ // NOTE: This can happen if there is a \r in the string to translate, like this:
106
+ // <source>Trace recording has stopped unexpectedly because WriteFile() failed. GetLastError() = %s.<byte value="xd"/>
107
+ // </ source >
108
+ Console . WriteLine ( $ "Deserialization error with file: { tsFile } ") ;
109
+ Console . WriteLine ( x ) ;
110
+ return false ;
111
+ }
99
112
using ( var writer = new Utf8StringWriter ( ) )
100
113
using ( var xw = XmlWriter . Create ( writer , new XmlWriterSettings
101
114
{
Original file line number Diff line number Diff line change 1
1
@ echo off
2
2
3
3
echo Uploading English sources to Crowdin...
4
- java -jar crowdin-cli.jar upload sources --no-colors --no-progress > upload.log 2 >& 1
4
+ java -jar crowdin-cli.jar upload sources --no-colors --no-progress
5
5
if not %ERRORLEVEL% == 0 (
6
- type upload.log
7
6
exit /b 1
8
7
)
9
8
10
9
echo Downloading translations from Crowdin...
11
10
rmdir /S /Q translations > nul 2 >& 1
12
- java -jar crowdin-cli.jar download --no-colors --no-progress > download.log 2 >& 1
11
+ java -jar crowdin-cli.jar download --no-colors --no-progress
13
12
if not %ERRORLEVEL% == 0 (
14
- type download.log
15
13
exit /b 1
16
14
)
17
15
18
16
echo Checking translations...
19
- TranslationChecker.exe translations --fix
17
+ TranslationChecker.exe translations
20
18
set CHECKER_ERRORLEVEL = %ERRORLEVEL%
21
19
22
20
echo Generating Qt translations...
You can’t perform that action at this time.
0 commit comments