1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28package installer::windows::language;
29
30use installer::exiter;
31
32####################################################
33# Determining the Windows language (LCID)
34# English: 1033
35####################################################
36
37sub get_windows_language
38{
39	my ($language) = @_;
40
41	my $windowslanguage = "";
42
43	if ( $installer::globals::msilanguage->{$language} ) { $windowslanguage = $installer::globals::msilanguage->{$language}; }
44
45	if ( $windowslanguage eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_language", "get_windows_language"); }
46
47	return $windowslanguage;
48}
49
50####################################################
51# Determining the Windows language ANSI-Codepage
52# English: 1252
53####################################################
54
55sub get_windows_encoding
56{
57	my ($language) = @_;
58
59	my $windowsencoding = "";
60
61	if ( $installer::globals::msiencoding->{$language} ) { $windowsencoding = $installer::globals::msiencoding->{$language}; }
62
63	# if ( $windowsencoding eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_encoding", "get_windows_encoding"); }
64	if ( $windowsencoding eq "" ) { $windowsencoding = "0"; }	# setting value, if the language is not listed in the encodinglist
65
66	if ( $windowsencoding eq "0" ) { $windowsencoding = "65001"; }	# languages with "0" have to be available in UTF-8 (65001)
67
68	# Asian multilingual installation sets need a code neutral Windows Installer database -> $windowsencoding = 0
69	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"; }
70
71	return $windowsencoding;
72}
73
741;