Skip to content

Commit

Permalink
Modify the language variable to match language highlight. (#543)
Browse files Browse the repository at this point in the history
* Modify the variable name to match the language

Signed-off-by: Yue, Wenjiao <wenjiao.yue@intel.com>

* Modify the variable name to match the language

Signed-off-by: Yue, Wenjiao <wenjiao.yue@intel.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Yue, Wenjiao <wenjiao.yue@intel.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
WenjiaoYue and pre-commit-ci[bot] authored Aug 8, 2024
1 parent 5ac77f7 commit f08d411
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 46 deletions.
26 changes: 13 additions & 13 deletions CodeTrans/docker/ui/svelte/src/lib/shared/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ import type { Language } from "../../routes/types.js";
export const languagesList: Language[] = [
{ name: "C" },
{ name: "C++" },
{ name: "C#" },
// { name: "C#" },
{ name: "Java" },
{ name: "Python" },
{ name: "JavaScript" },
{ name: "Swift" },
{ name: "Ruby" },
// { name: "Swift" },
// { name: "Ruby" },
{ name: "Go" },
{ name: "Rust" },
{ name: "PHP" },
{ name: "TypeScript" },
{ name: "Kotlin" },
{ name: "Objective-C" },
{ name: "Perl" },
{ name: "MATLAB" },
{ name: "R" },
{ name: "Lua" },
{ name: "Bash" },
{ name: "SQL" },
// { name: "PHP" },
// { name: "TypeScript" },
// { name: "Kotlin" },
// { name: "Objective-C" },
// { name: "Perl" },
// { name: "MATLAB" },
// { name: "R" },
// { name: "Lua" },
// { name: "Bash" },
// { name: "SQL" },
];
67 changes: 34 additions & 33 deletions CodeTrans/docker/ui/svelte/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@

<script lang="ts">
import Highlight, { LineNumbers } from "svelte-highlight";
import typescript from "svelte-highlight/languages/typescript";
// import typescript from "svelte-highlight/languages/typescript";
import c from "svelte-highlight/languages/c";
import cpp from "svelte-highlight/languages/cpp";
import csharp from "svelte-highlight/languages/csharp";
// import csharp from "svelte-highlight/languages/csharp";
import go from "svelte-highlight/languages/go";
import java from "svelte-highlight/languages/java";
import python from "svelte-highlight/languages/python";
import javascript from "svelte-highlight/languages/javascript";
import swift from "svelte-highlight/languages/swift";
import ruby from "svelte-highlight/languages/ruby";
// import swift from "svelte-highlight/languages/swift";
// import ruby from "svelte-highlight/languages/ruby";
import rust from "svelte-highlight/languages/rust";
import php from "svelte-highlight/languages/php";
import kotlin from "svelte-highlight/languages/kotlin";
import objectivec from "svelte-highlight/languages/objectivec";
import perl from "svelte-highlight/languages/perl";
import matlab from "svelte-highlight/languages/matlab";
import r from "svelte-highlight/languages/r";
import lua from "svelte-highlight/languages/lua";
import bash from "svelte-highlight/languages/bash";
import sql from "svelte-highlight/languages/sql";
// import php from "svelte-highlight/languages/php";
// import kotlin from "svelte-highlight/languages/kotlin";
// import objectivec from "svelte-highlight/languages/objectivec";
// import perl from "svelte-highlight/languages/perl";
// import matlab from "svelte-highlight/languages/matlab";
// import r from "svelte-highlight/languages/r";
// import lua from "svelte-highlight/languages/lua";
// import bash from "svelte-highlight/languages/bash";
// import sql from "svelte-highlight/languages/sql";
import atomOneDark from "svelte-highlight/styles/atom-one-dark";
import Header from "$lib/header.svelte";
Expand All @@ -46,26 +46,26 @@
import TranslateIcon from "$lib/assets/translateIcon.svelte";
const languagesTag = {
Typescript: typescript,
Python: python,
C: c,
Cpp: cpp,
Csharp: csharp,
Go: go,
Java: java,
Javascript: javascript,
Swift: swift,
Ruby: ruby,
Rust: rust,
Php: php,
Kotlin: kotlin,
Objectivec: objectivec,
Perl: perl,
Matlab: matlab,
R: r,
Lua: lua,
Bash: bash,
Sql: sql,
// 'TypeScript': typescript,
'Python': python,
'C': c,
'C++': cpp,
// 'C#': csharp,
'Go': go,
'Java': java,
'JavaScript': javascript,
// 'Swift': swift,
// 'Ruby': ruby,
'Rust': rust,
// 'PHP': php,
// 'Kotlin': kotlin,
// 'Objective-C': objectivec,
// 'Perl': perl,
// 'MATLAB': matlab,
// 'R': r,
// 'Lua': lua,
// 'Bash': bash,
// 'SQL': sql,
} as { [key: string]: any };
let copyText = "copy";
Expand Down Expand Up @@ -99,6 +99,7 @@
loading = true;
output = "";
inputClick = false;
const eventSource = await fetchTextStream(input, langFrom, langTo);
eventSource.addEventListener("message", (e: any) => {
Expand Down

0 comments on commit f08d411

Please sign in to comment.