Skip to content

Commit

Permalink
allow customized ocd2
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Dec 31, 2023
1 parent 7aba0e2 commit 6ca69ba
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/downloader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import { FileLoader } from './loader'

const builtinOpenCC = [
'HKVariants.ocd2',
'HKVariantsRev.ocd2',
'HKVariantsRevPhrases.ocd2',
'JPShinjitaiCharacters.ocd2',
'JPShinjitaiPhrases.ocd2',
'JPVariants.ocd2',
'JPVariantsRev.ocd2',
'STCharacters.ocd2',
'STPhrases.ocd2',
'TSCharacters.ocd2',
'TSPhrases.ocd2',
'TWPhrases.ocd2',
'TWPhrasesRev.ocd2',
'TWVariants.ocd2',
'TWVariantsRev.ocd2',
'TWVariantsRevPhrases.ocd2',
'hk2s.json',
'hk2t.json',
'jp2t.json',
Expand Down Expand Up @@ -89,7 +105,7 @@ abstract class Downloader implements FileLoader {
}

getURL (file: string) {
if (builtinOpenCC.includes(file) || file.endsWith('.ocd2')) {
if (builtinOpenCC.includes(file)) {
return openccCDN + file
}
return this.prefix + file
Expand Down

0 comments on commit 6ca69ba

Please sign in to comment.