Weird things in h5plib_v124

Re: Weird things in h5plib_v124

by Sara Arjona Téllez -
Number of replies: 10

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