Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / solenv / bin / pre2par.pl
blob42c319dd2c0836328d45f6c9fa3f5d8670467f87
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 use lib ("$ENV{SRCDIR}/solenv/bin/modules");
21 use Cwd;
22 use pre2par::directory;
23 use pre2par::files;
24 use pre2par::globals;
25 use pre2par::language;
26 use pre2par::parameter;
27 use pre2par::work;
29 ####################################
30 # Main program
31 ####################################
33 pre2par::parameter::getparameter();
34 pre2par::parameter::control_parameter();
36 pre2par::directory::check_directory($pre2par::globals::parfilename);
38 my $prefile = pre2par::files::read_file($pre2par::globals::prefilename);
40 pre2par::work::check_content($prefile, $pre2par::globals::prefilename);
42 my $parfile = pre2par::work::convert($prefile);
44 pre2par::work::formatter($parfile);
46 my $langfilename = pre2par::work::getlangfilename();
48 my $dolocalization = pre2par::work::check_existence_of_langfiles($langfilename);
50 if ( $dolocalization )
52 my $langfile = pre2par::files::read_file($langfilename);
53 pre2par::language::localize($parfile, $langfile);
56 pre2par::files::save_file($pre2par::globals::parfilename, $parfile);
58 # checking of par file was written correctly
59 my $parfilecomp = pre2par::files::read_file($pre2par::globals::parfilename);
60 pre2par::work::diff_content($parfile, $parfilecomp, $pre2par::globals::parfilename);
62 ####################################
63 # End main program
64 ####################################