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

Extract string to keys in translation files #7

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "TypeScript refactor tools",
"publisher": "unsplash",
"description": "Useful refactor tools for Unsplash web codebase",
"version": "0.2.2",
"version": "0.3.5",
"files": [
"dist/*"
],
Expand Down Expand Up @@ -63,7 +63,7 @@
"webpack-cli": "^4.7.0"
},
"dependencies": {
"@unsplash/ts-refactor-tools": "0.2.2"
"@unsplash/ts-refactor-tools": "0.3.5"
},
"extensionDependencies": [
"vscode.typescript"
Expand Down
Empty file removed _extension/sample-app/index.ts
Empty file.
4 changes: 4 additions & 0 deletions _extension/sample-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import * as Lang from "./lang";

const t = Lang.getTranslations();
const a = "Email not found";
1 change: 1 addition & 0 deletions _extension/sample-app/src/lang/en-US.translations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions _extension/sample-app/src/lang/en-US.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const noop = "";
3 changes: 3 additions & 0 deletions _extension/sample-app/src/lang/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as EnUs from "./en-US";

export const getTranslations = () => EnUs;
14 changes: 14 additions & 0 deletions _extension/sample-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "esNext",
"noImplicitAny": true,
"removeComments": true,
"moduleResolution": "Node",
"preserveConstEnums": true,
"resolveJsonModule": true,
"sourceMap": true,
"jsx": "react"
},
"include": ["src/**/*", "src/**/*.json"],
"exclude": ["node_modules"]
}
Binary file removed _extension/ts-refactor-tools-0.2.2.vsix
Binary file not shown.
Binary file added _extension/ts-refactor-tools-0.3.5.vsix
Binary file not shown.
34 changes: 15 additions & 19 deletions _extension/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6"
],
"sourceMap": true,
"rootDir": ".",
"strict": true /* enable all strict type-checking options */
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"exclude": [
"node_modules",
".vscode-test"
]
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": ["es6"],
"jsx": "react",
"sourceMap": true,
"rootDir": ".",
"strict": true /* enable all strict type-checking options */
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"exclude": ["node_modules", ".vscode-test"]
}
Loading