Skip to content

Fixed title translation in documentation file - #28

Merged
josephsl merged 1 commit into
nvdaaddons:masterfrom
abdel792:docTitleTranslation
May 6, 2023
Merged

josephsl merged 1 commit into
nvdaaddons:masterfrom
abdel792:docTitleTranslation

Conversation

@abdel792

@abdel792 abdel792 commented May 5, 2023 •

Copy link
Copy Markdown
Contributor

This PR provides the following fix

Fixed title translation in documentation file when using scons command.

Changed line 302 of the sconstruct file from:

  • env.Depends(htmlFile, mdFile)

To:

  • env.Depends(htmlFile, [mdFile, moFile])

The generation of html files must also depend on mo files.

Uncompiled po files provide no translations.

Without this correction, the titles of the documentations are never translated.

…t file.

Changed line 302 from:

	env.Depends(htmlFile, mdFile)

To:

	env.Depends(htmlFile, [mdFile, moFile])

The generation of html files must also depend on mo files.

Uncompiled po files provide no translations.

Without this correction, the titles of the documentations are never translated.
@josephsl

josephsl commented May 6, 2023

Copy link
Copy Markdown
Contributor

Got it - thanks for reminding us about the importance of Gettext mo files.

@josephsl
josephsl merged commit eb8e32a into nvdaaddons:master May 6, 2023
XLTechie pushed a commit to XLTechie/AddonTemplate that referenced this pull request Jun 10, 2023
…sting translations.

However if there was no moFile set, likely because there has not been any translation yet, sconstruct failed on a NameError.
To solve this, I put the access of moFile in a try-except-else block.
XLTechie pushed a commit to XLTechie/AddonTemplate that referenced this pull request Jun 10, 2023
…sting translations.

Pr nvdaaddons#28 included moFile in the dependency for HTML file generation.
However if there was no moFile set, likely because there has not been any translation yet, sconstruct failed on a NameError.
To solve this, I put the access of moFile in a try-except-else block.
josephsl added a commit that referenced this pull request Jun 10, 2023
Fix-up of #28 to handle the situation when there are no existing translations.
JulienCochuyt pushed a commit to accessolutions/nvda-addon-template that referenced this pull request Aug 3, 2026
Closes nvdaaddons#28.
Summary

Switches the template from pre-commit + the
pre-commit.ci service to prek,
a fast, drop-in alternative written in Rust. As discussed in nvdaaddons#28, this goes further than
NVDA's swap by also migrating the config from .pre-commit-config.yaml to prek's native
prek.toml. Maintainers confirmed disabling pre-commit.ci on this repo is preferred.
Changes

    pyproject.toml: dev dependency pre-commit==4.2.0 -> prek==0.4.8 (+ uv.lock).
    Config: .pre-commit-config.yaml removed, replaced by prek.toml (generated with
    prek util yaml-to-toml, then hand-adjusted).
        Dropped the pre-commit.ci ci: block and the check-pre-commit-ci-config hook.
        Moved the file-oriented pre-commit-hooks to prek's builtin repo (no clone / no rev).
        Kept check-ast, debug-statements and check-illegal-windows-names on the upstream
        pre-commit-hooks repo: the first two have no builtin equivalent, and the builtin
        check-illegal-windows-names only matches files that already have illegal names, which
        check-hooks-apply flags as unused on a clean repo.
    CI (build_addon.yml): the "Code checks" step now runs uv run prek run --all-files
    (the SKIP env var is still honored).
    readme.md: replaced the pre-commit.ci recommendation with prek usage
    (uv run prek install / uv run prek run --all-files).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants