1-
21import androidx.compose.desktop.ui.tooling.preview.Preview
32import androidx.compose.foundation.layout.Arrangement
43import androidx.compose.foundation.layout.Column
@@ -78,35 +77,38 @@ fun App() {
7877 modifier = Modifier .weight(1f ).height(50 .dp),
7978 " Translate" ,
8079 onClick = {
81- if (stringState.isEmpty()){
80+ if (stringState.isEmpty()) {
8281 isShowToast = true
8382 toastMessage = " Error: Please enter the source strings"
8483 CoroutineScope (Dispatchers .IO ).launch {
8584 delay(3000 )
8685 isShowToast = false
8786 }
88- }else if (! isValidXml(stringState)){
87+ } else if (! isValidXml(stringState)) {
8988 isShowToast = true
90- toastMessage = " Error: Please enter the source strings in XML format into the provided text field."
89+ toastMessage =
90+ " Error: Please enter the source strings in XML format into the provided text field."
9191 CoroutineScope (Dispatchers .IO ).launch {
9292 delay(3000 )
9393 isShowToast = false
9494 }
95- } else if (folderState.isEmpty()){
95+ } else if (folderState.isEmpty()) {
9696 isShowToast = true
97- toastMessage = " Error: Enter the folder name where you want to store the translated strings."
97+ toastMessage =
98+ " Error: Enter the folder name where you want to store the translated strings."
9899 CoroutineScope (Dispatchers .IO ).launch {
99100 delay(3000 )
100101 isShowToast = false
101102 }
102- } else if (! countryListState.any { it.isChecked }){
103+ } else if (! countryListState.any { it.isChecked }) {
103104 isShowToast = true
104- toastMessage = " Error: Please select at least one target language before translating."
105+ toastMessage =
106+ " Error: Please select at least one target language before translating."
105107 CoroutineScope (Dispatchers .IO ).launch {
106108 delay(3000 )
107109 isShowToast = false
108110 }
109- }else {
111+ } else {
110112 isWindowShow = WindowState .CONVERT_TRANSLATE
111113 }
112114 }
@@ -118,9 +120,10 @@ fun App() {
118120 SelectCountries (countryListState) {
119121 countryListState = it
120122 isWindowShow = WindowState .NO_STATE
121- if (! it.any { elements -> elements.isChecked }){
123+ if (! it.any { elements -> elements.isChecked }) {
122124 isShowToast = true
123- toastMessage = " Error: Please select at least one target language before translating."
125+ toastMessage =
126+ " Error: Please select at least one target language before translating."
124127 CoroutineScope (Dispatchers .IO ).launch {
125128 delay(3000 )
126129 isShowToast = false
0 commit comments