Git Product home page Git Product logo

Comments (12)

Alex009 avatar Alex009 commented on May 24, 2024 2

You can't access to classes from dependencies of :shared module in your :android-app module if you use implementation configuration in :shared module.
Try change implementation to api.

also kotlin-native-gradle-plugin is deprecated, now should be used org.jetbrains.kotlin.multiplatform plugin - https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-a-multiplatform-project and moko-resources gradle plugin have integration only with org.jetbrains.kotlin.multiplatform

from moko-resources.

Alex009 avatar Alex009 commented on May 24, 2024 1

It looks correct. I'll try to reproduce the problem at home

from moko-resources.

Alex009 avatar Alex009 commented on May 24, 2024 1

i have reproduced the problem. and on sample project invalid language set not always, but in 70% cases...it's strange. after fix i will inform you here

from moko-resources.

Alex009 avatar Alex009 commented on May 24, 2024 1

@rmdan90 hi! please try to add these code into Info.plist of ios application:

	<key>CFBundleLocalizations</key>
	<array>
		<string>en</string>
		<string>es</string>
	</array>

from moko-resources.

Alex009 avatar Alex009 commented on May 24, 2024

hi!
Are you trying to run the sample from the repository or implementing it in your project?
I checked the launch of the sample from the sample directory - everything starts correctly.
Can you attach a build.gradle to issue? Or upload project reproducer to github?

from moko-resources.

rmdan90 avatar rmdan90 commented on May 24, 2024

I'm trying to implement it in my project.

buildscript {
ext.kotlin_version = '1.3.61'
ext.kotlin_native_version = '1.3.41'
ext.ktor_version='1.2.6'
ext.coroutines_version='1.3.2'
ext.kotlinx_coroutines_version='1.3.2'
ext.serialization_version = '0.14.0'
ext.localization_version = '0.6.0'
repositories {
    maven { url 'https://plugins.gradle.org/m2/' }
    maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
    maven { url 'https://dl.bintray.com/jetbrains/kotlin-native-dependencies' }
    maven { url 'https://dl.bintray.com/kotlin/ktor' }
    maven { url "https://kotlin.bintray.com/kotlinx" }
    maven { url = "https://dl.bintray.com/icerockdev/plugins" }
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.5.3'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$kotlin_native_version"
    classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
    classpath "dev.icerock.moko:resources-generator:$localization_version"
}

And the shared build.gradle

commonMain.dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib-common'
implementation "io.ktor:ktor-client-core:$ktor_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version"
implementation "ch.qos.logback:logback-classic:1.2.3"
implementation "io.ktor:ktor-client-logging:$ktor_version"
implementation "dev.icerock.moko:resources:$localization_version"
}

` object StringUtils {

fun getMyString(): StringDesc {
    return StringDesc.Resource(MR.strings.success)
}

} `

Android call

Log.d("testLocalized", getMyString().toString(this))

from moko-resources.

rmdan90 avatar rmdan90 commented on May 24, 2024

It works fine now on android in both English and spanish.
But on iOS simulator it always display the english message, Are there any configurations i'm missing?

from moko-resources.

Alex009 avatar Alex009 commented on May 24, 2024

Can you show your MR directory structure?
And can you do small sample with reproduction of problem?

from moko-resources.

rmdan90 avatar rmdan90 commented on May 24, 2024

here is the structure of MR
Screen Shot 2019-12-17 at 9 04 24 AM

from moko-resources.

Alex009 avatar Alex009 commented on May 24, 2024

@DevTchernov it's strange behavior of iOS side, your attention needed

from moko-resources.

rmdan90 avatar rmdan90 commented on May 24, 2024

It works like a charm now.
@Alex009 Thank you.

from moko-resources.

Alex009 avatar Alex009 commented on May 24, 2024

info added to readme

from moko-resources.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.