-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: convert iOS translations to Android format #585
Conversation
text = stringResource(R.string.approaching_abbr), | ||
text = stringResource(R.string.minutes_abbr, 1), |
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.
This is how we handle the Approaching case on iOS - there's no separate string for "1 min" - so it seems reasonable to do the same thing here.
<string name="icon_description_external_link">External Link</string> | ||
<string name="minutes_abbr">%1$s min</string> | ||
<string name="icon_description_external_link" tools:ignore="MissingTranslation">External Link</string> | ||
<string name="minutes_abbr" tools:ignore="MissingTranslation">%1$s min</string> |
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.
There's no "External Link" on iOS (that icon has no VoiceOver text, and VoiceOver already reads them as "<link text>, button, link"), and the iOS English string is **%ld** min
but as mentioned in the PR body inline formatting is going to take some work of its own.
<string name="no_stops_nearby">Your current location is outside of our search area.</string> | ||
<string name="no_stops_nearby_title">No nearby MBTA stops</string> | ||
<string name="no_stops_nearby">You’re outside the MBTA service area.</string> | ||
<string name="no_stops_nearby_title">No nearby stops</string> |
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.
This text changed in iOS, so to get it to match in Android (and thereby not fail the build due to MissingTranslation
) I've gone ahead and updated it here.
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.
I agree this is very straightforward. iOS as the source of truth makes sense for a bunch of reasons IMO. Same goes for inline formatting as a separate ticket. Really appreciate the thorough PR description!
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.
This is great! Love your approach of scoping down this ticket.
thought(non-blocking): I think it would be worth eagerly creating android strings with default ids - something like the english text stripped of punctuation & underscore separated.
That way as we build out the UI, it will be easy to autocomplete for the correct existing string resource . We could then update those IDs as they become used, but I also wonder if it would be worth just standardizing to using that format for simplicity. (Of course, if the string changes, then the ID changes, which would be inconvenient, but maybe not terribly).
There are definitely some strings for which light post-processing of the English text would make a decent ID, but I don't think |
Summary
Ticket: 🤖 | Determine localization approach
I couldn't find any obviously useful automated tools for converting between iOS Localizable.xcstrings and Android string resources, but it turns out it's fairly straightforward to staple something basic together myself.
Tradeoffs:
Notes:
strings.xml
it will be removed fromstrings_ios_converted.xml
to avoid confusion.Testing
Manually validated that the imported translations work for the languages I can check. (Neither my emulator nor my physical Android phone support Haitian Creole at all.)