xref: /AOO41X/main/solenv/bin/modules/installer/windows/language.pm (revision 9780544fa6b4c85f7d9b48452f58c7da854fc9a5)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24package installer::windows::language;
25
26use installer::exiter;
27
28####################################################
29# Determining the Windows language (LCID)
30# English: 1033
31####################################################
32
33sub get_windows_language
34{
35    my ($language) = @_;
36
37    my $windowslanguage = "";
38
39    if ( $installer::globals::msilanguage->{$language} ) { $windowslanguage = $installer::globals::msilanguage->{$language}; }
40
41    if ( $windowslanguage eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_language", "get_windows_language"); }
42
43    return $windowslanguage;
44}
45
46####################################################
47# Determining the Windows language ANSI-Codepage
48# English: 1252
49####################################################
50
51sub get_windows_encoding
52{
53    my ($language) = @_;
54
55    my $windowsencoding = "";
56
57    if ( $installer::globals::msiencoding->{$language} ) { $windowsencoding = $installer::globals::msiencoding->{$language}; }
58
59    # if ( $windowsencoding eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_encoding", "get_windows_encoding"); }
60    if ( $windowsencoding eq "" ) { $windowsencoding = "0"; }   # setting value, if the language is not listed in the encodinglist
61
62    if ( $windowsencoding eq "0" ) { $windowsencoding = "65001"; }  # languages with "0" have to be available in UTF-8 (65001)
63
64    # Asian multilingual installation sets need a code neutral Windows Installer database -> $windowsencoding = 0
65    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"; }
66
67    return $windowsencoding;
68}
69
701;