Social forum

translate

 
Picture of Ricardo Abreu
translate
by Ricardo Abreu - Thursday, 11 December 2008, 1:56 PM
 

Hi Tim

My name is Ricard and I’ve being working with Moodle.

I’d like to use an portuguese verrsion of the autoview plugin.

I’ve translated 2 files within langs folder however the plugin messages are not being translated. What else do I need to change?

Cheers, Ricardo

Picture of Tim Williams
Re: translate
by Tim Williams - Tuesday, 16 December 2008, 11:26 AM
 
You also need to do the vresource/lang .js file. There is a translation aide in the vresource/utils/newlang.html that puts correct escape sequences into the .js files, accented characters sometimes cause strange things to happen, using the escape sequences fixes it. I really need to write a version of newlang.html for the editor as well.

However, before you start translating the vresource/lang file, I just had a private email from somebody else who is trying to translate AutoView into Portuguese, I think he has already done the vresouce/lang file, so I may well be able to combine your work. Hopefully he'll be posting a message on this forum shortly.
Picture of Paulo Penteado
Re: translate
by Paulo Penteado - Friday, 19 December 2008, 10:35 AM
 
Hi,
I have translated a pt_br.js for the vresource directory. However, I have a problem. I am trying to make Portuguese the default language, making some changes in the files below. Now, Portuguese appears in the languages menus, but there is allways an error message:
Error adding auto/video language
Language pt_br is not available
'pt_br' has not been defined as a video language
(and the same for slides and titles)
This happens both in Portuguese and English.
I don't know what I'm doing wrong.
Paulo Penteado
Salvador, Bahia, Brasil

autoview/templates/autoview.xsl
...
<xsl:template match="languages">
<script type="text/javascript" src="{$vresource}lang/en.js">//</script>
<xsl:if test="string-length($extension) &gt; 0">
<script type="text/javascript" src="{$vresource}lang/pt_br.js">//</script>
<script type="text/javascript" src="{$vresource}lang/es.js">//</script>
<script type="text/javascript" src="{$vresource}lang/de.js">//</script>
<script type="text/javascript" src="{$vresource}lang/it.js">//</script>
<script type="text/javascript" src="{$vresource}lang/sk.js">//</script>

<script type="text/javascript" src="{$aveditdir}lang/en.js">//</script>
<script type="text/javascript" src="{$aveditdir}lang/pt_br.js">//</script>
</xsl:if>
<xsl:if test="string-length($extension)=0">
<xsl:for-each select="lang[node()!='pt_br']">
...

autoview/avedit/convert.xsl
...
var l='pt_br';
...

blank.avx
...
<lang>pt_br</lang>
Picture of Paulo Penteado
Re: translate
by Paulo Penteado - Friday, 19 December 2008, 2:10 PM
 
Hello,
I finally found out how to set things to have Portuguese as the default language. In the autoview.xls file, I changed the previous setting (above), to what is in green:

autoview/templates/autoview.xsl
...
<xsl:template match="languages">
<script type="text/javascript" src="{$vresource}lang/pt_br.js">//</script>
<xsl:if test="string-length($extension) > 0">
<script type="text/javascript" src="{$vresource}lang/en.js">//</script>
<script type="text/javascript" src="{$vresource}lang/es.js">//</script>
<script type="text/javascript" src="{$vresource}lang/de.js">//</script>
<script type="text/javascript" src="{$vresource}lang/it.js">//</script>
<script type="text/javascript" src="{$vresource}lang/sk.js">//</script>

<script type="text/javascript" src="{$aveditdir}lang/en.js">//</script>
<script type="text/javascript" src="{$aveditdir}lang/pt_br.js">//</script>
</xsl:if>
<xsl:if test="string-length($extension)=0">
<xsl:for-each select="lang[node()!='pt_br']">
...

There may be some hard coded things to translate. I didn't check everything.


Picture of Tim Williams
Re: translate
by Tim Williams - Friday, 19 December 2008, 2:44 PM
 
One word of warning, AutoView dosn't support 'sub' languages, so I would reccomend putting in all of the javascript files and changes to autoview code as pt.js NOT pt_br.js. AutoView only reads the first two characters in the language code, everything else is ignored.

The only place where you can use pt_br is in the php lang file for moodle.

When I have a moment, i'll pick up the files from this thread and put together a proper release which includes the portugese translations.
Picture of Paulo Penteado
Re: translate
by Paulo Penteado - Saturday, 3 January 2009, 2:49 AM
 
I am sending a help file in Portugese. One can put it on the autoview\vresource\help\en directory. Alternatively, you can put it on a autoview\vresource\help\pt directory, but it will be necessary to change the address of the help file somewhere
Paulo Penteado
Picture of Tim Williams
Re: translate
by Tim Williams - Wednesday, 14 January 2009, 5:23 PM
 
Thanks for that, this will be included in the next release version, but it is available now from the development directory.

I've put the index.html into vresource/help/pt and set the correct URL. I've copied across the images used in the helpfile from the english version for now, but they probably need to be updated to show the Portugese text at some point.