-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(shared): use lyricist for translations.
- Loading branch information
1 parent
96c6ff0
commit 646a07c
Showing
17 changed files
with
148 additions
and
141 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
Binary file modified
BIN
+9.64 KB
(100%)
...codeproj/project.xcworkspace/xcuserdata/GERARD.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
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
21 changes: 18 additions & 3 deletions
21
shared/core-di/src/commonMain/kotlin/org/gdglille/devfest/DatabaseModule.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 |
---|---|---|
@@ -1,25 +1,40 @@ | ||
package org.gdglille.devfest | ||
|
||
import cafe.adriel.lyricist.LanguageTag | ||
import cafe.adriel.lyricist.Lyricist | ||
import com.russhwolf.settings.ExperimentalSettingsApi | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.IO | ||
import org.gdglille.devfest.android.shared.resources.EnStrings | ||
import org.gdglille.devfest.android.shared.resources.FrStrings | ||
import org.gdglille.devfest.database.EventDao | ||
import org.gdglille.devfest.database.FeaturesActivatedDao | ||
import org.gdglille.devfest.database.PartnerDao | ||
import org.gdglille.devfest.database.ScheduleDao | ||
import org.gdglille.devfest.database.SpeakerDao | ||
import org.gdglille.devfest.database.TalkDao | ||
import org.gdglille.devfest.database.UserDao | ||
import org.koin.core.qualifier.named | ||
import org.koin.dsl.module | ||
|
||
@OptIn(ExperimentalSettingsApi::class) | ||
val databasesModule = module { | ||
includes(platformModule) | ||
single { | ||
Lyricist( | ||
defaultLanguageTag = "en", | ||
translations = mapOf("en" to EnStrings, "fr" to FrStrings) | ||
).apply { | ||
this.languageTag = get<LanguageTag>(named(AcceptLanguageNamed)).split("-").first() | ||
} | ||
} | ||
single { EventDao(db = get(), settings = get(), dispatcher = Dispatchers.IO) } | ||
single { FeaturesActivatedDao(db = get(), settings = get(), dispatcher = Dispatchers.IO) } | ||
single { PartnerDao(db = get(), platform = get(), dispatcher = Dispatchers.IO) } | ||
single { ScheduleDao(db = get(), settings = get(), dispatcher = Dispatchers.IO) } | ||
single { SpeakerDao(db = get(), dispatcher = Dispatchers.IO) } | ||
single { TalkDao(db = get(), dispatcher = Dispatchers.IO) } | ||
single { | ||
ScheduleDao(db = get(), settings = get(), lyricist = get(), dispatcher = Dispatchers.IO) | ||
} | ||
single { SpeakerDao(db = get(), lyricist = get(), dispatcher = Dispatchers.IO) } | ||
single { TalkDao(db = get(), lyricist = get(), dispatcher = Dispatchers.IO) } | ||
single { UserDao(db = get(), platform = get(), dispatcher = Dispatchers.IO) } | ||
} |
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
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
Oops, something went wrong.