Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
add workflow, flatten checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Katsute committed Aug 31, 2024
1 parent 9a68958 commit fd92c44
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 53 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: npm CI
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, reopened, synchronize]
merge_group:
types: [checks_requested]

jobs:
ci:
name: npm CI
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Test
run: node test.js
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<br>
<div>
<a href="https://github.com/KatsuteDev/Background#readme">
<img alt="logo" width="100" height="100" align="left" src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/icon.png">
Expand All @@ -7,4 +6,4 @@
<p>Localization strings for the <a href="https://github.com/KatsuteDev/Background">Background</a> VSCode extension</p>
<br>
<br>
</div>
</div>
5 changes: 5 additions & 0 deletions contributors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"en": [
"Katsute"
]
}
82 changes: 31 additions & 51 deletions en/readme.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,33 @@
{
"header": {
"description": "The most advanced background image extension for VSCode",
"img_rating": "Rating",
"img_installs": "Installs",
"img_downloads": "Downloads"
},
"description": "Add multiple background images for the window, editors, sidebars, or the panel. Load backgrounds from file, [glob](https://github.com/isaacs/node-glob#glob-primer), or URL. Transition between multiple background images.",
"installation:": {
"_": "Installation",
"description": "* Install from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=katsute.code-background).\nInstall directly from VSCode using the id katsute.[`code-background`](https://marketplace.visualstudio.com/items?itemName=katsute.code-background).",
"usage": {
"_": "Usage",
"description": "1. Type `Background: Configuration` in the command pallette or press the **Background** tab in the statusbar.\n2. Select where you want to add a background (Window, Editor, Sidebar, Panel).\n3. Add backgrounds and change how it should be displayed.\n4. Use `Background: Install` or press the install button."
}
},
"features": {
"_": "Features",
"multiple_backgrounds": {
"_": "Multiple Backgrounds",
"description": "Add background images for the whole window, editors, sidebars, or the panel. Transition between multiple background images.",
"img_window": "Full Window",
"img_other": "Editor, Sidebar, and Terminal",
"img_slideshow": "Slideshow"
},
"configuration": {
"_": "Configuration Menu",
"description": "Type `Background: Configuration` in the command pallette or press the Background tab in the statusbar to access the configuration menu."
},
"path": {
"_": "Glob, URL, and Environment Variable Support",
"description": "Add background images by file, folder, [glob](https://github.com/isaacs/node-glob#glob-primer), or URL.\n**⚠️ Use only **`/`** for directories\nnode-glob only accepts `/` as path separators, `\\` is reserved for escape characters."
}
},
"commands": {
"_": "Commands",
"command": "Command",
"description": "Description"
},
"configuration": {
"_": "Configuration",
"description": "Use the `Background: Configuration` command to access the configuration menu.\n\nBackground properties are saved as arrays so you can have different options for different UI elements.\n\nThe order settings are saved in is:\n0. Window\n1. Editor\n2. Sidebar\n3. Panel"
},
"environment": {
"_": "Environment Variables",
"variable": "Variable",
"description": "Description",
"desc_workspace": "Current VSCode project folder",
"desc_home": "Current user's home directory",
"desc_env": "System environment variable"
},
"license": "This extension is released under the [GNU General Public License (GPL) v2.0](https://github.com/KatsuteDev/Background/blob/main/LICENSE)."
"header.description": "The most advanced background image extension for VSCode",
"header.img_rating": "Rating",
"header.img_installs": "Installs",
"header.img_downloads": "Downloads",
"description": "Add multiple background images for the window, editors, sidebars, or the panel. Load backgrounds from file, glob, or URL. Transition between multiple background images.",
"installation._": "Installation",
"installation.description": "* Install from the Visual Studio Marketplace.\nInstall directly from VSCode using the id katsute.`code-background`.",
"installation.usage._": "Usage",
"installation.usage.description": "1. Type `Background: Configuration` in the command pallette or press the **Background** tab in the statusbar.\n2. Select where you want to add a background (Window, Editor, Sidebar, Panel).\n3. Add backgrounds and change how it should be displayed.\n4. Use `Background: Install` or press the install button.",
"features._": "Features",
"features.multiple_backgrounds._": "Multiple Backgrounds",
"features.multiple_backgrounds.description": "Add background images for the whole window, editors, sidebars, or the panel. Transition between multiple background images.",
"features.multiple_backgrounds.img_window": "Full Window",
"features.multiple_backgrounds.img_other": "Editor, Sidebar, and Terminal",
"features.multiple_backgrounds.img_slideshow": "Slideshow",
"features.configuration._": "Configuration Menu",
"features.configuration.description": "Type `Background: Configuration` in the command pallette or press the Background tab in the statusbar to access the configuration menu.",
"features.path._": "Glob, URL, and Environment Variable Support",
"features.path.description": "Add background images by file, folder, glob, or URL.\n**⚠️ Use only **`/`** for directories\nnode-glob only accepts `/` as path separators, `\\` is reserved for escape characters.",
"commands._": "Commands",
"commands.command": "Command",
"commands.description": "Description",
"configuration._": "Configuration",
"configuration.description": "Use the `Background: Configuration` command to access the configuration menu.\n\nBackground properties are saved as arrays so you can have different options for different UI elements.\n\nThe order settings are saved in is:\n0. Window\n1. Editor\n2. Sidebar\n3. Panel",
"environment._": "Environment Variables",
"environment.variable": "Variable",
"environment.description": "Description",
"environment.desc_workspace": "Current VSCode project folder",
"environment.desc_home": "Current user's home directory",
"environment.desc_env": "System environment variable",
"license": "This extension is released under the GNU General Public License (GPL) v2.0."
}
31 changes: 31 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const fs = require("fs");
const path = require("path");

const r1 = Object.keys(JSON.parse(fs.readFileSync(path.join(__dirname, "en", "readme.json"), "utf-8")));
const t1 = Object.keys(JSON.parse(fs.readFileSync(path.join(__dirname, "en", "translations.json"), "utf-8")));

let error = false;

for(const folder of fs.readdirSync(__dirname).filter(f => !f.includes('.') && f !== "en")){
const r2 = Object.keys(JSON.parse(fs.readFileSync(path.join(__dirname, folder, "readme.json"), "utf-8")));

for(const key of r1){
if(!r2.includes(key)){
console.error(`[${folder}] Missing README translation for '${key}'`);
error = true;
}
}

const t2 = Object.keys(JSON.parse(fs.readFileSync(path.join(__dirname, folder, "translations.json"), "utf-8")));

for(const key of t1){
if(!t2.includes(key)){
console.error(`[${folder}] Missing package translation for '${key}'`);
error = true;
}
}
}

if(error){
process.exit(1);
}

0 comments on commit fd92c44

Please sign in to comment.