Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization #401

Closed
wants to merge 14 commits into from
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "node:20",
"postAttachCommand": "npm i",
"postAttachCommand": "git submodule update --init; npm i",
"shutdownAction": "stopContainer"
}
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ body:
required: true
- label: This is actually a bug and not a feature.
required: true
- label: This is not a localization/translation error.
required: true
- label: I am using the latest extension version.
required: true

Expand Down
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ body:
options:
- label: I have checked [existing feature requests](https://github.com/KatsuteDev/Background/issues?q=is%3Aissue+is%3Aopen+label%3A%22feature+request%22).
required: true
- label: I have checked that this feature does not already exist.
- label: This feature does not already exist.
required: true
- label: This is not a localization/translation request.
required: true
- label: I am using the latest extension version.
required: true
Expand Down
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/localization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Translation Issue
description: Report an incorrect translation
labels: [localization]
assignees: []
body:
- type: markdown
attributes:
value: |-
Do not open issues regarding missing languages, they will only be added if someone provides a [PR](https://github.com/KatsuteDev/Background-Localization/pulls).

- type: checkboxes
attributes:
label: Checks
description: |-
Please confirm the following.
options:
- label: This is for a translation error and not a missing translation.
required: true
- label: I am using the latest extension version.
required: true

- type: textarea
attributes:
label: Translation Error
description: |-
Include the text that is translated incorrectly and what it should be translated to.
validations:
required: true
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ updates:
time: "06:00"
timezone: US/Eastern
open-pull-requests-limit: 10
- package-ecosystem: gitsubmodule
directory: /
labels: [dependencies, localization]
assignees: [Katsute]
schedule:
interval: weekly
day: monday
time: "06:00"
timezone: US/Eastern
open-pull-requests-limit: 10
- package-ecosystem: npm
directory: /
labels: [dependencies]
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/localization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (C) 2024 Katsute <https://github.com/Katsute>

name: Localization

on: [workflow_call, pull_request_target]

jobs:
localization:
name: Localization
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Node
uses: actions/setup-node@v4
with:
architecture: x64
node-version: 20

- name: Build
run: node localization.js

- name: Commit to PR
run: |-
git config --global user.name "kdevbot[bot]"
git config --global user.email "155479163+kdevbot[bot]@users.noreply.github.com"

git add README.md
git add package.nls.json
git add package.nls.*.json
git add readme/*
git diff-index --quiet HEAD || git commit -m "Update Localization Files"
git push origin HEAD
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
/meta.json
/LICENSES.txt

/*.vsix
/*.vsix

/package.nls.*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "localization"]
path = localization
url = https://github.com/KatsuteDev/Background-Localization.git
5 changes: 4 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ test

build.js

tsconfig.json
tsconfig.json

readme/
help/
96 changes: 49 additions & 47 deletions HELP.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
# Common Issues

### Code installation is corrupt

This warning may appear after running the uninstall command, reopen VSCode for this to disappear.

If this warning still appears after an uninstall, reinstall [VSCode](https://code.visualstudio.com/download).

### VSCode stopped working [#46](https://github.com/KatsuteDev/Background/issues/46)

This extension modifies an internal file to make backgrounds work, if VSCode stops working replace `%LocalAppData%\Programs\Microsoft VS Code\resources\app\out\vs\workbench\workbench.desktop.main.js` with `workbench.desktop.main-backup.js`.

This extension also modifies `%LocalAppData%\Programs\Microsoft VS Code\resources\app\product.json`, replace with `product-backup.json` if VSCode stops working.

## &nbsp;

### Backgrounds are missing on workspace

The workspace setting will use whatever settings are set for that workspace, it does not fallback to the global setting.

### Opacity is inverted

As of 3.0.0, opacity has been switched from 0 visible and 1 invisible to 1 visible and 0 invisible, use the **useInvertedOpacity** option if you want the old behavior.

### Disable/uninstall doesn't remove background

Backgrounds are not removed on extension disable or uninstall, you must run the **Background: Uninstall** command to remove backgrounds.

### Background doesn't work on window buttons (minimize/maximize/close) [#178](https://github.com/KatsuteDev/Background/issues/178)

These buttons are controlled by the system and not VSCode; and can not be modified by this extension.

## &nbsp;

### (Windows) Doesn't work on WSL [#27](https://github.com/KatsuteDev/Background/issues/27#issuecomment-1233610914)

Backgrounds can not be changed while running this extension in a remote WSL window. Backgrounds must be changed by making changes in the main VSCode window, then opening the remote WSL window.

### (Mac) read-only file system [#76](https://github.com/KatsuteDev/Background/issues/76)

This extension doesn't natively support Mac, write permissions must be granted to the VSCode application:

1. Move `Visual Studio Code.app` from `Download` to the `Application` directory.
2. Run `sudo chmod -R a+rwx '/Applications/Visual Studio Code.app'` to grant write permissions.

### (Linux) snap: read-only file system [#140](https://github.com/KatsuteDev/Background/issues/140#issuecomment-1503820398)

<div align="right"><a href="https://github.com/KatsuteDev/Background/blob/main/HELP.md">English</a> | <a href="https://github.com/KatsuteDev/Background/blob/main/readme/help.ja.md">日本語</a></div>

# Common Issues

### Code installation is corrupt

This warning may appear after running the uninstall command, reopen VSCode for this to disappear.

If this warning still appears after an uninstall, reinstall [VSCode](https://code.visualstudio.com/download).

### VSCode stopped working [#46](https://github.com/KatsuteDev/Background/issues/46)

This extension modifies an internal file to make backgrounds work, if VSCode stops working replace `%LocalAppData%\Programs\Microsoft VS Code\resources\app\out\vs\workbench\workbench.desktop.main.js` with `workbench.desktop.main-backup.js`.

This extension also modifies `%LocalAppData%\Programs\Microsoft VS Code\resources\app\product.json`, replace with `product-backup.json` if VSCode stops working.

## &nbsp;

### Backgrounds are missing on workspace

The workspace setting will use whatever settings are set for that workspace, it does not fallback to the global setting.

### Opacity is inverted

As of 3.0.0, opacity has been switched from 0 visible and 1 invisible to 1 visible and 0 invisible, use the **useInvertedOpacity** option if you want the old behavior.

### Disable/uninstall doesn't remove background

Backgrounds are not removed on extension disable or uninstall, you must run the **Background: Uninstall** command to remove backgrounds.

### Background doesn't work on window buttons (minimize/maximize/close) [#178](https://github.com/KatsuteDev/Background/issues/178)

These buttons are controlled by the system and not VSCode; and can not be modified by this extension.

## &nbsp;

### (Windows) Doesn't work on WSL [#27](https://github.com/KatsuteDev/Background/issues/27#issuecomment-1233610914)

Backgrounds can not be changed while running this extension in a remote WSL window. Backgrounds must be changed by making changes in the main VSCode window, then opening the remote WSL window.

### (Mac) read-only file system [#76](https://github.com/KatsuteDev/Background/issues/76)

This extension doesn't natively support Mac, write permissions must be granted to the VSCode application:

1. Move `Visual Studio Code.app` from `Download` to the `Application` directory.
2. Run `sudo chmod -R a+rwx '/Applications/Visual Studio Code.app'` to grant write permissions.

### (Linux) snap: read-only file system [#140](https://github.com/KatsuteDev/Background/issues/140#issuecomment-1503820398)

Applications installed using [snap](https://snapcraft.io/) are inherently read-only, install VSCode using [deb](https://code.visualstudio.com/download) or [rpm](https://code.visualstudio.com/download).
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<div align="right"><a href="https://github.com/KatsuteDev/Background#readme">English</a> | <a href="https://github.com/KatsuteDev/Background/blob/main/readme/readme.ja.md">日本語</a></div>

<div id="top" align="center">
<br>
<a href="https://github.com/KatsuteDev/Background#readme">
<img alt="logo" width="100" height="100" src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/icon.png">
</a>
<h3>Background</h3>
<h4>The most advanced background image extension for VSCode</h4>
<a href="https://marketplace.visualstudio.com/items?itemName=katsute.code-background"><img alt="rating" src="https://img.shields.io/visual-studio-marketplace/stars/katsute.code-background?style=for-the-badge&logo=visualstudiocode&labelColor=252526&color=0098FF"></a>
<a href="https://marketplace.visualstudio.com/items?itemName=katsute.code-background"><img alt="installs" src="https://img.shields.io/visual-studio-marketplace/i/katsute.code-background?style=for-the-badge&logo=visualstudiocode&labelColor=252526&color=0098FF"></a>
<a href="https://marketplace.visualstudio.com/items?itemName=katsute.code-background"><img alt="downloads" src="https://img.shields.io/visual-studio-marketplace/d/katsute.code-background?style=for-the-badge&logo=visualstudiocode&labelColor=252526&color=0098FF"></a>
<a href="https://marketplace.visualstudio.com/items?itemName=katsute.code-background"><img alt="Rating" src="https://img.shields.io/visual-studio-marketplace/stars/katsute.code-background?style=for-the-badge&logo=visualstudiocode&labelColor=252526&color=0098FF&label=Rating"></a>
<a href="https://marketplace.visualstudio.com/items?itemName=katsute.code-background"><img alt="Installs" src="https://img.shields.io/visual-studio-marketplace/i/katsute.code-background?style=for-the-badge&logo=visualstudiocode&labelColor=252526&color=0098FF&label=Installs"></a>
<a href="https://marketplace.visualstudio.com/items?itemName=katsute.code-background"><img alt="Downloads" src="https://img.shields.io/visual-studio-marketplace/d/katsute.code-background?style=for-the-badge&logo=visualstudiocode&labelColor=252526&color=0098FF&label=Downloads"></a>
</div>

<br>
Expand Down Expand Up @@ -38,21 +40,21 @@ Add background images for the whole window, editors, sidebars, or the panel. Tra

<div align="center">
<h6>Full Window</h6>
<img alt="window background" src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/window.gif">
<img src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/window.gif">
<br>
<h6>Editor, Sidebar, and Terminal</h6>
<img alt="editor background" src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/editor.gif">
<img src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/editor.gif">
<br>
<h6>Slideshow</h6>
<img alt="multiple backgrounds" src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/transition.gif">
<img src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/transition.gif">
</div>

#### Configuration Menu

Type `Background: Configuration` in the command pallette or press the **Background** tab in the statusbar to access the configuration menu.

<div align="center">
<img alt="configuration menu" src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/configuration.gif">
<img src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/configuration.gif">
</div>

#### Glob, URL, and Environment Variable Support
Expand All @@ -64,7 +66,7 @@ Add background images by file, folder, [glob](https://github.com/isaacs/node-glo
> [node-glob](https://github.com/isaacs/node-glob#windows) only accepts `/` as path separators, `\` is reserved for escape characters.

<div align="center">
<img alt="file menu" src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/glob.gif">
<img src="https://raw.githubusercontent.com/KatsuteDev/Background/main/assets/glob.gif">
</div>

<div align="right"><a href="#top"><code>▲</code></a></div>
Expand Down Expand Up @@ -94,35 +96,35 @@ The order settings are saved in is:
2. Sidebar
3. Panel

| Background | Type | Description |
| Key | Type | Description |
|---|:-:|---|
|`background.windowBackgrounds`|`string[]`|The list of files or globs to use for the window background image.|
|`background.editorBackgrounds`|`string[]`|The list of files or globs to use for editor background images.|
|`background.sidebarBackgrounds`|`string[]`|The list of files or globs to use for the sidebar background images.|
|`background.panelBackgrounds`|`string[]`|The list of files or globs to use for the panel background image.|
|`background.windowBackgrounds`|`string[]`|The list of files, globs, or URLs to pull background images from.<br><br>* Use only `/` for directories, `\` is reserved for escape characters.<br><br>* Image URLs must be served over HTTPS.|
|`background.editorBackgrounds`|`string[]`|The list of files, globs, or URLs to pull background images from.<br><br>* Use only `/` for directories, `\` is reserved for escape characters.<br><br>* Image URLs must be served over HTTPS.|
|`background.sidebarBackgrounds`|`string[]`|The list of files, globs, or URLs to pull background images from.<br><br>* Use only `/` for directories, `\` is reserved for escape characters.<br><br>* Image URLs must be served over HTTPS.|
|`background.panelBackgrounds`|`string[]`|TThe list of files, globs, or URLs to pull background images from.<br><br>* Use only `/` for directories, `\` is reserved for escape characters.<br><br>* Image URLs must be served over HTTPS..|

<br>

| Property | Type | Description |
| Key | Type | Description |
|---|:-:|---|
|`background.backgroundAlignment`|`enum[4]`|The alignment of the background image.|
|`background.backgroundAlignmentValue`|`string[4]`|If the background image alignment is set to `Manual`, this is the literal value for the `background-position` css property. Only accepts a [css \<position>](https://developer.mozilla.org/en-US/docs/Web/CSS/position_value).|
|`background.backgroundBlur`|`string[4]`|Background image blur. Only accepts a [css \<length>](https://developer.mozilla.org/en-US/docs/Web/CSS/length).|
|`background.backgroundOpacity`|`number[4]`|The UI opacity. 1 is fully visible and 0 is invisible.|
|`background.backgroundAlignment`|`enum[4]`|The background image alignment.|
|`background.backgroundAlignmentValue`|`string[4]`|If `backgroundAlignment` is set to `Manual`, this is the literal value for the `background-position` css property.|
|`background.backgroundBlur`|`string[4]`|The background image blur amount in css units.|
|`background.backgroundOpacity`|`number[4]`|The background opacity, make sure this number is not to high, otherwise you may not be able to see the UI and revert this change.<br><br>`1` is fully visible and `0` is invisible. If `useInvertedOpacity` is true, this logic is inverted.|
|`background.backgroundRepeat`|`enum[4]`|The background image repeat.|
|`background.backgroundSize`|`enum[4]`|The background image size.|
|`background.backgroundSizeValue`|`string[4]`|If the background image size is set to `Manual`, this is the literal value for the `background-size` css property. Only accepts a [css \<position>](https://developer.mozilla.org/en-US/docs/Web/CSS/position_value).|
|`background.backgroundChangeTime`|`number[4]`|How long in seconds before the background should automatically change. Set to 0 to always use the same image.|
|`background.backgroundSizeValue`|`string[4]`|If `windowBackgroundSize` is set to `Manual`, this is the literal value for the `background-size` css property.|
|`background.backgroundChangeTime`|`number[4]`|How long in seconds before the background should automatically change.<br><br>Set to `0` to always use the same image.|

<br>

| Advanced | Type | Description |
| Key | Type | Description |
|---|:-:|---|
|`background.autoInstall`|`boolean`|Automatically installs backgrounds and reloads the window on startup if changes are detected or VSCode updates.<br>This option is disabled when you run the uninstall command.|
|`background.autoInstall`|`boolean`|Automatically installs backgrounds and reloads the window on startup if changes are detected or VSCode updates.<br><br>This option is disabled when you run the uninstall command.|
|`background.renderContentAboveBackground`|`boolean`|Render content like images, PDFs, and markdown previews above the background.|
|`background.useInvertedOpacity`|`boolean`|Use an inverted opacity, so 0 is fully visible and 1 is invisible.|
|`background.smoothImageRendering`|`boolean`|Use smooth image rendering rather than pixelated rendering when resizing images.|
|`background.settingScope`|`Global` \| `Workspace`|Where to save background settings. This does not automatically update the background on workspace change, you need to also turn on `autoInstall`.|
|`background.settingScope`|`Global` \| `Workspace`|Where to save and load background settings.<br><br>This does not automatically update the background on workspace change, you need to also turn on `autoInstall`.|
|`background.CSS`|`string`|Apply raw CSS to VSCode.|

<div align="right"><a href="#top"><code>▲</code></a></div>
Expand Down
1 change: 1 addition & 0 deletions localization
Submodule localization added at 7c4a7c
Loading
Loading