PDA

View Full Version : Example Language Extension



ianmward
December 4th, 2017, 12:10
Hi all,

Attached is a sample extension for translating CoC7e to Spanish.

I'll post another with English for those wishing a more traditional starting point...

The data_eras.lua file contains the eras with their related skills. I have left the skill descriptions blank but they can be filled in.

The strings_coc.xml contains the strings to be converted - please ensure that the skill names coincide with those in data_eras.lua otherwise some of the ruleset automation will fail.

Please post here any other translations as you do them.

The skill list is converted to the UI based skills and eras on campaign creation. They can then be edited in the UI afterwards.
The character skill list is populated from the active era on first opening.

With these constraints, the translation extension will only work properly as expected for new campaigns or new characters.

Enjoy...

Ian

Updated to remove duplicate entries and to translate chase entries

dulux-oz
December 4th, 2017, 12:18
People also might like to check out the LPak Project, which provides translations of all sorts of Rulesets to all sorts of languages.

https://www.fantasygrounds.com/forums/showthread.php?27202-LanguagePak-(LPak)-Community-Project-Program

CthulhuRol
December 4th, 2017, 18:42
Awesome!!!! Many thanks Ian

kael79
December 5th, 2017, 14:14
Thank's Ian ! Now i can translate into French :)

kael79
December 5th, 2017, 19:47
Hi ! Thank's for your job !

I have a question: in strings_coc.xml
The rules for Shield (ex: <string name="option_label_SHLD">Juego: Usa Reglas de Escudos</string> ) , it's use by CoC7E ruleset ? It's necessary for the good execution this extension ?

In addition, I noticed a few duplicate lines:
( 142 dupe of 131 ): <string name="char_tooltip_skilladdlanguage">Añadir Habilidad de Lengua</string>
( 144 dupe of 133 ): <string name="char_tooltip_skilladdart">Añadir Habilidad de Arte</string>
( 333 dupe of 329 ): <string name="ability_roll">[Atributo]</string>
( 401 dupe of 196 ): <string name="spell_emptyname">« Nuevo Conjuro »</string>
( 406 dupe of 205 ): <string name="skill_emptyname">« Nueva Habilidad »</string>
( 411 dupe of 214 ): <string name="era_emptyname">« Nueva Era »</string>
( 421 dupe of 219 ): <string name="talent_emptyname">« Nuevo Talento »</string>
( 498 dupe of 446 ): <string name="char_label_totalweight">Total</string>
( 510 dupe of 495 ): <string name="sidebar_tooltip_library">Librería</string>
( 743 dupe of 84 ): <string name="char_label_languages">Idiomas</string>

Thank's !

EDIT: I apologize for having ignored the basic civilities

ianmward
December 6th, 2017, 06:23
Hi ! Thank's for your job !

I have a question: in strings_coc.xml
The rules for Shield (ex: <string name="option_label_SHLD">Juego: Usa Reglas de Escudos</string> ) , it's use by CoC7E ruleset ? It's necessary for the good execution this extension ?
That is needed for the upcoming Cthulhu through the ages supplement which will support shields for defense and attack.


In addition, I noticed a few duplicate lines:
( 142 dupe of 131 ): <string name="char_tooltip_skilladdlanguage">Añadir Habilidad de Lengua</string>
( 144 dupe of 133 ): <string name="char_tooltip_skilladdart">Añadir Habilidad de Arte</string>
( 333 dupe of 329 ): <string name="ability_roll">[Atributo]</string>
( 401 dupe of 196 ): <string name="spell_emptyname">« Nuevo Conjuro »</string>
( 406 dupe of 205 ): <string name="skill_emptyname">« Nueva Habilidad »</string>
( 411 dupe of 214 ): <string name="era_emptyname">« Nueva Era »</string>
( 421 dupe of 219 ): <string name="talent_emptyname">« Nuevo Talento »</string>
( 498 dupe of 446 ): <string name="char_label_totalweight">Total</string>
( 510 dupe of 495 ): <string name="sidebar_tooltip_library">Librería</string>
( 743 dupe of 84 ): <string name="char_label_languages">Idiomas</string>

Thank's !

EDIT: I apologize for having ignored the basic civilities

I’ll get rid of the dups, thanks.

kael79
December 6th, 2017, 10:42
Thank you for your answer :)

kael79
December 7th, 2017, 16:50
Hello !
I finished the French translation in the main line, but I have a problem: the skills list remains in English (whether with the French version or the Spanish version). Did I miss something?

(Sorry for my english google translate)

ianmward
December 7th, 2017, 21:41
Hello !
I finished the French translation in the main line, but I have a problem: the skills list remains in English (whether with the French version or the Spanish version). Did I miss something?

(Sorry for my english google translate)
The skill list is converted to the UI based skills and eras on campaign creation. They can then be edited in the UI afterwards.
The character skill list is populated from the active era on first opening.

With these constraints, the translation extension will only work properly as expected for new campaigns or new characters.

Please test your new extension on a new campaign with new characters.

kael79
December 7th, 2017, 22:22
Thank you ! it works well !

kael79
December 8th, 2017, 11:42
Hello !
I have another problem. My special characters é è à works well, but not '... I checked in notepad ++, I'm in iso 8859-1.
Thanks again for the hands off :)

