Skip to content

Commit

Permalink
feat: Strings-based projects support (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
yevheniyJ authored Jan 23, 2024
1 parent 218b068 commit 20b0ead
Show file tree
Hide file tree
Showing 30 changed files with 730 additions and 305 deletions.
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,23 @@ Integrate your Visual Studio Code projects with Crowdin to streamline the locali

A new component will be introduced in the Activity Bar called the *Crowdin*. The plugin will scan each workspace for a Crowdin-specific configuration file and will build a tree with source files.

### Sources and translations sync, tracking project progress
### Upload source files to Crowdin

With this plugin you can:
Upload source files to Crowdin for translation using the **"Upload"** panel. It displays all the source files matching the specified pattern in the configuration file. You can either individually select files to upload to Crowdin or upload all files at once.

- Upload files for translation to Crowdin.
- Download sources and translations from Crowdin.
- Track progress of translated and approved strings for each project and target language.
[<p align="center"><img src="resources/animations/upload.gif" data-canonical-src="resources/animations/upload.gif" width="600" height="auto" align="center"/></p>](https://store.crowdin.com/visual-studio-code/)

[<p align="center"><img src="resources/plugin.png" data-canonical-src="resources/plugin.png" width="300" height="auto" align="center"/></p>](https://store.crowdin.com/visual-studio-code/)
### Download source and translation files from Crowdin

Download source and translation files from Crowdin using the **"Download"** panel. It displays all the source files matching the specified pattern in the configuration file. You can download translations for all target languages as well as download source files edited in Crowdin.

[<p align="center"><img src="resources/animations/download.gif" data-canonical-src="resources/animations/download.gif" width="600" height="auto" align="center"/></p>](https://store.crowdin.com/visual-studio-code/)

### Track translation progress

Track progress of translated and approved strings for each project and target language.

[<p align="center"><img src="resources/animations/progress.gif" data-canonical-src="resources/animations/progress.gif" width="600" height="auto" align="center"/></p>](https://store.crowdin.com/visual-studio-code/)

### String keys autocompletion

Expand All @@ -37,10 +45,24 @@ There is a possibility to configure file extensions, where the string keys autoc

Strings for autocompletion are loaded during the bootstrap of VSCode and are also updated whenever there was a change in the `crowdin.yml` configuration file.

[<p align="center"><img src="https://raw.githubusercontent.com/crowdin/vscode-crowdin/docs/autocompletion-demo.gif" data-canonical-src="https://raw.githubusercontent.com/crowdin/vscode-crowdin/docs/autocompletion-demo.gif" width="700" height="auto" align="center"/></p>](https://github.com/crowdin/vscode-crowdin/releases/tag/1.4.0/)
[<p align="center"><img src="resources/animations/autocomplete.gif" data-canonical-src="resources/animations/autocomplete.gif" width="600" height="auto" align="center"/></p>](https://store.crowdin.com/visual-studio-code/)

This gif illustrates the autocompletion of string keys in a React project that uses the [Lingui](https://lingui.dev/tools/crowdin) library.

### Command Palette commands

The plugin provides the following commands in the VS Code [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-) (<kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd>/<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>):

- `Crowdin: Sign In` to log in into your Crowdin profile
- `Crowdin: Sign Out` to log out from your Crowdin profile
- `Crowdin: Select Project` to select Crowdin project
- `Crowdin: Open Configuration` to open Crowdin configuration file
- `Crowdin: Focus on Upload View` to focus on the Upload view
- `Crowdin: Focus on Download View` to focus on the Download view
- `Crowdin: Focus on Progress View` to focus on the Progress view

[<p align="center"><img src="resources/animations/command-palette.gif" data-canonical-src="resources/animations/command-palette.gif" width="600" height="auto" align="center"/></p>](https://store.crowdin.com/visual-studio-code/)

## Setup

### Installation
Expand Down Expand Up @@ -105,7 +127,9 @@ You can create a new configuration file by using the "Crowdin: Create configurat
"excluded_target_languages": ["uk", "fr"], // optional
"labels": ["android", "emails"], // optional
"dest": "/app/%file_name%.xml", // optional
"type": "android" // optional
"type": "android", // optional
"update_strings": false, // optional (for strings based projects)
"cleanup_mode": true // optional (for strings based projects)
},
{
"source": "multicolumn.csv",
Expand Down
91 changes: 63 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@
"views": {
"crowdin": [
{
"id": "files",
"name": "Files"
"id": "upload",
"name": "Upload"
},
{
"id": "download",
"name": "Download"
},
{
"id": "translationProgress",
Expand Down Expand Up @@ -104,19 +108,19 @@
"category": "Crowdin"
},
{
"command": "files.refresh",
"command": "upload.refresh",
"title": "Refresh",
"icon": {
"light": "resources/light/refresh.svg",
"dark": "resources/dark/refresh.svg"
}
},
{
"command": "files.downloadAll",
"title": "Download all translations",
"command": "download.refresh",
"title": "Refresh",
"icon": {
"light": "resources/light/download.svg",
"dark": "resources/dark/download.svg"
"light": "resources/light/refresh.svg",
"dark": "resources/dark/refresh.svg"
}
},
{
Expand Down Expand Up @@ -182,29 +186,45 @@
"light": "resources/light/download_source.svg",
"dark": "resources/dark/download_source.svg"
}
},
{
"command": "bundles.download",
"title": "Download bundle",
"icon": {
"light": "resources/light/download.svg",
"dark": "resources/dark/download.svg"
}
},
{
"command": "bundles.add",
"title": "Add bundle",
"icon": "$(plus)"
},
{
"command": "bundles.settings",
"title": "Settings",
"icon": {
"light": "resources/light/settings.svg",
"dark": "resources/dark/settings.svg"
}
}
],
"menus": {
"view/title": [
{
"command": "files.refresh",
"when": "view == files",
"command": "download.refresh",
"when": "view == download",
"group": "navigation@0"
},
{
"command": "files.saveAll",
"when": "view == files",
"group": "navigation@1"
},
{
"command": "files.downloadAll",
"when": "view == files",
"group": "navigation@2"
"command": "upload.refresh",
"when": "view == upload",
"group": "navigation@0"
},
{
"command": "files.updateSourceFolder",
"when": "view == files",
"group": "navigation@3"
"command": "files.saveAll",
"when": "view == upload",
"group": "navigation@1"
},
{
"command": "translationProgress.refresh",
Expand All @@ -215,33 +235,48 @@
"view/item/context": [
{
"command": "files.edit",
"when": "view == files && viewItem == root",
"group": "inline@0"
"when": "(view == upload || view == download) && (viewItem == root ||viewItem == root_bundle)",
"group": "inline@4"
},
{
"command": "files.saveFolder",
"when": "view == files && viewItem == folder",
"when": "view == upload && viewItem == folder",
"group": "inline@1"
},
{
"command": "files.saveFile",
"when": "view == files && viewItem == file",
"when": "view == upload && viewItem == file",
"group": "inline@1"
},
{
"command": "files.download",
"when": "view == files && viewItem == root",
"when": "view == download && viewItem == root",
"group": "inline@2"
},
{
"command": "files.updateSourceFolder",
"when": "view == files && viewItem == root",
"when": "view == download && viewItem == root",
"group": "inline@3"
},
{
"command": "files.updateSourceFile",
"when": "view == files && viewItem == file",
"when": "view == download && viewItem == file",
"group": "inline@4"
},
{
"command": "bundles.download",
"when": "view == download && viewItem == bundle",
"group": "inline@0"
},
{
"command": "bundles.add",
"when": "view == download && viewItem == root_bundle",
"group": "inline@0"
},
{
"command": "bundles.settings",
"when": "view == download && viewItem == bundle",
"group": "inline@1"
}
],
"commandPalette": [
Expand Down Expand Up @@ -305,4 +340,4 @@
"uuid": "^9.0.1",
"yaml": "^2.3.4"
}
}
}
Binary file added resources/animations/autocomplete.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/animations/command-palette.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/animations/download.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/animations/progress.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/animations/upload.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/plugin.png
Binary file not shown.
Loading

0 comments on commit 20b0ead

Please sign in to comment.