Re: AbiWord Windows builds and L10n workflow
Prashant Bafna <[email protected]>
| Newsgroups | gmane.editors.abiword.devel |
|---|---|
| Message-ID | <CAGWtQ3LWx2dx0Y3kGR6-Km3+2i9haUJ3KKPwi00PG44a1=XyGQ@mail.gmail.com> |
Hi, I tried my hands at it and did the following : 1. About the Perl script ui-backport.pl - I was getting basename related errors while running this on Windows, so i modified it a bit (Suggested Patch Attached), so as to make it work in Windows as well. 2. To convert the PO file to Strings files during the build, I created a Post Build event for LibAbiWord which runs the above Perl script and converts the PO files to Strings files and then moves them to (OutDir)\strings. With this we would no longer need the strings folder in user/wp for the windows build as well. (Patch for this attached as well) However what we have done here is made Perl a requirement for the Windows build, which earlier was not the case. Thanks, Prashant
Add_POtoStrings_Convert_LibAbiWord.patch
(application/octet-stream, 12.7 KB)
Index: LibAbiWord.vcproj =================================================================== --- LibAbiWord.vcproj (revision 31421) +++ LibAbiWord.vcproj (working copy) @@ -92,7 +92,7 @@ <Tool Name="VCPostBuildEventTool" Description="Copying strings and templates..." - CommandLine="rmdir /S /Q "$(OutDir)\strings"
mkdir "$(OutDir)\strings"
xcopy /E "$(SolutionDir)..\user\wp\strings\*.strings" "$(OutDir)\strings"
rmdir /S /Q "$(OutDir)\profiles"
mkdir "$(OutDir)\profiles"
xcopy /Y "$(SolutionDir)..\user\wp\system.profile*" "$(OutDir)\profiles"
rmdir /S /Q "$(OutDir)\templates"
mkdir "$(OutDir)\templates"
xcopy /E "$(SolutionDir)..\user\wp\templates\*.awt*" "$(OutDir)\templates"
xcopy /Y "$(SolutionDir)\Prefix\bin\bz2-1.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libenchant.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libfribidi-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libglib-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgio-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgmodule-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgobject-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgsf-1-114.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgthread-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libintl-8.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libjpeg-62.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libpng12-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libpng15.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libwv-1-2-4.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libxml2-2.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\zlib1.dll" "$(OutDir)\bin"
rmdir /S /Q "$(OutDir)\clipart"
mkdir "$(OutDir)\clipart"
xcopy /E "$(SolutionDir)..\user\wp\clipart\*.png" "$(OutDir)\clipart"
mkdir "$(OutDir)\dictionary\ispell"
mkdir "$(OutDir)\dictionary\myspell"
xcopy /Y "$(SolutionDir)..\user\wp\dictionary\american.hash" "$(OutDir)\dictionary\ispell"
mkdir "$(OutDir)\lib\enchant"
xcopy /Y "$(SolutionDir)\Prefix\lib\enchant\*.dll" "$(OutDir)\lib\enchant"
rmdir /S /Q "$(OutDir)\xsltml"
mkdir "$(OutDir)\xsltml"
xcopy /Y "$(SolutionDir)..\plugins\latex\xsltml\*.*" "$(OutDir)\xsltml"
" + CommandLine="rmdir /S /Q "$(OutDir)\strings"
mkdir "$(OutDir)\strings"
FOR %%f in ("$(SolutionDir)..\po\*.po") DO ( perl $(SolutionDir)..\po\ui-backport.pl $(SolutionDir)..\po\%%~nf.po $(SolutionDir)..\po\%%~nf.strings )
xcopy /E "$(SolutionDir)..\po\*.strings" "$(OutDir)\strings"
del "$(SolutionDir)..\po\*.strings"
rmdir /S /Q "$(OutDir)\profiles"
mkdir "$(OutDir)\profiles"
xcopy /Y "$(SolutionDir)..\user\wp\system.profile*" "$(OutDir)\profiles"
rmdir /S /Q "$(OutDir)\templates"
mkdir "$(OutDir)\templates"
xcopy /E "$(SolutionDir)..\user\wp\templates\*.awt*" "$(OutDir)\templates"
xcopy /Y "$(SolutionDir)\Prefix\bin\bz2-1.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libenchant.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libfribidi-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libglib-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgio-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgmodule-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgobject-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgsf-1-114.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgthread-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libintl-8.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libjpeg-62.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libpng12-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libpng15.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libwv-1-2-4.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libxml2-2.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\zlib1.dll" "$(OutDir)\bin"
rmdir /S /Q "$(OutDir)\clipart"
mkdir "$(OutDir)\clipart"
xcopy /E "$(SolutionDir)..\user\wp\clipart\*.png" "$(OutDir)\clipart"
mkdir "$(OutDir)\dictionary\ispell"
mkdir "$(OutDir)\dictionary\myspell"
xcopy /Y "$(SolutionDir)..\user\wp\dictionary\american.hash" "$(OutDir)\dictionary\ispell"
mkdir "$(OutDir)\lib\enchant"
xcopy /Y "$(SolutionDir)\Prefix\lib\enchant\*.dll" "$(OutDir)\lib\enchant"
rmdir /S /Q "$(OutDir)\xsltml"
mkdir "$(OutDir)\xsltml"
xcopy /Y "$(SolutionDir)..\plugins\latex\xsltml\*.*" "$(OutDir)\xsltml"
" /> </Configuration> <Configuration @@ -170,7 +170,7 @@ /> <Tool Name="VCPostBuildEventTool" - CommandLine="rmdir /S /Q "$(OutDir)\strings"
mkdir "$(OutDir)\strings"
xcopy /E "$(SolutionDir)..\user\wp\strings\*.strings" "$(OutDir)\strings"
rmdir /S /Q "$(OutDir)\profiles"
mkdir "$(OutDir)\profiles"
xcopy /Y "$(SolutionDir)..\user\wp\system.profile*" "$(OutDir)\profiles"
rmdir /S /Q "$(OutDir)\templates"
mkdir "$(OutDir)\templates"
xcopy /E "$(SolutionDir)..\user\wp\templates\*.awt*" "$(OutDir)\templates"
xcopy /Y "$(SolutionDir)\Prefix\bin\bz2-1.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libenchant.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libfribidi-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libglib-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgio-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgmodule-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgobject-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgsf-1-114.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgthread-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libintl-8.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libjpeg-62.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libpng12-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libpng15.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libwv-1-2-4.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libxml2-2.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\zlib1.dll" "$(OutDir)\bin"
rmdir /S /Q "$(OutDir)\clipart"
mkdir "$(OutDir)\clipart"
xcopy /E "$(SolutionDir)..\user\wp\clipart\*.png" "$(OutDir)\clipart"
mkdir "$(OutDir)\dictionary\ispell"
mkdir "$(OutDir)\dictionary\myspell"
xcopy /Y "$(SolutionDir)..\user\wp\dictionary\american.hash" "$(OutDir)\dictionary\ispell"
mkdir "$(OutDir)\lib\enchant"
xcopy /Y "$(SolutionDir)\Prefix\lib\enchant\*.dll" "$(OutDir)\lib\enchant"
rmdir /S /Q "$(OutDir)\xsltml"
mkdir "$(OutDir)\xsltml"
xcopy /Y "$(SolutionDir)..\plugins\latex\xsltml\*.*" "$(OutDir)\xsltml"
" + CommandLine="rmdir /S /Q "$(OutDir)\strings"
mkdir "$(OutDir)\strings"
FOR %%f in ("$(SolutionDir)..\po\*.po") DO ( perl $(SolutionDir)..\po\ui-backport.pl $(SolutionDir)..\po\%%~nf.po $(SolutionDir)..\po\%%~nf.strings )
xcopy /E "$(SolutionDir)..\po\*.strings" "$(OutDir)\strings"
del "$(SolutionDir)..\po\*.strings"
rmdir /S /Q "$(OutDir)\profiles"
mkdir "$(OutDir)\profiles"
xcopy /Y "$(SolutionDir)..\user\wp\system.profile*" "$(OutDir)\profiles"
rmdir /S /Q "$(OutDir)\templates"
mkdir "$(OutDir)\templates"
xcopy /E "$(SolutionDir)..\user\wp\templates\*.awt*" "$(OutDir)\templates"
xcopy /Y "$(SolutionDir)\Prefix\bin\bz2-1.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libenchant.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libfribidi-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libglib-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgio-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgmodule-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgobject-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgsf-1-114.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libgthread-2.0-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libintl-8.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libjpeg-62.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libpng12-0.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libpng15.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libwv-1-2-4.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\libxml2-2.dll" "$(OutDir)\bin"
xcopy /Y "$(SolutionDir)\Prefix\bin\zlib1.dll" "$(OutDir)\bin"
rmdir /S /Q "$(OutDir)\clipart"
mkdir "$(OutDir)\clipart"
xcopy /E "$(SolutionDir)..\user\wp\clipart\*.png" "$(OutDir)\clipart"
mkdir "$(OutDir)\dictionary\ispell"
mkdir "$(OutDir)\dictionary\myspell"
xcopy /Y "$(SolutionDir)..\user\wp\dictionary\american.hash" "$(OutDir)\dictionary\ispell"
mkdir "$(OutDir)\lib\enchant"
xcopy /Y "$(SolutionDir)\Prefix\lib\enchant\*.dll" "$(OutDir)\lib\enchant"
rmdir /S /Q "$(OutDir)\xsltml"
mkdir "$(OutDir)\xsltml"
xcopy /Y "$(SolutionDir)..\plugins\latex\xsltml\*.*" "$(OutDir)\xsltml"" /> </Configuration> </Configurations>
Patch_ui-backport.patch
(application/octet-stream, 749 B)
Index: ui-backport.pl =================================================================== --- ui-backport.pl (revision 31421) +++ ui-backport.pl (working copy) @@ -25,6 +25,7 @@ # Ingo Brueckl <[email protected]> use strict; +use File::Basename; # Declare global variables #------------------------- @@ -32,7 +33,7 @@ my $in = "$ARGV[0]"; # input file (.po) my $out = "$ARGV[1]"; # output file (.strings) -my $lang = `basename $in .po`; +my $lang = basename($in,'.po'); my $kind = "0"; my @xap_strings; my @ap_strings; @@ -42,7 +43,6 @@ my $encoding = "iso-8859-1"; $lang =~ s/_/-/g; -chop $lang; print "Converting localization file $in to Abiword .strings format.\n";