Weird things in h5plib_v124

Weird things in h5plib_v124

by koen roggemans -
Number of replies: 13
Picture of Language pack maintainers

There are some weird things in h5plib_v124, like  (: clip) and %lib.

They don't show up in https://docs.moodle.org/dev/Translation_FAQ#Are_there_items_which_are_NOT_to_be_translated.3F

Did anyone manage to figure out what they do by seeing it in use in the interface?  Can it be translated?

Kind regards

Koen

In reply to koen roggemans

Re: Weird things in h5plib_v124

by German Valero -
Picture of Language pack maintainers

Hi Koen,

I also wondered about the very peculiar syntax for those very new strings. I recall some other H5P-related AMOS file also had weird syntax a few weeks ago..

But, like many of you, I have been very busy trying to motivate my students with off-site courses at my University.

Plus, the large number of new strings for the coming 3.9 Moodle branch

I wil try to use the new Moodle 3.9dev local server I just managed to install in my PC (I had windows registry issues preventing me from installing it for the past 2 months).

ps: the German and Italian translations for H5P source code at https://localization.h5p.org/ are 100% complete. Maybe it would be interesting to test the new Moodle 3.9dev AMOS strings with those languages. But, despite being named Germán, I can not read German at all (pun intended) !


In reply to koen roggemans

Re: Weird things in h5plib_v124

by David Mudrák -
Picture of Language pack maintainers

Thanks Koen for raising this. I've pinged the H5P team to check and asked them to reply here.

In reply to koen roggemans

Re: Weird things in h5plib_v124

by Sara Arjona Téllez -

Hi Koen!

Thanks for raising this question! We've added some extra information to this Translations page (here) to explain how they should be treated. As you'll see, this placeholders (such as :clip or %lib), must not be translated. Please, let us know if it's clear enough wink

Kind regards!

In reply to Sara Arjona Téllez

Re: Weird things in h5plib_v124

by German Valero -
Picture of Language pack maintainers

Thanks a lot Sara.

Please note that the file core_h5p.php also has some peculiar strings such as:

Added {$a->%new} new H5P libraries.

One of the files inside the package exceeds the maximum file size allowed. ({$a->%file} {$a->%used} > {$a->%max})

Invalid language file {$a->%file} in library {$a->%library}


In reply to German Valero

Re: Weird things in h5plib_v124

by Sara Arjona Téllez -

Hi German!

Thanks a lot for looking at the changes and commenting about these strings. All the cases in core_h5p.php, such as {$a->%library} I would say are covered by the information in the Moodle variables enclosed within {curly brackets} section. Do you think is enough or should be added some extra information in order to avoid any confusion?

Cheers!



In reply to Sara Arjona Téllez

Re: Weird things in h5plib_v124

by German Valero -
Picture of Language pack maintainers

Hi Sara,
I think you've done an excellent job and the current documentation is pretty good.
Thanks a lot smile

In reply to Sara Arjona Téllez

Re: Weird things in h5plib_v124

by koen roggemans -
Picture of Language pack maintainers

Yes, I agree: curly brackets docs cover this.

Thanks a lot for your work on the documentation: very clear and helpful.

Kind regards

Koen

In reply to Sara Arjona Téllez

Ang: Re: Weird things in h5plib_v124

by Bente Olsen -
Picture of Language pack maintainers

Hi Sara

Thanks for your help with this.

I do have an additional question though. In Moodle you can combine letters/words and curly brackets, eg. you can write relevant{$a}string, without spaces before or after the curly brackets. What is the rule when it comes to h5p placeholders?

Can I use :lib-translatedword, translatedword:lib, translatedword-:lib or :libtranslatedword

I ask because I sometime combine a word and a placeholder in my translations. In Danish we have a lot of 'doubbled' words. Eg. I have translated a string like this:

[Missing translation :key] → [Mangler oversættelses-:key]

In this case I have chosen to use a hyphen between my Danish word and the placeholder, in the hope that it will be okay. Normally in Moodle I might have translated the string containing curly brackets without the hyphen.

In addition I might be tempted to write
%libtypen skal...
which would work with placeholder with curly brackets.

Another example:

The :property value can only contain numbers. → :property-værdien kan kun indeholde tal.


Thanks in advance

Bente


In reply to Bente Olsen

Re: Ang: Re: Weird things in h5plib_v124

by Sara Arjona Téllez -

Hi Bente!

The cases you mentioned in your message should work as expected if you add the hyphen before or after the ":xxxxx" key (I've been able to confirm them with some quick tests):

  • [Missing translation :key] → [Mangler oversættelses-:key]
  • The :property value can only contain numbers. → :property-værdien kan kun indeholde tal.

For the "%libtypen skal" I need some more information (the original string would help), to confirm if they will work too smile

Kind regards from Barcelona,

Sara

In reply to Sara Arjona Téllez

Ang: Re: Ang: Re: Weird things in h5plib_v124

by Bente Olsen -
Picture of Language pack maintainers

Hi Sara

Thank you for your reply. Now I see the rule as it is ok to use  (if the placeholder is :code or %code)

:code-extracharacters, extracharacters-:code or %code-extracharacters, extracharacters-%code,

but I have to avoid

extracharacters:code, :codeextracharacters and extracharacters%code, %codeextracharacters

so combining the placeholder with another string always should be done with the hypen as separator?

My example with %libtype was just an example created by me, not something from the languagepack.

Cheers from Roskilde smile

Bente

In reply to Bente Olsen

Re: Weird things in h5plib_v124

by Sara Arjona Téllez -

Hi Bente!

As far as I've seen, all the cases should work (even the ones without hyphen). The first occurrence of :code (or %code) will be replaced by the corresponding text regardless if there aren't empty spaces or hyphens near. So, if code=xxxxx:

  • :code-extracharacters / %code-extracharacters will be converted to xxxxx-extracharacters
  • extracharacters-:code / extracharacters-%code will be converted to extracharacters-xxxxx
  • extracharacters:code / extracharacters%code will be converted to extracharactersxxxxx
  • :codeextracharacters / %codeextracharacters will be converted to xxxxxextracharacters


Cheers!

Sara