Placing Basic macro code on the wiki

Hi Ilmari,

Could you give me some advice with regards to the wiki please?

I am in the process of updating Chapter 13 of the Calc Guide to change its emphasis away from macro programming. There are some useful LibreOffice Basic macro code snippets which are to be removed from the document, but I do not want to lose them completely. Therefore, I propose to add them to the wiki – the page at https://wiki.documentfoundation.org/Macros/Calc seems a good place to start.

Two questions arise:

1. Can I view a list of all the pages currently in the
    https://wiki.documentfoundation.org/Macros/Calc area?
2. What would be the best material for me to read to understand the
    markup that should be included to format the code snippets nicely?

Thanks in advance.

Regards,

Steve

Hi Ilmari,

Could you give me some advice with regards to the wiki please?

I am in the process of updating Chapter 13 of the Calc Guide to change its emphasis away from macro programming. There are some useful LibreOffice Basic macro code snippets which are to be removed from the document, but I do not want to lose them completely. Therefore, I propose to add them to the wiki – the page at https://wiki.documentfoundation.org/Macros/Calc seems a good place to start.

Two questions arise:

1. Can I view a list of all the pages currently in the
   https://wiki.documentfoundation.org/Macros/Calc area?

https://wiki.documentfoundation.org/Special:PrefixIndex?prefix=Macros%2FCalc&namespace=0

2. What would be the best material for me to read to understand the
   markup that should be included to format the code snippets nicely?

I think we found that lang set to vbnet is the best for syntax highlighting, so put your code inside a block like:

<syntaxhighlight lang="vbnet">
</syntaxhighlight>

Ilmari

Thanks Ilmari,

I have created one of the pages at https://wiki.documentfoundation.org/Macros/Calc/ba019. Do I need to do anything to prepare it for translation?

Regards,

Steve

The translation needs to be prepared by hand according to these instructions: https://wiki.documentfoundation.org/TDF_Wiki/Multilingual#Content_with_global_focus

In this case it is a bit tedious as you ideally have to include many snippets in the translation (while excluding the content and markup that should remain untranslated). I guess the argument names in the description section could be included in the translation. You would also want to include every single comment in the example code block.

Ilmari

Thanks Ilmari.

I expect there to be twelve of these pages. I plan to create all of the pages first and then add the translation markups afterwards.

I will confirm via the email list when I am finished. Maybe you or somebody else with suitable knowledge would give the pages a quick check at that point, just to make sure that I have not done anything wrong in terms of adding the translation markups.

The technical details of the pages shouldn't need much checking as they are mostly copied directly from the published 7.0 Calc Guide.

Regards,

Steve

I have completed creating English versions of the wiki pages that include the Basic macros from Chapter 13 of the Calc Guide.

The index page for these files can be found at https://wiki.documentfoundation.org/Macros/Calc. I have added some translation markups to this index page . However, I've never done this before. Would it be possible for Ilmari (or somebody else with the appropriate knowledge) to have a look at this page and advise if any of these translation markups are inappropriate?

Thanks in advance.

Regards,

Steve

It looked fine, thanks for the work. I added {{#translation:}} suffixes to the macro page links, so they will always point to the pages in the relevant language.

Ilmari

Hi Ilmari,

Thank you for the feedback.

I have added translation markups to all twelve of the new pages and marked them for translation. I've also marked the index page for translation.

Please let me know if you spot anything relating to translation that I have implemented in a sub-optimal way.

Regards,

Steve

Thanks, I'm reviewing them.

I added categories.

I added {{#translation:}} suffixes to the menu templates.

Today we discovered that we can't yet use the sidebar language list, so we switched back to the old style. This means we have to keep adding the <languages/> element at the top after all. The reason is that in the sidebar, the English item will have a link ending in /en and visiting this link will show broken menu templates. This will fortunately be solved after this task is completed: https://phabricator.wikimedia.org/T47096

This sort of breaking up of sentences should not be done, because not all languages have the same rules for word order as English:
<translate>This</translate> [[Media:Create_named_range_with_macro.ods | <translate>Calc spreadsheet</translate> ]] <translate>contains the above LibreOffice Basic code.</translate>

Ilmari

Thanks Ilmari.

I'll apply what you have done to the other affected pages.

Regards,

Steve

All other pages updated accordingly. Please let me know if you spot any other issues with these pages.

Thanks again for all your assistance Ilmari.

Regards,

Steve