-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from TheTeamPotato/task/add-multi-language-sup…
…port task/add-multi-language-support
- Loading branch information
Showing
24 changed files
with
347 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
layers/data/src/main/java/com/theteampotato/gifit/data/DeviceManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.theteampotato.gifit.data | ||
|
||
import android.content.res.Resources | ||
import android.os.Build | ||
|
||
object DeviceManager { | ||
|
||
val language: String | ||
get() = getDeviceLanguage() | ||
|
||
private fun getDeviceLanguage(): String { | ||
val locale = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) | ||
Resources.getSystem().configuration.locale | ||
else | ||
Resources.getSystem().configuration.locales[0] | ||
|
||
return locale.language | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
layers/data/src/main/java/com/theteampotato/gifit/data/LanguageType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.theteampotato.gifit.data | ||
|
||
enum class LanguageType(val languageCode: String) { | ||
ENGLISH("en"), | ||
FINNISH("fi"), | ||
CHINESE("zh"), | ||
DANISH("da"), | ||
FRENCH("fr"), | ||
GERMAN("de"), | ||
SPANISH("es"), | ||
TURKISH("tr"), | ||
ITALIAN("it"), | ||
JAPANESE("ja"), | ||
DUTCH("nl"), | ||
NORWEGIAN("no"), | ||
KOREAN("ko"), | ||
SWEDISH("sv") | ||
} |
Oops, something went wrong.