generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[12] Integrate Moko Resources to share project resources between platforms #44
Draft
AVI5HEK
wants to merge
6
commits into
develop
Choose a base branch
from
feature/12-moko-resources
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ce3e08e
[12] Integrate Moko Resources to share project resources between plat…
AVI5HEK ca5c155
[12] Update app code
AVI5HEK ae24492
[12] Integrate Moko Resources to share project resources between plat…
AVI5HEK c38021e
[12] Change submodule branch
AVI5HEK 175bc48
[12] Add Strings to iosMain
AVI5HEK 9c79a0d
Update submodules
AVI5HEK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
[submodule "android"] | ||
path = android | ||
url = [email protected]:nimblehq/android-templates.git | ||
branch = feature/replace-hilt-with-koin | ||
branch = feature/moko-resources |
Submodule android
updated
12 files
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
Submodule ios
updated
70 files
1 change: 1 addition & 0 deletions
1
sample/android/src/main/java/co/nimblehq/kmm/template/MainApplication.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
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
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
sample/shared/src/androidMain/kotlin/co/nimblehq/kmm/template/Strings.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 co.nimblehq.kmm.template | ||
|
||
import android.content.Context | ||
import dev.icerock.moko.resources.StringResource | ||
import dev.icerock.moko.resources.desc.Resource | ||
import dev.icerock.moko.resources.desc.StringDesc | ||
import dev.icerock.moko.resources.format | ||
|
||
actual class Strings(private val context: Context) { | ||
actual fun get( | ||
id: StringResource, | ||
args: List<Any>, | ||
): String { | ||
return if (args.isEmpty()) { | ||
StringDesc.Resource(id).toString(context = context) | ||
} else { | ||
id.format(*args.toTypedArray()).toString(context) | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
sample/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/Strings.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,7 @@ | ||
package co.nimblehq.kmm.template | ||
|
||
import dev.icerock.moko.resources.StringResource | ||
|
||
expect class Strings { | ||
fun get(id: StringResource, args: List<Any> = emptyList()): String | ||
} |
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,3 @@ | ||
<resources> | ||
<string name="greeting">Hello, %s!</string> | ||
</resources> |
19 changes: 19 additions & 0 deletions
19
sample/shared/src/iosMain/kotlin/co/nimblehq/kmm/template/Strings.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,19 @@ | ||
package co.nimblehq.kmm.template | ||
|
||
import dev.icerock.moko.resources.StringResource | ||
import dev.icerock.moko.resources.desc.Resource | ||
import dev.icerock.moko.resources.desc.StringDesc | ||
import dev.icerock.moko.resources.format | ||
|
||
actual class Strings { | ||
actual fun get( | ||
id: StringResource, | ||
args: List<Any>, | ||
): String { | ||
return if (args.isEmpty()) { | ||
StringDesc.Resource(id).localized() | ||
} else { | ||
id.format(*args.toTypedArray()).localized() | ||
} | ||
} | ||
} |
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
shared/src/androidMain/kotlin/co/nimblehq/kmm/template/Strings.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 co.nimblehq.kmm.template | ||
|
||
import android.content.Context | ||
import dev.icerock.moko.resources.StringResource | ||
import dev.icerock.moko.resources.desc.Resource | ||
import dev.icerock.moko.resources.desc.StringDesc | ||
import dev.icerock.moko.resources.format | ||
|
||
actual class Strings(private val context: Context) { | ||
actual fun get( | ||
id: StringResource, | ||
args: List<Any>, | ||
): String { | ||
return if (args.isEmpty()) { | ||
StringDesc.Resource(id).toString(context = context) | ||
} else { | ||
id.format(*args.toTypedArray()).toString(context) | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
shared/src/commonMain/kotlin/co/nimblehq/kmm/template/Strings.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,7 @@ | ||
package co.nimblehq.kmm.template | ||
|
||
import dev.icerock.moko.resources.StringResource | ||
|
||
expect class Strings { | ||
fun get(id: StringResource, args: List<Any> = emptyList()): String | ||
} |
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,3 @@ | ||
<resources> | ||
<string name="greeting">Hello, %s!</string> | ||
</resources> |
19 changes: 19 additions & 0 deletions
19
shared/src/iosMain/kotlin/co/nimblehq/kmm/template/Strings.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,19 @@ | ||||
package co.nimblehq.kmm.template | ||||
|
||||
import dev.icerock.moko.resources.StringResource | ||||
import dev.icerock.moko.resources.desc.Resource | ||||
import dev.icerock.moko.resources.desc.StringDesc | ||||
import dev.icerock.moko.resources.format | ||||
|
||||
actual class Strings { | ||||
actual fun get( | ||||
id: StringResource, | ||||
args: List<Any>, | ||||
): String { | ||||
return if (args.isEmpty()) { | ||||
StringDesc.Resource(id).localized() | ||||
} else { | ||||
id.format(*args.toTypedArray()).localized() | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
} | ||||
} | ||||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.