Qt:
DETACHED language file handling from MSVC project file ADDED Windows shell scripts for creating language files UPDATED how-to
This commit is contained in:
parent
ee8906b92e
commit
667fb7a175
|
@ -1,11 +1,13 @@
|
||||||
How to create a new translation:
|
How to create a new translation:
|
||||||
|
|
||||||
- Add "TRANSLATIONS += language.ts" to vba-m.pro
|
For Windows:
|
||||||
- Call "lupdate vba-m.pro" to create the .ts file
|
|
||||||
|
- Add "TRANSLATIONS += path/to/language.ts" to vba-m.pro
|
||||||
|
|
||||||
|
- Execute the "update.cmd" script to create .ts files
|
||||||
|
|
||||||
- Edit & translate the .ts file with the "Qt Linguist" tool
|
- Edit & translate the .ts file with the "Qt Linguist" tool
|
||||||
- Call "lrelease vba-m.pro" to create the compiled .qm file
|
|
||||||
- Load the language file in the application:
|
- Execute the "release.cmd" script to compile it to a .qm file
|
||||||
<<
|
|
||||||
QTranslator translator;
|
- The .qm file can now be loaded & used by the application
|
||||||
translator.load( "language" ); // without .qm ending
|
|
||||||
>>
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
cd ..\project\qmake
|
||||||
|
lrelease vba-m.pro
|
|
@ -0,0 +1,2 @@
|
||||||
|
cd ..\project\qmake
|
||||||
|
lupdate vba-m.pro
|
|
@ -24,9 +24,9 @@
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCNMakeTool"
|
Name="VCNMakeTool"
|
||||||
BuildCommandLine="qmake -makefile -win32 "CONFIG+=debug" ..\qmake\vba-m.pro
nmake debug
lupdate ..\qmake\vba-m.pro"
|
BuildCommandLine="qmake -makefile -win32 "CONFIG+=debug" ..\qmake\vba-m.pro
nmake debug"
|
||||||
ReBuildCommandLine=""
|
ReBuildCommandLine=""
|
||||||
CleanCommandLine="nmake distclean
rmdir /S /Q debug
rmdir /S /Q release
"
|
CleanCommandLine="nmake distclean
rmdir /S /Q debug
rmdir /S /Q release"
|
||||||
Output="$(OutDir)\VisualBoyAdvance.exe"
|
Output="$(OutDir)\VisualBoyAdvance.exe"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG"
|
PreprocessorDefinitions="WIN32;_DEBUG"
|
||||||
IncludeSearchPath=""
|
IncludeSearchPath=""
|
||||||
|
@ -44,9 +44,9 @@
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCNMakeTool"
|
Name="VCNMakeTool"
|
||||||
BuildCommandLine="qmake -makefile -win32 ..\qmake\vba-m.pro
nmake release
upx -9 "$(TargetPath)"
lrelease ..\qmake\vba-m.pro
echo "Copying translation files to release directory..."
mkdir $(OutDir)\lang
copy /Y ..\..\lang\*.qm $(OutDir)\lang"
|
BuildCommandLine="qmake -makefile -win32 ..\qmake\vba-m.pro
nmake release
upx --best "$(TargetPath)""
|
||||||
ReBuildCommandLine=""
|
ReBuildCommandLine=""
|
||||||
CleanCommandLine="nmake distclean
rmdir /S /Q debug
rmdir /S /Q release
"
|
CleanCommandLine="nmake distclean
rmdir /S /Q debug
rmdir /S /Q release"
|
||||||
Output="$(OutDir)\VisualBoyAdvance.exe"
|
Output="$(OutDir)\VisualBoyAdvance.exe"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||||
IncludeSearchPath=""
|
IncludeSearchPath=""
|
||||||
|
@ -98,19 +98,6 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
|
||||||
Name="Translations"
|
|
||||||
Filter="ts;qm"
|
|
||||||
>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\lang\german.ts"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\lang\spanish.ts"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
<Filter
|
||||||
Name="Other"
|
Name="Other"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue