Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
fixed i18
Browse files Browse the repository at this point in the history
  • Loading branch information
mkloubert committed Jul 24, 2017
1 parent e67f01c commit 6f96214
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log (vs-deploy)

## 9.28.0 (July 21st, 2017; brazilian portuguese translation)
## 9.28.1 (July 21st, 2017; brazilian portuguese translation)

* added portuguese (brazilian) translation (thanks to [Celio Rodrigues](https://github.com/ItsMeCelio)!)

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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": "vs-deploy",
"displayName": "Deploy",
"description": "Commands for deploying files of your workspace to a destination.",
"version": "9.28.0",
"version": "9.28.1",
"publisher": "mkloubert",
"engines": {
"vscode": "^1.6.0"
Expand Down
15 changes: 11 additions & 4 deletions src/i18.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ export function init(lang?: string): Promise<any> {
if (deploy_helpers.isEmptyString(lang)) {
lang = vscode.env.language;
}
lang = deploy_helpers.toStringSafe(lang).toLowerCase().trim();
if (!lang) {
lang = normalizeLangName(lang);
if ('' === lang) {
lang = 'en';
}

Expand Down Expand Up @@ -484,8 +484,8 @@ export function init(lang?: string): Promise<any> {
continue; // no JavaScript file
}

let langName = fileName.substr(0, fileName.length - 3).toLowerCase().trim();
if (!langName) {
let langName = normalizeLangName( fileName.substr(0, fileName.length - 3) );
if ('' === langName) {
continue; // no language name available
}

Expand Down Expand Up @@ -540,3 +540,10 @@ export function init(lang?: string): Promise<any> {
}
});
}

function normalizeLangName(lang: string): string {
lang = deploy_helpers.normalizeString(lang);
lang = deploy_helpers.replaceAllStrings(lang, '-', '_');

return lang;
}

0 comments on commit 6f96214

Please sign in to comment.