merge the formfield patch from ooo-build
[ooovba.git] / solenv / bin / modules / installer / windows / language.pm
blob02712d57a72d9a7a93eff7185a529e813cf62c57
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: language.pm,v $
11 # $Revision: 1.10 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 package installer::windows::language;
34 use installer::exiter;
36 ####################################################
37 # Determining the Windows language (LCID)
38 # English: 1033
39 ####################################################
41 sub get_windows_language
43 my ($language) = @_;
45 my $windowslanguage = "";
47 if ( $installer::globals::msilanguage->{$language} ) { $windowslanguage = $installer::globals::msilanguage->{$language}; }
49 if ( $windowslanguage eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_language", "get_windows_language"); }
51 return $windowslanguage;
54 ####################################################
55 # Determining the Windows language ANSI-Codepage
56 # English: 1252
57 ####################################################
59 sub get_windows_encoding
61 my ($language) = @_;
63 my $windowsencoding = "";
65 if ( $installer::globals::msiencoding->{$language} ) { $windowsencoding = $installer::globals::msiencoding->{$language}; }
67 # if ( $windowsencoding eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_encoding", "get_windows_encoding"); }
68 if ( $windowsencoding eq "" ) { $windowsencoding = "0"; } # setting value, if the language is not listed in the encodinglist
70 if ( $windowsencoding eq "0" ) { $windowsencoding = "65001"; } # languages with "0" have to be available in UTF-8 (65001)
72 # Asian multilingual installation sets need a code neutral Windows Installer database -> $windowsencoding = 0
73 if (( $language eq "en-US" ) && (( $installer::globals::product =~ /suitemulti/i ) || ( $installer::globals::product =~ /officemulti/i ) || ( $installer::globals::product =~ /c05office/i ) || ( $installer::globals::added_english ))) { $windowsencoding = "0"; }
75 return $windowsencoding;