9 messages in org.openoffice.fr.progRe: [prog] Changer la langue locale
FromSent OnAttachments
Didier Dorange-PattoretNov 22, 2008 6:40 am 
Francois GattoNov 22, 2008 11:02 pm 
Didier Dorange-PattoretNov 23, 2008 1:19 pm 
Francois GattoNov 23, 2008 10:40 pm 
Bernard MarcellyNov 24, 2008 3:22 am 
Didier Dorange-PattoretNov 24, 2008 4:05 am 
Didier Dorange-PattoretNov 24, 2008 4:11 am 
Didier Dorange-PattoretNov 24, 2008 4:14 am 
Francois GattoNov 24, 2008 10:27 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] Changer la langue localeActions...
From:Francois Gatto (oo@volcar.org)
Date:Nov 22, 2008 11:02:23 pm
List:org.openoffice.fr.prog

Bonjour Didier,

Didier Dorange-Pattoret wrote:

Bonjour,

Je voudrais changer la langue locale d'un compte utilisateur OOo.

J'ai essayé la macro, mais sans succès :

Sub Main oConfigAccess = GetConfigAccess( "/org.openoffice.Setup/L10N", True ) oConfigAccess.ooLocale = "de" oConfigAccess.commitChanges() End Sub

Function GetConfigAccess( ByVal cNodePath As String,ByVal bWriteAccess As Boolean,Optional bEnableSync,Optional bLazyWrite) As Object If IsMissing(bEnableSync) Then bEnableSync = True If IsMissing( bLazyWrite ) Then bLazyWrite = False Dim oConfigProvider, oConfigAccess as Object oConfigProvider = GetProcessServiceManager.createInstanceWithArguments("com.sun.star.configuration.ConfigurationProvider",Array( MakePropertyValue( "enableasync", bEnableSync))) If bWriteAccess Then cServiceName = "com.sun.star.configuration.ConfigurationUpdateAccess" Else cServiceName = "com.sun.star.configuration.ConfigurationAccess" EndIf oConfigAccess = oConfigProvider.createInstanceWithArguments( cServiceName, Array( MakePropertyValue( "nodepath", cNodePath ), MakePropertyValue( "lazywrite", bLazyWrite ))) GetConfigAccess() = oConfigAccess End Function

Cordialement.

Sur ooo.forum.org la macro suivante, qui semble fonctionner correctement. http://www.oooforum.org/forum/viewtopic.phtml?t=77031&highlight=locale

Sub Snippet_10() Dim oCP As Object Dim oCUA As Object Dim aProps(0) As New com.sun.star.beans.PropertyValue Dim sooSetupCurrency As String Dim sooLocale As String

oCP = CreateUnoService( _ "com.sun.star.configuration.ConfigurationProvider" ) aProps(0).Name = "nodepath" aProps(0).Value = "/org.openoffice.Setup/L10N" oCUA = oCP.createInstanceWithArguments( _ "com.sun.star.configuration.ConfigurationUpdateAccess", aProps )

' change Locale Setting oCUA.setPropertyValue("ooSetupSystemLocale", "es-SV")

' change Default Currency oCUA.setPropertyValue("ooSetupCurrency", "USD-en-US") 'oCUA.setPropertyValue("ooSetupCurrency", "SVC-es-SV")

oCUA.commitChanges() End Sub

Rejoignez maintenant plus de 3 000 personnes, associations, entreprises et collectivités qui soutiennent notre action