Page name field to short for multi language content (only 255 characters)

Page name field to short for multi language content (only 255 characters)

by Richard van Iwaarden -
Number of replies: 12
Picture of Particularly helpful Moodlers

I'm making a Moodle site with 5 languages and run into this problem that if you use a language filter to get the correct language for page titles, the page name field is to short.

For example:

{mlang nl}Interview met Tsarina over haar boek in de krant PZC{mlang}{mlang es}Entrevista con Tsarina sobre su libro en el periódico PZC{mlang}{mlang it}Intervista con Tsarina sul suo libro nel giornale PZC{mlang}{mlang en}Interview with Tsarina about her book in the newspaper PZC{mlang}{mlang ru}Интервью с Цариной о её книге в газете PZC{mlang}

This is not an absurdly long page name 'Interview with Tsarina about her book in the newspaper PZC' in English. But when translated to multiple languages, you will go past the 255 character limit for the field.

Is there a solution to this problem? Can the database field be made longer, or will there be other problems?

Average of ratings: -
In reply to Richard van Iwaarden

Re: Page name field to short for multi language content (only 255 characters)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't suppose anybody was thinking about the multi-language filter when that field was designed. I would expect that it's also restricted in the code for the form where you edit it (it should be). You could hack the code and change the database definition - I wouldn't be happy, personally. That's asking for trouble when it comes to upgrades.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Page name field to short for multi language content (only 255 characters)

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers
Thanks Howard!

Yes, I was thinking the same... but also came to the same conclusion.

Just a warning then to people that want a multi language website. I think about 3-4 languages is a practical limit. When doing 5 languages, you will spend a considerable amount of time asking ChatGPT for shorter activity or resource titles smile
In reply to Richard van Iwaarden

Re: Page name field to short for multi language content (only 255 characters)

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Well this is why we in Moodle Academy and on the Moodle Qualifications site decided against using the filters and instead opted for the content translation plugin.
In reply to Mary Cooch

Re: Page name field to short for multi language content (only 255 characters)

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers
How does that work Mary? Does that mean every resource/activity/course name becomes a part of the language pack?

For example, if I add an assignment with the name 'upload your work here' to a course, will there be a field added to every language pack?
In reply to Richard van Iwaarden

Re: Page name field to short for multi language content (only 255 characters)

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
There is a course on Moodle Academy which explains how to use the content translation plugin. It's called Translate Moodle Academy  and although it  was written to help our community translate Moodle Academy courses, it works for anyone wishing to use the plugin.
In reply to Mary Cooch

Re: Page name field to short for multi language content (only 255 characters)

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Richard,

You can vote for an increase of activity name fields - MDL-83985 - and watch it to receive notifications of updates.

For anyone using the multi-language filter in course full names, the good news is that the field is increased in Moodle 5.0 (MDL-70556).

Average of ratings: Useful (1)
In reply to Mary Cooch

Re: Page name field to short for multi language content (only 255 characters)

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers
Thanks Mary, but my problem right now is not to translate Moodle core or anything. The problem is getting the multi language content to be displayed properly.
In reply to Richard van Iwaarden

Re: Page name field to short for multi language content (only 255 characters)

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Sure Richard - with the longer activity name fields that will help. (But the content translation plugin is not for translating Moodle core - it is for translating course content, the same as you are doing, just a different method)
In reply to Mary Cooch

Re: Page name field to short for multi language content (only 255 characters)

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers
Thanks Mary.

It might be that I just don't understand what this plugin really does. The description on the plugin page is very limited.
 
I tried translating it to Dutch, just to understand better what it is. I also checked the course on Moodle Academy. But still didn't really understand what it does.
 
Is it possible to add more information to the plugin page so readers understand why thies? It might be to technical (the information on hashes for example is seen on one of the screenshots, but the average user does not understand hashes)
 
A video would also be nice, but perhaps to much work. I think your plugin is valuable but users will not understand what it does now (like me, and I tried smile)
 
 
In reply to Richard van Iwaarden

Re: Page name field to short for multi language content (only 255 characters)

by Paula de Waal -
Picture of Core developers Picture of Translators

Hi Richard, in my work i have a lot of European projects ongoing which require the translations of contents in a huge number of languages. For these reason we had a lot of problems using the {mlang XX} annotations - not only the length, but also compatibility with some common plugins like the Questionnaire, and the fact that the work has to be done by 1 person alone if you dont want to risk messing the code.
With the "content translations" tool, instead, i can have a team of translators, each one is working contemporarily, do not have to insert brackets or touch the code. It has an inline translation feature that tells you what is already translated and what is not yet translated. The translator just click each translation button and translate! If it was wrong, it is always possible to have a look directly in the translator tool at the original text and html. There are also more advanced features for downloading, uploading and connecting with a translation API. I do not use these features at the moment but the API seems promising.

Average of ratings: Useful (1)