DETACHED language file handling from MSVC project file
ADDED Windows shell scripts for creating language files
UPDATED how-to
This commit is contained in:
spacy51 2008-02-10 14:06:52 +00:00
parent ee8906b92e
commit 667fb7a175
4 changed files with 18 additions and 25 deletions

View File

@ -1,11 +1,13 @@
How to create a new translation:
- Add "TRANSLATIONS += language.ts" to vba-m.pro
- Call "lupdate vba-m.pro" to create the .ts file
For Windows:
- 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
- Call "lrelease vba-m.pro" to create the compiled .qm file
- Load the language file in the application:
<<
QTranslator translator;
translator.load( "language" ); // without .qm ending
>>
- Execute the "release.cmd" script to compile it to a .qm file
- The .qm file can now be loaded & used by the application

2
lang/release.cmd Normal file
View File

@ -0,0 +1,2 @@
cd ..\project\qmake
lrelease vba-m.pro

2
lang/update.cmd Normal file
View File

@ -0,0 +1,2 @@
cd ..\project\qmake
lupdate vba-m.pro

View File

@ -24,9 +24,9 @@
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="qmake -makefile -win32 &quot;CONFIG+=debug&quot; ..\qmake\vba-m.pro&#x0D;&#x0A;nmake debug&#x0D;&#x0A;lupdate ..\qmake\vba-m.pro"
BuildCommandLine="qmake -makefile -win32 &quot;CONFIG+=debug&quot; ..\qmake\vba-m.pro&#x0D;&#x0A;nmake debug"
ReBuildCommandLine=""
CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release&#x0D;&#x0A;"
CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release"
Output="$(OutDir)\VisualBoyAdvance.exe"
PreprocessorDefinitions="WIN32;_DEBUG"
IncludeSearchPath=""
@ -44,9 +44,9 @@
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="qmake -makefile -win32 ..\qmake\vba-m.pro&#x0D;&#x0A;nmake release&#x0D;&#x0A;upx -9 &quot;$(TargetPath)&quot;&#x0D;&#x0A;lrelease ..\qmake\vba-m.pro&#x0D;&#x0A;echo &quot;Copying translation files to release directory...&quot;&#x0D;&#x0A;mkdir $(OutDir)\lang&#x0D;&#x0A;copy /Y ..\..\lang\*.qm $(OutDir)\lang"
BuildCommandLine="qmake -makefile -win32 ..\qmake\vba-m.pro&#x0D;&#x0A;nmake release&#x0D;&#x0A;upx --best &quot;$(TargetPath)&quot;"
ReBuildCommandLine=""
CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release&#x0D;&#x0A;"
CleanCommandLine="nmake distclean&#x0D;&#x0A;rmdir /S /Q debug&#x0D;&#x0A;rmdir /S /Q release"
Output="$(OutDir)\VisualBoyAdvance.exe"
PreprocessorDefinitions="WIN32;NDEBUG"
IncludeSearchPath=""
@ -98,19 +98,6 @@
>
</File>
</Filter>
<Filter
Name="Translations"
Filter="ts;qm"
>
<File
RelativePath="..\..\lang\german.ts"
>
</File>
<File
RelativePath="..\..\lang\spanish.ts"
>
</File>
</Filter>
<Filter
Name="Other"
>