Skip to content

Commit 3eddf8d

Browse files
authored
Merge 4b872d8 into 63be1fd
2 parents 63be1fd + 4b872d8 commit 3eddf8d

3 files changed

Lines changed: 8 additions & 13 deletions

File tree

source/documentationUtils.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: UTF-8 -*-
22
# A part of NonVisual Desktop Access (NVDA)
3-
# Copyright (C) 2006-2025 NV Access Limited, Łukasz Golonka
3+
# Copyright (C) 2006-2025 NV Access Limited, Łukasz Golonka, Cyrille Bougot
44
# This file may be used under the terms of the GNU General Public License, version 2 or later.
55
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
66

@@ -42,12 +42,9 @@ def getDocFilePath(fileName: str, localized: bool = True) -> str | None:
4242
if not os.path.isdir(tryDir):
4343
continue
4444

45-
# Some out of date translations might include .txt files which are now .html files in newer translations.
46-
# Therefore, ignore the extension and try both .html and .txt.
47-
for tryExt in ("html", "txt"):
48-
tryPath = os.path.join(tryDir, f"{fileName}.{tryExt}")
49-
if os.path.isfile(tryPath):
50-
return tryPath
45+
tryPath = os.path.join(tryDir, f"{fileName}.html")
46+
if os.path.isfile(tryPath):
47+
return tryPath
5148
return None
5249
else:
5350
# Not localized.

source/installer.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,9 @@ def getDocFilePath(fileName, installDir):
140140
tryDir = os.path.join(rootPath, tryLang)
141141
if not os.path.isdir(tryDir):
142142
continue
143-
# Some out of date translations might include .txt files which are now .html files in newer translations.
144-
# Therefore, ignore the extension and try both .html and .txt.
145-
for tryExt in ("html", "txt"):
146-
tryPath = os.path.join(tryDir, "%s.%s" % (fileName, tryExt))
147-
if os.path.isfile(tryPath):
148-
return tryPath
143+
tryPath = os.path.join(tryDir, f"{fileName}.html"
144+
if os.path.isfile(tryPath):
145+
return tryPath
149146

150147

151148
def copyProgramFiles(destPath):

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ Instead, a `callback` property has been added, which returns a function that per
279279
* Added `TypingEcho` enum in `config.configFlags` to represent these modes, 0=Off, 1=Only in edit controls, 2=Always.
280280
* `gui.settingsDialogs.KeyboardSettingsPanel.wordsCheckBox` and `gui.settingsDialogs.KeyboardSettingsPanel.charsCheckBox` has been removed.
281281
* The `winUser.paint` has been renamed from `painStruct` to `paintStruct`, fixing a bug where passing in a `PAINTSTRUCT` would raise an exception. (#17744)
282+
* `documentationUtils.getDocFilePath` and `installer.getDocFilePath` no longer look for `.txt` files in locale documentation folders. (#17911, @CyrilleB79)
282283

283284
#### Deprecations
284285

0 commit comments

Comments
 (0)