damned
December 8th, 2017, 12:21
If it dont work... it dont work.
Many special characters dont work... sorry.

kael79
December 8th, 2017, 13:38
Problem solved. :)
My iso isn't good (miss clic)

kael79
December 9th, 2017, 18:28
Hello ! And yes, it's me again ... ^^ '

I finished my extension, which seems to work without worries. But I still have 2 error messages identical to the creation of the campaign, and no longer appears at the following loads.

Database Error: A XML parse error occurred processing file - Error on line 12: Error reading Attributes.
Database Error: A XML parse error occurred processing file - Error on line 12: Error reading Attributes.
I do not know where it can come from, however it surely comes from one of the skills descriptions (I do not have the error on my backup before the descriptions).
My tags look correct (<p><b><i></i></b></p> <list><li></li></list>) and and I'm done each line by \.

Do you have an idea ?

damned
December 9th, 2017, 23:29
What is line 12 in your db.xml?
Does your calendar work properly?

ianmward
December 10th, 2017, 00:57
PM me with a copy of your extension and I’ll take a look.

Ian

kael79
December 10th, 2017, 10:33
Hi !


What is line 12 in your db.xml?
Does your calendar work properly?

I've not db.xml, but in my extension.xml, line 12 is empty, and in my coc_string.xml i have <string name="ct_label_hp">PV</string>
My calendar work properly.


PM me with a copy of your extension and I’ll take a look.

Ian

Thank you ! PM is done.

damned
December 10th, 2017, 10:35
db.xml is in your campaign.

kael79
December 10th, 2017, 11:01
Thank you !
I have <year type="number">0</year>

It's possible to translate calendar in db.xml ?

kael79
December 11th, 2017, 09:45
Hi. Sorry for double post.
I may have a track. If I create a new character before configuring a calendar, line 12 of db.xml is <education type = "number"> 0 </ education>

Gubben
March 11th, 2018, 18:59
Can't edit descriptions in Data_eras.lua
for example.["Antropologia"] = { base=1, desc="\
<p>ANY WORD</p>\
"},
There is no desciption in the skill frame, any idea?

ianmward
March 12th, 2018, 14:02
Can't edit descriptions in Data_eras.lua
for example.["Antropologia"] = { base=1, desc="\
<p>ANY WORD</p>\
"},
There is no desciption in the skill frame, any idea?

The skills are copied from the data_eras.lua into new campaign skill objects and a new Era object on startup, if the era does not already exist. You can try removing the skills and era from the campaign and restarting, this should repopulate the era and skills, including the description.

Gubben
March 12th, 2018, 16:54
The skills are copied from the data_eras.lua into new campaign skill objects and a new Era object on startup, if the era does not already exist. You can try removing the skills and era from the campaign and restarting, this should repopulate the era and skills, including the description.

I'm still unable to make it work.
I started new campaigns, deleteted eras and skills, but still no descirption loaded with skills...

damned
March 12th, 2018, 19:39
skills = {
["1920s"] = {
["Accounting"] = { base=5, desc="\
<p>Grants understanding of accountancy procedures and ...</p>\
<p><b>Opposing skill/Difficulty level:</b></p>\
<p>If someone were trying to conceal something...</p>\
<list>\
<li>Regular difficulty: ...</li>\
</list>\
<p><b>Pushing examples: </b>taking more time to ...</p>\
<p><b>Sample Consequences of failing a Pushed roll: </b>discussions between investigators ...</p>\
<p>If an insane investigator fails a pushed roll, he or she ...</p>\
"
},
}
};

Gubben
March 12th, 2018, 19:50
skills = {
["1920s"] = {
["Accounting"] = { base=5, desc="\
<p>Grants understanding of accountancy procedures and ...</p>\
<p><b>Opposing skill/Difficulty level:</b></p>\
<p>If someone were trying to conceal something...</p>\
<list>\
<li>Regular difficulty: ...</li>\
</list>\
<p><b>Pushing examples: </b>taking more time to ...</p>\
<p><b>Sample Consequences of failing a Pushed roll: </b>discussions between investigators ...</p>\
<p>If an insane investigator fails a pushed roll, he or she ...</p>\
"
},
}
};


Tanks for this example

I have this code, (or very similar) but not working with the trasnlation extension, it loads without description.
I'm gonna try it all again... and see the ressults...
Thanks again for your colaboration

Gubben
March 12th, 2018, 20:20
Tanks for this example

I have this code, (or very similar) but not working with the trasnlation extension, it loads without description.
I'm gonna try it all again... and see the ressults...
Thanks again for your colaboration

SOLVED!

It's needed to fill all 3 ocurrences for the skill, It doesn't work if you only edit Era 1920s, f.e. You need to fill the skill in all era's to work... That is my conclusion... :P
Thanks to all for your help!

damned
March 13th, 2018, 00:02
SOLVED!

It's needed to fill all 3 ocurrences for the skill, It doesn't work if you only edit Era 1920s, f.e. You need to fill the skill in all era's to work... That is my conclusion... :P
Thanks to all for your help!

Thank you for posting that Gubben.
Hmmm.... that shouldnt be the case - you dont want Computer Use as a skill in the 1920s....
Ill do some tests later on.