@@ -6,6 +6,7 @@ import ThemeSelect from "./ThemeSelect";
66import useComponentVisible from "~/utils/TouchBehaviour" ;
77import { applyTheme } from "../../themes/themeutil" ;
88import Button from "../Basic/Button" ;
9+ import { useTranslation } from 'react-i18next' ;
910import { WriteFile , readFile , DeleteFile } from "../../lib/fileAction" ;
1011const path = require ( "path" ) ;
1112const fs = require ( "fs" ) ;
@@ -17,6 +18,7 @@ const ThemeSettings = ({ CustomThemeFile, setCustomThemeFile, user }) => {
1718 const [ Data , setData ] = useState ( ) ;
1819 const [ Themes , setThemes ] = useState ( ) ;
1920 let themepath = path . join ( user ?. auth ?. user , "conf" , "theme" ) ;
21+ const { t } = useTranslation ( )
2022
2123 async function CheckThemes ( ) {
2224 let themeObject = await ParseContent ( themepath ) ;
@@ -102,10 +104,9 @@ const ThemeSettings = ({ CustomThemeFile, setCustomThemeFile, user }) => {
102104 < div ref = { ref } className = "" >
103105 < div className = "flex mt-4 justify-between pb-2 border-b border-b-SideBarBackground" >
104106 < div className = "flex flex-col" >
105- < span className = "text-md " > Upload custom Theme </ span >
107+ < span className = "text-md " > { t ( "customtheme" ) } </ span >
106108 < span className = "text-xs opacity-75" >
107- you can upload your custom json theme file,you can find default
108- theme json file in github repo
109+ { t ( "uploadtheme" ) }
109110 </ span >
110111 </ div >
111112 < div >
@@ -128,11 +129,12 @@ const ThemeSettings = ({ CustomThemeFile, setCustomThemeFile, user }) => {
128129 </ div >
129130 < div className = "flex mt-4 justify-between pb-2 border-b border-b-SideBarBackground" >
130131 < div className = "flex flex-col" >
131- < span className = "text-md " > Select Preferred Theme </ span >
132+ < span className = "text-md " > { t ( "preferredtheme" ) } </ span >
132133 < span className = "text-xs opacity-75" >
133134 { Themes && Object . keys ( Themes ?. ListOfThemes ) ?. length > 0
134- ? "you have uploaded a custom theme file choose from one of them "
135- : "choose from default themes available,you can upload custom theme if you dont like these themes" }
135+ ? `${ t ( "customselect" ) } `
136+ : `${ t ( "defaultselect" ) } `
137+ }
136138 </ span >
137139 </ div >
138140 < div >
@@ -148,10 +150,9 @@ const ThemeSettings = ({ CustomThemeFile, setCustomThemeFile, user }) => {
148150 { Themes && Object . keys ( Themes ?. ListOfThemes ) ?. length > 0 && (
149151 < div className = "flex mt-4 justify-between pb-2 border-b border-b-SideBarBackground" >
150152 < div className = "flex flex-col" >
151- < span className = "text-md " > Delete Custom Theme File </ span >
153+ < span className = "text-md " > { t ( "deletetheme" ) } </ span >
152154 < span className = "text-xs opacity-75" >
153- you can choose themes from default files by removing custom theme
154- file
155+ { t ( "defaultchoose" ) }
155156 </ span >
156157 </ div >
157158 < div >
@@ -163,7 +164,7 @@ const ThemeSettings = ({ CustomThemeFile, setCustomThemeFile, user }) => {
163164 </ div >
164165 </ div >
165166 ) }
166- < Button handler = { ApplyThemeConf } btntext = "apply theme settings" />
167+ < Button handler = { ApplyThemeConf } btntext = { t ( "applytheme" ) } />
167168 </ div >
168169 ) ;
169170} ;
0 commit comments