openedx / openedx-app-ios

The mobile app for iOS for the Open EdX Platform.
Apache License 2.0
19 stars 13 forks source link

[iOS] Internationalization Infrastructure #106

Open marcotuts opened 8 months ago

marcotuts commented 8 months ago

Goal

Coming soon

Slack: #wg-product-mobile Requirement Definition: coming soon

### Tasks
- [ ] https://github.com/openedx/openedx-app-ios/issues/169
- [ ] Tech Discovery / Early Definition
- [ ] Confluence Project Page ready for review
marcotuts commented 8 months ago

Candidate for edX development and support given existing context

moiz994 commented 8 months ago

Goal: Have the app support multiple languages to increase ease of use for learners from a variety of geographical regions.

The current prod edX app supports 11 different languages (including English).

moiz994 commented 7 months ago

@e0d and @marcotuts fyi:

We support a total of 11 languages in our app:

brian-smith-tcril commented 6 months ago

I believe the best path forward for internationalizing the iOS and Android apps is to follow the patterns established by OEP-58.

This would mean:

I believe having the iOS and Android repos follow the same pattern for translations management as the rest of the repos in the Open edX GitHub organization will benefit maintainability. Following a consistent pattern for the translations workflow will make it much easier for anyone working with internationalization to understand.

This proposal does not directly address the concerns surrounding duplicated strings. While I understand the desire to deduplicate, I feel doing so in a way that only applies to the iOS and Android repos is less than ideal. Transifex provides tools to aid with this such as Translation Memory, and I believe we should utilize that before looking into adding complexity in service of deduplication.

OmarIthawi commented 5 months ago

Hello there.

I've been asked by the Axim team to review how can we extend the openedx-atlas and https://github.com/openedx/openedx-translations to be used in the mobile apps.

I've worked on openedx-atlas and we've made sure to make it cross-platform compatible with no external dependencies except for Bash.

I'm not an iOS expert and I'll be asking a colleague to work on this. So, please let me know if I've missed anything regarding the build process in iOS.

I've checked the code and noticed that strings are already extracted as part of the development process but they're not grouped.

Transifex and Translators likewise makes prefers to group the translations files to avoid confusion. We've initiated a similar effort in the edx-platform:

To illustrate the point, the edx-ios-app (old one) has more than one resource:

Same goes for the edx-app-android which admittedly has much more string resource files:

Is it doable to combine those resources into one resource before pushing it to Transifex? This would make it easier for translators to find and translate the resources? We have 54 resources already in the Open edX project and we'd like to keep in general 1 resource per application.

My suggestion to that solution is to write a build script to combine the source translations in a file to be sent to Transifex, then on pulling the translations the file is split based on the source Source/en.lproj/*.strings file so the structure is kept and the mobile apps code won't need editing.

The choice of the build script language can be any of Bash, Swift or Ruby depending on the iOS team preference. We could address the duplication issue during this process if needed -- but that'll extend the development scope a bit.

A release-time script needs to be created to pull the latest translations from the openedx/openedx-translations repository via the atlas pull command.

As far as I understand, the workflow is somewhat similar to Android.

So overall here's the ideal workflow would look like:

I'm happy to schedule a call to discuss the plan and get your feedback. We've implemented similar steps for projects with different tech-stacks and we believe it's suitable for beneficial for mobile.

OmarIthawi commented 1 month ago

Being fixed by #422