Jump to content

Translation of scripts


dxangelo

Recommended Posts

Posted

Hello!

I redo some mods and translate them into several languages. Not to translate the script a few times I edit scripts adding a $sign to the text. But I noticed that not everything can be translated. I read the SkyUI documentation, but found nothing there that can help.

 

For example, this string works fine and the translation is picked up from the translation file...

_iSyncHeightWerewolfID = AddToggleOption("$PSA_SyncWith", FPHmain.WerewolfSyncHeight)

and this does not work anymore...

_iSyncHeightWerewolfID = AddToggleOption("$PSA_SyncWith" + " " + FPHmain.GetRaceName(), FPHmain.WerewolfSyncHeight)


Maybe there are ways to solve this problem?

 

Similarly, translation does not work in:

            if (a_conflictName != "")
                msg = "This key is already mapped to:\n'" + a_conflictControl + "'\n(" + a_conflictName + ")\n\nAre you sure you want to continue?"
            else
                msg = "This key is already mapped to:\n'" + a_conflictControl + "'\n\nAre you sure you want to continue?"
            endIf
            continue = ShowMessage(msg, true, "$Yes", "$No")

if you bring to mind: 

           if (a_conflictName != "")
                msg = "$KeyMapped" + ":\n'" + a_conflictControl + "'\n(" + a_conflictName + ")\n\n" + "$SureContinue"
            else
                msg = "$KeyMapped" + ":\n'" + a_conflictControl + "'\n\n" + "$SureContinue"
            endIf
            continue = ShowMessage(msg, true, "$Yes", "$No")

Although the variables $Yes and $No well translated...

 

Help if you know... The very meaning of such a translation is lost, if due to some points you still need to keep the script file in different languages...

 

Posted

I am fairly certain the $stuff is only translated visually and the script will use the string as written in the script internally, meaning you can't localize concatenated strings. I don't know though. 

 

You could try something like this:

Quote

String Function GetSureContinue()

    return "$SureContinue"

EndFunction

 

String Property SureContinue = "$SureContinue" AutoReadOnly

And use the property or call the function, respectively.

Posted

Helped me to solve the issue! Thanks to everyone who did not remain indifferent!

Describe how it was and how you need to translate:

EXAMPLE 1

from org.psc:

_iSyncHeightWerewolfID = AddToggleOption("Sync With " + FPHmain.GetRaceName(), FPHmain.WerewolfSyncHeight)

for translation in org.psc:

_iSyncHeightWerewolfID = AddToggleOption("$PSA_SyncWith{" + FPHmain.GetRaceName() + "}", FPHmain.WerewolfSyncHeight)

for translation in org_lang.txt:

$PSA_SyncWith{}	Sync With {}

 

EXAMPLE 2

from org.psc:

if (a_conflictName != "")
				msg = "This key is already mapped to:\n'" + a_conflictControl + "'\n(" + a_conflictName + ")\n\nAre you sure you want to continue?"
			else
				msg = "This key is already mapped to:\n'" + a_conflictControl + "'\n\nAre you sure you want to continue?"
			endIf

for translation in org.psc:

if (a_conflictName != "")
				msg = "$mHUD_KeyMapConflict1{" + a_conflictControl + "}{" + a_conflictName + "}"
			else
				msg = "$mHUD_KeyMapConflict2{" + a_conflictControl + "}"
			endIf

for translation in org_lang.txt:

$mHUD_KeyMapConflict1{}{}	This key is already mapped to:\n{}\n({})\n\nAre you sure you want to continue?
$mHUD_KeyMapConflict2{}	This key is already mapped to:\n{}\n\nAre you sure you want to continue?

Maybe someone will be useful))

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...