Skip to content

[iOS] Moko Resources for Strings#21

Merged
MatuskaDev merged 9 commits intomainfrom
feature/ios/moko
Oct 24, 2024
Merged

[iOS] Moko Resources for Strings#21
MatuskaDev merged 9 commits intomainfrom
feature/ios/moko

Conversation

@MatuskaDev
Copy link
Copy Markdown
Contributor

@MatuskaDev MatuskaDev commented Oct 10, 2024

📝 Description

import kmp.android.shared.R
import kmp.shared.base.MR

enum class NavBarFeature(val route: String, @StringRes val titleRes: Int) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can change the titleRes from Int to StringDesc

Comment thread ios/scripts/setup.sh
Comment on lines -28 to -35
echo "⚙️ Checking whether Twine is installed"
if command -v twine &> /dev/null; then
echo "✅ Twine is installed"
else
echo "❌ Twine is not installed"
echo "Check https://github.com/MateeDevs/wiki/blob/master/tooling/ruby.md for more info"
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not remove twine installation check, since it is still used, twine takes strings.txt file and generates strings.xml files for each language which are then used to create MR by moko

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, but Twine is no longed run in iOS project. Instead it is run by Gradle in the shared module. That’s why it didn’t make sense to me to have it in the iOS script 🙂

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it still needs to be installed 🤔

Copy link
Copy Markdown
Collaborator

@tomas-bat tomas-bat Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless gradle somehow installs it – which I think it doesn't, it looks like it just executes the twine command line tool – it should be kept in the setup script.

It should be okay that it's in the iOS script.. It still needs to setup tools needed by KMP if you want to successfully build the iOS app 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, got it. I have returned the check, but placed it above ./generate-strings.sh in the script as this step uses the Twine tool.

@JuliaJakubcova
Copy link
Copy Markdown
Collaborator

JuliaJakubcova commented Oct 11, 2024

When I look at the task swiftgen should be removed since it is no longer necessary, does this PR contain the removal of swiftgen?

@MatuskaDev
Copy link
Copy Markdown
Contributor Author

When I look at the task swiftgen should be removed since it is no longer necessary, does this PR contain the removal of swiftgen?

No, Swiftgen is still in use for asset generation. Moko is used just for strings.

@JuliaJakubcova
Copy link
Copy Markdown
Collaborator

No, Swiftgen is still in use for asset generation. Moko is used just for strings.
Ah, I see, okay 🙂

Copy link
Copy Markdown
Collaborator

@tomas-bat tomas-bat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really related to this PR, but.. Does Moko allow using semantic string identifiers? Such as MR.strings().home.title, .settings.title etc.

It's something I personally prefer, so I'd be curious if it's possible with Moko 😅

@tomas-bat
Copy link
Copy Markdown
Collaborator

tomas-bat commented Oct 15, 2024

Also, do the previews work for you after in this PR? They worked prior to this 😢

The .module vs. .myModule issue from DevStack is not fixed here, but I tried that locally and the previews still didn't work.

@MatuskaDev
Copy link
Copy Markdown
Contributor Author

MatuskaDev commented Oct 15, 2024

Also, do the previews work for you after in this PR? They worked prior to this 😢

The .module vs. .myModule issue from DevStack is not fixed here, but I tried that locally and the previews still didn't work.

Yeah, @JuliaJakubcova added the fix from DevStack to this PR and the previews work well for me. It’s weird that it does not work on your side

@tomas-bat
Copy link
Copy Markdown
Collaborator

@MatuskaDev do the previews work for you even for SampleView.swift, for example?

@MatuskaDev
Copy link
Copy Markdown
Contributor Author

Not really related to this PR, but.. Does Moko allow using semantic string identifiers? Such as MR.strings().home.title, .settings.title etc.

It's something I personally prefer, so I'd be curious if it's possible with Moko 😅

Unfortunately that doesn’t seem possible with Moko at the moment 😢

@tomas-bat
Copy link
Copy Markdown
Collaborator

Yeah, @JuliaJakubcova added the fix from DevStack to this PR and the previews work well for me.

Yeah but it doesn't include the last change from MateeDevs/devstack-native-app#114, which was getting rid of the .myModule workaround, since it's no longer needed.

@MatuskaDev MatuskaDev requested a review from tomas-bat October 23, 2024 16:16
@MatuskaDev
Copy link
Copy Markdown
Contributor Author

Yeah, @JuliaJakubcova added the fix from DevStack to this PR and the previews work well for me.

Yeah but it doesn't include the last change from MateeDevs/devstack-native-app#114, which was getting rid of the .myModule workaround, since it's no longer needed.

Done, please check it 🙏

Copy link
Copy Markdown
Collaborator

@tomas-bat tomas-bat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, please check it 🙏

Yup, thanks 👍

I can't test the previews since mine are still broken, so I believe you that they still work 😅

@MatuskaDev MatuskaDev merged commit 2fb978d into main Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants