Skip to content

Commit 0d5063b

Browse files
committed
Ship en_US hunspell dictionaries on Windows and OSX
For now, this uses the same OpenOffice dictionaries that were used in previous official releases, downloaded from https://sourceforge.net/projects/openofficeorg.mirror/files/contrib/dictionaries/ In the future this could be updated to some newer dictionary like SCOWL's. Fixes #21.
1 parent 60897b2 commit 0d5063b

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; This file declares all installables related to spell checking and thesaurii in Aegisub
22

33
[Files]
4-
Source: {#DEPS_DIR}\dictionaries\en_US.aff; DestDir: {app}\dictionaries; Flags: skipifsourcedoesntexist ignoreversion
5-
Source: {#DEPS_DIR}\dictionaries\en_US.dic; DestDir: {app}\dictionaries; Flags: skipifsourcedoesntexist ignoreversion
4+
Source: {#DEPS_DIR}\dictionaries\en_US.aff; DestDir: {app}\dictionaries; Flags: ignoreversion; Components: dictionaries/en_US
5+
Source: {#DEPS_DIR}\dictionaries\en_US.dic; DestDir: {app}\dictionaries; Flags: ignoreversion; Components: dictionaries/en_US

packages/win_installer/portable/create-portable.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Copy-New-Item $InstallerDir\bin\aegisub.exe $PortableOutputDir
5151

5252
Write-Output 'Copying - translations'
5353
Copy-New-Items "$InstallerDir\share\locale\*" "$PortableOutputDir\locale" -Recurse
54+
Write-Output 'Copying - dictionaries'
55+
Copy-New-Item $InstallerDepsDir\dictionaries\en_US.aff $PortableOutputDir\dictionaries
56+
Copy-New-Item $InstallerDepsDir\dictionaries\en_US.dic $PortableOutputDir\dictionaries
5457
Write-Output 'Copying - codecs'
5558
Write-Output 'Copying - codecs\Avisynth'
5659
Copy-New-Item $InstallerDepsDir\AvisynthPlus64\x64\system\DevIL.dll $PortableOutputDir

tools/osx-bundle.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ echo "---- Copying dictionaries ----"
6161
if test -f "${DICT_DIR}"; then
6262
cp -v "${DICT_DIR}/*" "${PKG_DIR}/Contents/SharedSupport/dictionaries"
6363
else
64-
echo "Specified dictionary directory ${DICT_DIR} not found!"
64+
echo "Specified dictionary directory ${DICT_DIR} not found. Downloading dictionaries:"
65+
mkdir "${BUILD_DIR}/dictionaries"
66+
curl -L "https://downloads.sourceforge.net/project/openofficeorg.mirror/contrib/dictionaries/en_US.zip" -o "${BUILD_DIR}/dictionaries/en_US.zip"
67+
unzip "${BUILD_DIR}/dictionaries/en_US.zip" -d "${BUILD_DIR}/dictionaries"
68+
cp -v "${BUILD_DIR}/dictionaries/en_US.aff" "${PKG_DIR}/Contents/SharedSupport/dictionaries"
69+
cp -v "${BUILD_DIR}/dictionaries/en_US.dic" "${PKG_DIR}/Contents/SharedSupport/dictionaries"
6570
fi
6671

6772
echo

tools/win-installer-setup.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,14 @@ if (!(Test-Path VC_redist)) {
7979
Invoke-WebRequest https://aka.ms/vs/17/release/VC_redist.x64.exe -OutFile "$redistDir\VC_redist.x64.exe" -UseBasicParsing
8080
}
8181

82-
# TODO dictionaries
82+
# dictionaries
83+
if (!(Test-Path dictionaries)) {
84+
New-Item -ItemType Directory dictionaries
85+
[Net.ServicePointManager]::SecurityProtocol = "Tls12" # Needed since otherwise downloading fails in some places like on the GitHub CI: https://stackoverflow.com/a/66614041/4730656
86+
Invoke-WebRequest https://downloads.sourceforge.net/project/openofficeorg.mirror/contrib/dictionaries/en_US.zip -UserAgent "Wget" -OutFile en_US.zip -UseBasicParsing
87+
Expand-Archive -LiteralPath en_US.zip -DestinationPath dictionaries
88+
Remove-Item en_US.zip
89+
}
8390

8491
# localization
8592
Set-Location $BuildRoot

0 commit comments

Comments
 (0)