diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/1-bug-report.md similarity index 100% rename from .github/ISSUE_TEMPLATE/bug-report.md rename to .github/ISSUE_TEMPLATE/1-bug-report.md diff --git a/.github/ISSUE_TEMPLATE/enhancement-request.md b/.github/ISSUE_TEMPLATE/2-enhancement-request.md similarity index 100% rename from .github/ISSUE_TEMPLATE/enhancement-request.md rename to .github/ISSUE_TEMPLATE/2-enhancement-request.md diff --git a/.github/ISSUE_TEMPLATE/3-language-feature.md b/.github/ISSUE_TEMPLATE/3-language-feature.md new file mode 100644 index 0000000000..5ff2028ccb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3-language-feature.md @@ -0,0 +1,9 @@ +--- +name: Language specific issue +about: Report a language-specific issue or feature request +title: '[REPLACE ME WITH YOUR REQUESTED LANGUAGE]: ' +labels: 'area/linguistics' +assignees: '' + +--- + diff --git a/.github/ISSUE_TEMPLATE/tech-debt.md b/.github/ISSUE_TEMPLATE/4-tech-debt.md similarity index 100% rename from .github/ISSUE_TEMPLATE/tech-debt.md rename to .github/ISSUE_TEMPLATE/4-tech-debt.md diff --git a/.github/ISSUE_TEMPLATE/other-issue.md b/.github/ISSUE_TEMPLATE/5-other-issue.md similarity index 100% rename from .github/ISSUE_TEMPLATE/other-issue.md rename to .github/ISSUE_TEMPLATE/5-other-issue.md diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 004e806b77..b365d4567d 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -1,5 +1,6 @@ name: Performance Benchmarks - +permissions: + contents: read on: push: branches: [master] diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 040795e53b..c0d8977d0a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,7 +10,8 @@ # supported CodeQL languages. # name: "CodeQL" - +permissions: + contents: read on: push: branches: [ "master" ] diff --git a/.github/workflows/publish-edge.yml b/.github/workflows/publish-edge.yml index 57b263d774..88a4118cdf 100644 --- a/.github/workflows/publish-edge.yml +++ b/.github/workflows/publish-edge.yml @@ -8,8 +8,6 @@ jobs: environment: cd outputs: result: ${{ steps.webStorePublish.outcome }} - permissions: - actions: write steps: - uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2 # pin@v1.11 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a50e8c7f6..7a2adf38f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,6 @@ jobs: runs-on: ubuntu-latest permissions: actions: write - contents: write steps: - name: Dispatch publish-chrome uses: aurelien-baudet/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7 # pin@v2 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index e1ee58aef5..578014922b 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -34,7 +34,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 + uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 with: results_file: results.sarif results_format: sarif diff --git a/ext/data/recommended-dictionaries.json b/ext/data/recommended-dictionaries.json index 245f638e18..da27b7d5ba 100644 --- a/ext/data/recommended-dictionaries.json +++ b/ext/data/recommended-dictionaries.json @@ -1,13 +1,28 @@ { "ja": { "terms": [ - {"name": "Jitendex", "url": "https://github.com/stephenmk/stephenmk.github.io/releases/latest/download/jitendex-yomitan.zip"} + { + "name": "Jitendex", + "downloadUrl": "https://github.com/stephenmk/stephenmk.github.io/releases/latest/download/jitendex-yomitan.zip", + "description": "A free and openly licensed Japanese-to-English dictionary with example sentences, usage notes, etymology notes, cross references, antonyms, definition notes.", + "homepage": "https://jitendex.org" + } ], "kanji": [ - {"name": "KANJIDIC", "url": "https://github.com/themoeway/jmdict-yomitan/releases/latest/download/KANJIDIC_english.zip"} + { + "name": "KANJIDIC", + "downloadUrl": "https://github.com/themoeway/jmdict-yomitan/releases/latest/download/KANJIDIC_english.zip", + "description": "An English dictionary with readings, meanings, stroke order diagrams, frequency, grade level, JLPT level and frequency of kanji characters.", + "homepage": "https://github.com/themoeway/jmdict-yomitan?tab=readme-ov-file#kanjidic-for-yomitan" + } ], "frequency": [ - {"name": "BCCWJ", "url": "https://github.com/Kuuuube/yomitan-dictionaries/releases/download/yomitan-permalink/BCCWJ_SUW_LUW_combined.zip"} + { + "name": "BCCWJ", + "downloadUrl": "https://github.com/Kuuuube/yomitan-dictionaries/releases/download/yomitan-permalink/BCCWJ_SUW_LUW_combined.zip", + "description": "Based on the Balanced Corpus of Contemporary Written Japanese covering books, magazines, newspapers, blogs, forums, textbooks, and legal documents among others.", + "homepage": "https://github.com/Kuuuube/yomitan-dictionaries?tab=readme-ov-file#bccwj-suw-luw-combined" + } ], "grammar": [], "pronunciation": [] diff --git a/ext/data/schemas/recommended-dictionaries-schema.json b/ext/data/schemas/recommended-dictionaries-schema.json index 36d8f03fd9..5a2540fe8c 100644 --- a/ext/data/schemas/recommended-dictionaries-schema.json +++ b/ext/data/schemas/recommended-dictionaries-schema.json @@ -13,14 +13,23 @@ "type": "object", "required": [ "name", - "url" + "downloadUrl", + "description" ], "properties": { "name": { "type": "string", "minLength": 2 }, - "url": { + "downloadUrl": { + "type": "string", + "minLength": 2 + }, + "description": { + "type": "string", + "minLength": 2 + }, + "homepage": { "type": "string", "minLength": 2 } @@ -33,14 +42,23 @@ "type": "object", "required": [ "name", - "url" + "downloadUrl", + "description" ], "properties": { "name": { "type": "string", "minLength": 2 }, - "url": { + "downloadUrl": { + "type": "string", + "minLength": 2 + }, + "description": { + "type": "string", + "minLength": 2 + }, + "homepage": { "type": "string", "minLength": 2 } @@ -53,14 +71,23 @@ "type": "object", "required": [ "name", - "url" + "downloadUrl", + "description" ], "properties": { "name": { "type": "string", "minLength": 2 }, - "url": { + "downloadUrl": { + "type": "string", + "minLength": 2 + }, + "description": { + "type": "string", + "minLength": 2 + }, + "homepage": { "type": "string", "minLength": 2 } @@ -73,14 +100,23 @@ "type": "object", "required": [ "name", - "url" + "downloadUrl", + "description" ], "properties": { "name": { "type": "string", "minLength": 2 }, - "url": { + "downloadUrl": { + "type": "string", + "minLength": 2 + }, + "description": { + "type": "string", + "minLength": 2 + }, + "homepage": { "type": "string", "minLength": 2 } @@ -93,14 +129,23 @@ "type": "object", "required": [ "name", - "url" + "downloadUrl", + "description" ], "properties": { "name": { "type": "string", "minLength": 2 }, - "url": { + "downloadUrl": { + "type": "string", + "minLength": 2 + }, + "description": { + "type": "string", + "minLength": 2 + }, + "homepage": { "type": "string", "minLength": 2 } diff --git a/ext/info.html b/ext/info.html index b793dfc27f..91658ba2d9 100644 --- a/ext/info.html +++ b/ext/info.html @@ -50,7 +50,7 @@
  • Support and source code: Github
  • Release notes: This version | All versions
  • More extension information: Permissions | Licenses | Issues
  • -
  • Enjoying Yomitan? Help us by writing a review on the Firefox/Chrome store! Firefox | Chrome
  • +
  • Enjoying Yomitan? Help us by writing a review on the Firefox/Chrome/Edge store! Firefox | Chrome | Edge
  • diff --git a/ext/js/language/language-descriptors.js b/ext/js/language/language-descriptors.js index 8277cee8bf..e7a01d5cff 100644 --- a/ext/js/language/language-descriptors.js +++ b/ext/js/language/language-descriptors.js @@ -139,6 +139,12 @@ const languageDescriptors = [ removeAlphabeticDiacritics, }, }, + { + iso: 'hi', + iso639_3: 'hin', + name: 'Hindi', + exampleText: 'पढ़ने के लिए', + }, { iso: 'hu', iso639_3: 'hun', diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js index f9b901c0bd..206c721632 100644 --- a/ext/js/pages/settings/dictionary-import-controller.js +++ b/ext/js/pages/settings/dictionary-import-controller.js @@ -199,7 +199,7 @@ export class DictionaryImportController { /** * - * @param {import('dictionary-recommended.js').Dictionary[]} recommendedDictionaries + * @param {import('dictionary-recommended.js').RecommendedDictionary[]} recommendedDictionaries * @param {HTMLElement} dictionariesList * @param {Set} installedDictionaryNames * @param {Set} installedDictionaryDownloadUrls @@ -214,15 +214,25 @@ export class DictionaryImportController { } const template = this._settingsController.instantiateTemplate('recommended-dictionaries-list-item'); const label = querySelectorNotNull(template, '.settings-item-label'); + const description = querySelectorNotNull(template, '.description'); + /** @type {HTMLAnchorElement} */ + const homepage = querySelectorNotNull(template, '.homepage'); /** @type {HTMLButtonElement} */ const button = querySelectorNotNull(template, '.action-button[data-action=import-recommended-dictionary]'); - button.disabled = installedDictionaryNames.has(dictionary.name) || installedDictionaryDownloadUrls.has(dictionary.url); + button.disabled = installedDictionaryNames.has(dictionary.name) || installedDictionaryDownloadUrls.has(dictionary.downloadUrl); const urlAttribute = document.createAttribute('data-import-url'); - urlAttribute.value = dictionary.url; + urlAttribute.value = dictionary.downloadUrl; button.attributes.setNamedItem(urlAttribute); label.textContent = dictionary.name; + description.textContent = dictionary.description; + if (dictionary.homepage) { + homepage.target = '_blank'; + homepage.href = dictionary.homepage; + } else { + homepage.remove(); + } dictionariesList.append(template); } diff --git a/ext/templates-settings.html b/ext/templates-settings.html index 23c014f15e..c12ba24864 100644 --- a/ext/templates-settings.html +++ b/ext/templates-settings.html @@ -124,6 +124,10 @@
    +
    +
    + Homepage +
    diff --git a/types/ext/dictionary-recommended.d.ts b/types/ext/dictionary-recommended.d.ts index 6eba321b5f..41b66eab00 100644 --- a/types/ext/dictionary-recommended.d.ts +++ b/types/ext/dictionary-recommended.d.ts @@ -16,20 +16,22 @@ */ export type RecommendedDictionaries = { - [key: string]: LanguageDictionaries; + [key: string]: LanguageRecommendedDictionaries; }; -export type LanguageDictionaries = { - terms: Dictionary[]; - kanji: Dictionary[]; - frequency: Dictionary[]; - grammar: Dictionary[]; - pronunciation: Dictionary[]; +export type LanguageRecommendedDictionaries = { + terms: RecommendedDictionary[]; + kanji: RecommendedDictionary[]; + frequency: RecommendedDictionary[]; + grammar: RecommendedDictionary[]; + pronunciation: RecommendedDictionary[]; }; -export type Dictionary = { +export type RecommendedDictionary = { name: string; - url: string; + downloadUrl: string; + description: string; + homepage?: string; }; export type RecommendedDictionariesTest = { diff --git a/types/ext/language-descriptors.d.ts b/types/ext/language-descriptors.d.ts index bcb1dfac2b..ae839e3b34 100644 --- a/types/ext/language-descriptors.d.ts +++ b/types/ext/language-descriptors.d.ts @@ -110,6 +110,7 @@ type AllTextProcessors = { grc: { pre: CapitalizationPreprocessors & AlphabeticDiacriticsProcessor; }; + hi: Record; hu: { pre: CapitalizationPreprocessors; };