Open zbencz3 opened 1 year ago
hi. in sample you can check tests with different locales. https://github.com/icerockdev/moko-resources/blob/master/samples/resources-gallery/mpp-library/src/commonTest/kotlin/com/icerock/library/StringResourceEnTests.kt
it works base on
also you can use same way as you do in sample code - moko-resources generates native resources, so in generated bundle
will be contained lproj
for different languages.
But you should understand that you can't use bundle of your application - moko-resources generates own bundles.
and to use this bundles you can call MR.bundle
property - that property will return bundle that contains resources of this MR class
I was wondering what would be the correct approach when using the moko-resources library to add unit tests to the iOS project?
An approach that usually works on a iOS only project would be to specify the bundle:
With the KMM/moko-resources setup I think there is no
lproj
file. So that approach would not work.Another approach would be to set the App Language and App Region in the scheme, but then again we need to switch languages multiple times.
Testing the translations in the common shared code is likely enough, but I wonder if there is a good way to still add safety tests.
Thanks!