Commit 49fe520c authored by Govind Dixit's avatar Govind Dixit

feat: Add multi language support to app

parent bd326648
......@@ -173,7 +173,6 @@ class AppModule {
fun provideSharedPreferences(context: Application) =
context.getSharedPreferences("rocket.chat", Context.MODE_PRIVATE)
@Provides
@ForMessages
fun provideMessagesSharedPreferences(context: Application) =
......
package chat.rocket.android.server.infraestructure
interface CurrentLanguageRepository {
fun save(language: String)
fun get(): String?
}
\ No newline at end of file
package chat.rocket.android.server.infraestructure
import android.content.SharedPreferences
private const val CURRENT_LANGUAGE= "current_language"
class SharedPrefsCurrentLanguageRepository(private val preferences: SharedPreferences) :
CurrentLanguageRepository {
override fun save(language: String) {
preferences.edit().putString(CURRENT_LANGUAGE, language).apply()
}
override fun get(): String? {
return preferences.getString(CURRENT_LANGUAGE, "")
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment