1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: t_locale_tools.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-07-31 19:02:31 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/***********************************************************************
34 '* owner : oliver.craemer@sun.com
36 '* short description : place it here
38 '\***********************************************************************
40 ' #1 fThesaurusLocales 'Get locales which are supported by Thesaurus
41 ' #1 fSpellcheckerLocales 'Get locales which are supported by Spellchecker
43 '\***********************************************************************
45 function fThesaurusLocales as boolean
46 '/// Gets the supported thesaurus locales from the API
47 '/// Returns TRUE if iSprache is supported by Thesaurus
48 '/// Returns FALSE if iSprache is not supported by Thesaurus
51 dim linugServiceMgr as object
52 dim aAllLocales (256) as variant
56 fThesaurusLocales = FALSE
58 linugServiceMgr=uno.createInstance("com.sun.star.linguistic2.LinguServiceManager")
59 aAllLocales = linugServiceMgr.getThesaurus().getLocales()
60 for i = 0 to ubound( aAllLocales ())
61 sLocale = ( aAllLocales(i).Language & "-" & (aAllLocales(i).Country) )
63 if ConvertLanguage2 ( sLocale ) = iSprache then
64 fThesaurusLocales = TRUE
65 i = ubound( aAllLocales ())
71 '-----------------------------------------------------------
73 function fSpellcheckerLocales as boolean
74 '/// Gets the supported spellchecker locales from the API
75 '/// Returns TRUE if iSprache is supported by Spellchecker
76 '/// Returns FALSE if iSprache is not supported by Spellchecker
79 dim linugServiceMgr as object
80 dim aAllLocales (256) as variant
84 fSpellcheckerLocales = FALSE
86 linugServiceMgr=uno.createInstance("com.sun.star.linguistic2.LinguServiceManager")
87 aAllLocales = linugServiceMgr.getSpellchecker().getLocales()
88 for i = 0 to ubound( aAllLocales ())
89 sLocale = ( aAllLocales(i).Language & "-" & (aAllLocales(i).Country) )
91 if ConvertLanguage2 ( sLocale ) = iSprache then
92 fSpellcheckerLocales = TRUE
93 i = ubound( aAllLocales ())