Skip to content

Commit

Permalink
Merge branch 'Prompts' of https://github.com/akshayw1/Scribe-Android
Browse files Browse the repository at this point in the history
…into Prompts
  • Loading branch information
akshayw1 committed Jan 4, 2025
2 parents f8b1979 + 118d7d7 commit dce707f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions app/src/main/java/be/scri/helpers/HintUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import be.scri.helpers.english.ENInterfaceVariables
import be.scri.helpers.french.FRInterfaceVariables
import be.scri.helpers.german.DEInterfaceVariables
import be.scri.helpers.italian.ITInterfaceVariables
import be.scri.helpers.portugese.PTInterfaceVariables
import be.scri.helpers.portuguese.PTInterfaceVariables
import be.scri.helpers.russian.RUInterfaceVariables
import be.scri.helpers.spanish.ESInterfaceVariables
import be.scri.helpers.swedish.SVInterfaceVariables
Expand All @@ -46,15 +46,15 @@ object HintUtils {
language: String,
): String {
val hintMessageForState = getHintForState(currentState)
return hintMessageForState[language] ?: "" // Return the placeholder or empty string if not found
return hintMessageForState[language] ?: "" // return the placeholder or empty string if not found
}

private fun getHintForState(currentState: SimpleKeyboardIME.ScribeState): Map<String, String> =
when (currentState) {
SimpleKeyboardIME.ScribeState.TRANSLATE -> getTranslateHints()
SimpleKeyboardIME.ScribeState.CONJUGATE -> getConjugateHints()
SimpleKeyboardIME.ScribeState.PLURAL -> getPluralHints()
else -> emptyMap() // Fallback for unknown states
else -> emptyMap()
}

private fun getTranslateHints(): Map<String, String> =
Expand Down Expand Up @@ -101,7 +101,7 @@ object HintUtils {
SimpleKeyboardIME.ScribeState.TRANSLATE -> getTranslationPrompt(language)
SimpleKeyboardIME.ScribeState.CONJUGATE -> getConjugationPrompt(language)
SimpleKeyboardIME.ScribeState.PLURAL -> getPluralPrompt(language)
else -> "" // Default fallback for unknown states
else -> ""
}

private fun getTranslationPrompt(language: String): String {
Expand All @@ -116,7 +116,7 @@ object HintUtils {
"Spanish" to "es",
"Swedish" to "sv",
)
val shorthand = languageShorthand[language] ?: "en" // Default fallback to "en"
val shorthand = languageShorthand[language] ?: "en" // default fallback to "en"
return "en -> $shorthand"
}

Expand All @@ -130,7 +130,7 @@ object HintUtils {
"Russian" -> RUInterfaceVariables.CONJUGATE_PROMPT
"Spanish" -> ESInterfaceVariables.CONJUGATE_PROMPT
"Swedish" -> SVInterfaceVariables.CONJUGATE_PROMPT
else -> "Conjugate :" // Default fallback
else -> "Conjugate :"
}

private fun getPluralPrompt(language: String): String =
Expand All @@ -143,6 +143,6 @@ object HintUtils {
"Russian" -> RUInterfaceVariables.PLURAL_PROMPT
"Spanish" -> ESInterfaceVariables.PLURAL_PROMPT
"Swedish" -> SVInterfaceVariables.PLURAL_PROMPT
else -> "Plural :" // Default fallback
else -> "Plural :"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package be.scri.helpers.portugese
package be.scri.helpers.portuguese

object PTInterfaceVariables {
// MARK: Currency Symbols
Expand Down

0 comments on commit dce707f

Please sign in to comment.