Skip to content

Commit

Permalink
Merge pull request #146 from PDConSec:fix/missing-ui-language-registr…
Browse files Browse the repository at this point in the history
…ations

Fix/missing-ui-language-registrations
  • Loading branch information
PeterWone authored Aug 8, 2022
2 parents b3fb597 + b8084a2 commit fdfe490
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

### 0.9.28

- Update references to eliminate vulnerabilities.
- Register ES, ZH localisation resources for UI [#145](https://github.com/PDConSec/vsc-print/issues/145)

### 0.9.27

- Fix printing of a selection [#142](https://github.com/PDConSec/vsc-print/issues/142)
Expand Down
5 changes: 5 additions & 0 deletions README.fra.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ L’extension Math+Markdown (installe le plugin KaTeX) nécessite une connexion

## Notes de version

### 0.9.28

- Mettre à jour les références pour éliminer les vulnérabilités.
- Enregistrer les ressources de localisation ES et ZH pour l’interface utilisateur [#145](https://github.com/PDConSec/vsc-print/issues/145)

### 0.9.27

- Corriger l'impression d'une sélection [#142](https://github.com/PDConSec/vsc-print/issues/142)
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ The Math+Markdown extension (installs the KaTeX plugin) requires an internet con

## Release Notes

### 0.9.28

- Update references to eliminate vulnerabilities.
- Register ES, ZH localisation resources for UI [#145](https://github.com/PDConSec/vsc-print/issues/145)

### 0.9.27

- Fix printing of a selection [#142](https://github.com/PDConSec/vsc-print/issues/142)
Expand Down
12 changes: 11 additions & 1 deletion how-to-add-a-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@
1. Copy the file `packagei18n.json` from the `/i18n/eng` folder to the folder you just created for your language.
1. Use a UTF8 capable editor (VS Code is a good choice) to edit this file.
1. Replace each English string with your translation.
* Translation of jargon and technical terms is tricky but you are a subject matter expert, so ask yourself: What would I see in my source code? How would I write this in email to another programmer?
* Translation of jargon and technical terms is tricky but you are a subject matter expert, so ask yourself: If I were explaining or naming this in my own language, how would I phrase it? How would I write this in email to another programmer?
* DO NOT translate the keys (the property names).
1. Edit the file `src/imports.ts` to register your translation for localisation of the UI.
```
const locVal: any = {
"de": require("../out/extension.nls.de.json"),
"en": require("../out/extension.nls.en.json"),
"es": require("../out/extension.nls.es.json"),
"fr": require("../out/extension.nls.fr.json"),
"zh": require("../out/extension.nls.zh.json")
};
```
1. Translate `README.md` and `manual.md` to `README.xyz.md` and `manual.xyz.md` where xyz is your language code.
1. There's probably no point translating _this_ file unless you seriously expect translation from your language to another.
1. Save, stage, commit and push your changes to your fork on GitHub.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-print",
"displayName": "Print",
"description": "Rendered Markdown, coloured code.",
"version": "0.9.27",
"version": "0.9.28",
"icon": "vscode-print-128.png",
"author": {
"name": "Peter Wone",
Expand Down
9 changes: 6 additions & 3 deletions src/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { env } from 'vscode';
const locKey = require("../out/extension.nls.metadata.json").keys;
const locVal: any = {
"de": require("../out/extension.nls.de.json"),
"en": require("../out/extension.nls.en.json"),
"fr": require("../out/extension.nls.fr.json")
"en": require("../out/extension.nls.en.json"),
"es": require("../out/extension.nls.es.json"),
"fr": require("../out/extension.nls.fr.json"),
"zh": require("../out/extension.nls.zh.json")
};

export function localise(key: string): string {
Expand Down Expand Up @@ -36,7 +38,8 @@ export const filenameByCaption: any = {
"Gruvbox": "gruvbox-light",
"Idea": "idea",
"ISBL": "isbl-editor-light",
"Kimbie": "kimbie.light",
"Kimbie": "kimbie.light",
"Lightfair": "lightfair",
"Magula": "magula",
"Mono Blue": "mono-blue",
"nnfx": "nnfx",
Expand Down

0 comments on commit fdfe490

Please sign in to comment.