PDA

View Full Version : Multilanguage Ruleset



Fenloh
August 4th, 2011, 11:57
Hi,

As the Work on the SR4 continues and becomes more "bloody" (thanks to Exothermals excelent graphics), the question came up, if we can create this ruleset not only in english, but also in german.

I am now looking for the best and easiest way to provide Multilanguage.

Which will be the best way to resolve that? extension? Or can we somehow have that as a preference for players and GMs? Or is there already a solution for Multilanguage?

Fenloh

demonsbane
August 4th, 2011, 13:30
Which will be the best way to resolve that? extension? Or can we somehow have that as a preference for players and GMs? Or is there already a solution for Multilanguage?

For what is worth, I believe that at least a community member seems to be working into implementing localization into a ruleset.

If you don't receive better answers here, you can just jump to the fg2 chat and ask about it.

Ikael
August 4th, 2011, 20:26
Hi,

As the Work on the SR4 continues and becomes more "bloody" (thanks to Exothermals excelent graphics), the question came up, if we can create this ruleset not only in english, but also in german.

I am now looking for the best and easiest way to provide Multilanguage.

Which will be the best way to resolve that? extension? Or can we somehow have that as a preference for players and GMs? Or is there already a solution for Multilanguage?

Fenloh

I did implement localization in Unicore ruleset by providing global named script file that contains one directory/map for localized texts associated with specific key. For example



labels = {
["damage"] = "Damage",
["hitpoints"] = "Hit Point(s)",
...
}


in addion I did create other global named script that is called when localized text is required and you pass localized key as parameter and it returns you the localized text. And of course I had to revise all the windowcontrols that has static/fixed texts to customized windowcontrol that define the used text dynamically on ruleset load.

This is an extension approarch and the good part is that when you want other localization you can create simply extension that overrides the localization script file (that contains key-value pairs) and you're good to go. The bad part is that you are allowed to have only one language in you per ruleset load and every player will have to use the same language.

If you want to use preference approach you could do it similarly but you will have some real burden to refresh all your texts when language is changed.

I would love to hear if you could figure out other approach in doing multilangual feature as I feel it would be very welcome to all rulesets.

drvolk
April 11th, 2012, 07:30
I tried to create an extension to localize the 3.5E ruleset in an similar approach as Ikael did in his unicore ruleset.

Is it realy necessary to modify all windowcontrols which have the display text within "<static>" tags or is it possible to "remove" and/or replace that text dynamically ? (i have not much experience with XML and web programing and maybe dont understand the concept at all ..).

I saw in the unicore "templates_common.xml" that it is possibly to replace text in windowcontrols where the information is within "<label>" tags.
I tried this in the same way with windowcontrols with "<static>" tags, but for there the "old" text information was not replace by the translated but overridden.

Works for <label>:


<template name="string_labeled">
<stringfield>
<font>sheettext</font>
<lineoffset default="on">-1</lineoffset>
<script>
labelwidget = nil;

function onInit()
label[1]=Translation.translate_glossary(label[1]);

labelwidget = addTextWidget("sheetlabelinline", string.upper(label[1]));
if labelwidget then
local w,h = labelwidget.getSize();
labelwidget.setPosition("bottomleft", w/2, h/2-5);
end
end
</script>
</stringfield>
</template>


Only override old static text:


<template name="label_fieldtop">
<stringcontrol>
<font>sheetlabelmini</font>
<anchored>
<position>above</position>
<offset>3,2</offset>
</anchored>
<center />
<script>
labelwidget = nil;

function onInit()
static[1]=Translation.translate_glossary(static[1]);
labelwidget = addTextWidget("sheetlabelinline", static[1]);
end
</script>
</stringcontrol>
</template>