Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
49fe520c
Commit
49fe520c
authored
Mar 20, 2019
by
Govind Dixit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Add multi language support to app
parent
bd326648
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
AppModule.kt
.../main/java/chat/rocket/android/dagger/module/AppModule.kt
+0
-1
CurrentLanguageRepository.kt
...droid/server/infraestructure/CurrentLanguageRepository.kt
+6
-0
SharedPrefsCurrentLanguageRepository.kt
...r/infraestructure/SharedPrefsCurrentLanguageRepository.kt
+15
-0
No files found.
app/src/main/java/chat/rocket/android/dagger/module/AppModule.kt
View file @
49fe520c
...
...
@@ -173,7 +173,6 @@ class AppModule {
fun
provideSharedPreferences
(
context
:
Application
)
=
context
.
getSharedPreferences
(
"rocket.chat"
,
Context
.
MODE_PRIVATE
)
@Provides
@ForMessages
fun
provideMessagesSharedPreferences
(
context
:
Application
)
=
...
...
app/src/main/java/chat/rocket/android/server/infraestructure/CurrentLanguageRepository.kt
0 → 100644
View file @
49fe520c
package
chat.rocket.android.server.infraestructure
interface
CurrentLanguageRepository
{
fun
save
(
language
:
String
)
fun
get
():
String
?
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/server/infraestructure/SharedPrefsCurrentLanguageRepository.kt
0 → 100644
View file @
49fe520c
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
,
""
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment