Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to help book #1794

Merged
merged 8 commits into from
Aug 20, 2024
Merged

Conversation

Eitot
Copy link
Contributor

@Eitot Eitot commented Aug 18, 2024

Help books can now be localised with Crowdin. Crowdin supports localising HTML files:
image

For this to work, the source HTML files and localised HTML files should have the same structure. I went through the HTML files and:

  1. removed all HTML files for locales that weren't localised at all,
  2. updated the remaining HTML files to match the structure of the English HTML files and
  3. updated the English HTML files to include some changes the French HTML files have (which seems to be the most maintained).

Some caveats:

  • Crowdin uses XPath to find and match localised strings in the HTML files. This is not ideal, because making changes to the structure, such as adding a <p> somewhere, can cause Crowdin to remove and re-add all subsequent elements. I will be looking into this more, maybe we have to use <div> elements with id attributes to make the references clearer.
  • Since the English HTML files are now the base for all other HTML files, individual tweaks can no longer be used. So far I only came across witdh attributes in table columns. However, these can be replaced with CSS.

Eitot and others added 5 commits August 17, 2024 14:03
This removes all HTML files from the help book for those locales that have no localised files at all. Users that use these locales will use the English help book instead.
- As pointed out by Mario Guzman, the most reliable way to see the
  updated content is to __drag__ the debug build of Vienna.app into the
  Applications folder, log out, log back in and wait a few minutes.
- For some reason, Xcode does not show the "Products" folder if it is
  the last

https://marioaguzman.wordpress.com/2020/09/12/auth/
https://forums.developer.apple.com/forums/thread/77406
barijaona
barijaona previously approved these changes Aug 19, 2024
Copy link
Member

@barijaona barijaona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to add the --generate-summaries option to hiutil calls in the IndexHelpbook.shscript, as the help pages miss <meta name="description" ...> tags.

@Eitot
Copy link
Contributor Author

Eitot commented Aug 19, 2024

The manual page warns that it "may be slow" to generate those. I will have to test. Maybe we need to provide the script's input files so that it runs only when changes are made to those files. That way it shouldn't interfere with incremental builds.

@Eitot
Copy link
Contributor Author

Eitot commented Aug 19, 2024

Speed is not an issue, but the result doesn't look promising:

Indexing help book for fr ...
/Vienna.html
    Title: Aide Vienna
    Descr:  Explications des réglages de l'onglet Advancés des Préférences.
/advanced.html#AdvancedSettingsSection
    Title: (null)
    Descr: (null)
/intro.html
    Title: Introduction à Vienna
    Descr: Pour visualiser au cas par cas les liens pour les pages dans un autre navigateur, choisissez dans le menu contextuel de la page (bouton droit ou Crontrol-clic) la commande "Ouvrir le lien dans XXX" ou "Ouvrir la page dans XXX" où XXX est le nom de votre navigateur internet par défaut. 
/faq.html#I_found_a_problem_with_Vienna._How_do_I_report_it
    Title: Comment faire ?
    Descr:  Par contre, pour les serveurs qui exigent un cookie, le nom d'utilisateur et le mot de passe ne doivent PAS apparaître dans la boite de dialogue "Infos" du flux. 
/keyboard.html#KeyboardSection
    Title: (null)
    Descr: (null)

This tag causes the help indexer to index only the anchors, not the content. Apple's documentation recommends to use this only for the title page of the help book, if it only contains links to other pages/sections.
hiutil complains if it cannot find an identifier in the HTML pages.
The summary will be shown when in the search results of the help viewer. I reused the phrases on the title page (Vienna.html) with some modifications to make it clear that the entry refers to Vienna.
@Eitot Eitot added the changes localisations 💬 This pull request adds, changes or removes localisation keys. label Aug 19, 2024
@TAKeanice
Copy link
Contributor

I started by adding the German localization to the intro file :) Or is that an old one?

@Eitot
Copy link
Contributor Author

Eitot commented Aug 19, 2024

I did some digging and found that the "robots" tag affected the indexer. Those pages that have "keywords" or "anchors" as the value won't be indexed fully, i.e. none of the content, only metadata. This is why above the result was shown as (null). I fixed that by applying that tag to the title page only, which doesn't need to be indexed except for the anchors. I wasn't happy with the result of the --generate-summaries option, so I decided to add descriptions myself by borrowing the phrases on the title page (which some modifications).

I uploaded the updated HTML files to Crowdin.

/advanced.html#AdvancedSettingsSection
    Title: Advanced Settings
    Descr: Explains advanced settings in Vienna.
/intro.html#intro-page
    Title: Introduction to Vienna
    Descr: Learn how to get started with Vienna.
/Vienna.html#title-page
    Title: (null)
    Descr: (null)
/faq.html#faq-page
    Title: How Do I?
    Descr: Frequently asked questions about Vienna, getting support and troubleshooting steps.
/keyboard.html#KeyboardSection
    Title: Keyboard Shortcuts
    Descr: Discover keyboard shortcuts for common commands in Vienna.

@Eitot
Copy link
Contributor Author

Eitot commented Aug 19, 2024

I started by adding the German localization to the intro file :) Or is that an old one?

Crowdin has the most recent version. It should be most up-to-date there. The German files miss entire sections and I find that there are many mistakes and weird phrases in the existing translations. :/

@barijaona barijaona merged commit 92969c2 into ViennaRSS:master Aug 20, 2024
2 checks passed
@Eitot Eitot deleted the feature/help-book branch August 20, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes localisations 💬 This pull request adds, changes or removes localisation keys.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants