Hello,
I am trying to learn how to use Scriptforge.L10N to create localized versions of a macro.
To test, I have created a macro that simply displays a MsgBox saying “Hello world”.
I followed the following steps
- First I’ve created the POT file with the following macro:
Sub CreatePOT
GlobalScope.BasicLibraries.loadLibrary("ScriptForge")
Dim myPO As Variant
Set myPO = CreateScriptService("L10N")
myPO.AddText(, "Hello world")
myPO.ExportToPOTFile("c:\kk\myFile.pot")
End Sub
- Next I’ve copied myFile.pot to es-ES.po
- I’ve translated the only string in the es-ES.po file:
msgid "Hello world"
msgstr "Hola mundo"
- Next I’ve executed the following macro with LibreOffice in Spanish (Spain):
Sub Mensaje
GlobalScope.BasicLibraries.loadLibrary("ScriptForge")
Dim myPO As Variant
Set myPO = CreateScriptService("L10N")
Dim texto As String
texto = myPo.GetText("Hello world")
MsgBox(texto)
End Sub
I expect the message in Spanish but the message is in inglish
What are I missing?