Skip to content
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

Localization overhaul #452

Merged
merged 19 commits into from
Jun 17, 2024
Merged

Conversation

Jag-Marcel
Copy link
Collaborator

Contributor checklist


Description

This PR changes the text in the app to be localized using Xcode's string catalog. This means the app localization will change automatically when the language is changed, without having to use long switch cases for every text.

Related issue

Removed deprecated fr.Iproj folder and its references, in favour of using Localizable.xcstrings for the entire project.
Localization is now able to be viewed in Localizable.xcstrings. App texts have been reworked to use this string catalog instead of language switches. Reused titles will use the same key for the localization (e.g. about.privacyPolicy for both the button in the "About" screen and as a title for the actual info page).
Bold text was removed in this commit, will be reimplemented in the next
- Bold words in the installation screen are bold again
- Fixed elements for localization strings like newlines or spaces were added in the code instead of the string catalog to make localization easier
Used the python script in my Scribe-i18n branch to generate a .xcstrings file for all languages we have .json files for (German, English, Spanish, French, Italian, Portuguese)
Mainly resolved conflicts with the main branch and updated some localizations
…hanges

This was probably not properly carried over because the file changed its name
Copy link

github-actions bot commented Jun 3, 2024

Thank you for the pull request!

The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and iOS rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you!

Maintainer checklist

  • The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution

    • The contributor's name and icon in remote commits should be the same as what appears in the PR
    • If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for git config user.email in their local Scribe-iOS repo
  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

Added missing localizations and removed unnecessary lines in the string catalog
Jag-Marcel and others added 3 commits June 3, 2024 18:03
Added ability to open language settings from the app settings. Also added some comments that should be looked at and removed a redundant line.
I wanted the App Language button to have some icon e.g. the external link or globe icon, but I couldn't get it to work. May be something to look at for the last few weeks.
@andrewtavis andrewtavis self-requested a review June 4, 2024 21:56
@andrewtavis
Copy link
Member

Something to check on this, @Jag-Marcel: in the 24/5/2024 GSoC Sync we'd talked about making sure that the Scribe-i18n files are not included in the build so it's not sent to the App Store. Would you be able to include that in here if it hasn't already been done? :) I was also just about to ask if you could include removing the fr.Iproj too, but I see that that's been done 😇 Thanks!

@andrewtavis
Copy link
Member

Hey @Jag-Marcel 👋 Sorry for the merge conflicts above, but hopefully they won't be too bad to get around. Just hit send on v3.0 a bit ago 🥳 Note further that in c6b11f3 the option to change the app's language was removed, so we'll need to revert some of the changes in there including uncommenting the code and also changing some of the indexes from [0] back to [1]. Should all be doable, and then we can quickly move to v3.1.0!

@andrewtavis
Copy link
Member

andrewtavis commented Jun 16, 2024

I went ahead and reverted the temporary changes in c6b11f3 so the app language option is back in main, @Jag-Marcel :) How do you want to handle the merge conflicts? Happy to help with these if you'd like some support!

5fd31d2 Merge pull request scribe-org#18 from Jag-Marcel/github-actions-fix
3b71e3d Slight fix to xcstrings conversion workflow
06027db Merge pull request scribe-org#7 from Jag-Marcel/swift-conversions
6b43924 Minor formatting fixes, add pt back in and fix typo in the .yml file
13c9ced Minor spelling fixes
81f9c11 Merge branch 'main' into swift-conversions
f4041c7 Edited scripts to reflect agreed upon coonfiguration
8a99dba Add basic issue templates to bring people to community channels
33cb640 Reorder Matrix logo placement in contributing of readme
9daccff Add navigation to powered by in readme
b1a2932 Minor edits to readme and maintainer checklist
38d4fa7 scribe-org#1 Update readme with Weblate information and directions
ee1eb47 Move test string to base translation file
5bd6b19 Test webhook
cb06f73 Testing adding language file and adding string to repo
3fd3707 Implemented GitHub action for xcstrings conversion script
9b5f645 Adjusted conversion for new location of Xcode file
b3d8b03 Revert "Adjusted conversion to xcstrings"
3de1788 Adjusted conversion to xcstrings
811fe13 Replaced old placeholder
055453f Changed directory and file names
4982d14 Changed file in accordance with PEP 8 style guide
3051cad Revert "Added current localizations to JSON files"
d165540 Implemented conversion from JSON to files for iOS
1a7b45d Implemented script to convert files for iOS to JSON
d452419 Added current localizations to JSON files

git-subtree-dir: Scribe/i18n
git-subtree-split: 5fd31d28c3e2b29fbf4974226862468288ec846e
- Added default values in English to every piece of text
- Changed location for localizations to i18n subtree
@Jag-Marcel
Copy link
Collaborator Author

@andrewtavis conflicts have all been resolved, and it should be ready to merge. I don't know if the text for the tip card should be included in this PR, but if they should, they still need to be added to i18n.

@andrewtavis
Copy link
Member

Nice @Jag-Marcel! Let me do that so I can practice the new setup a bit :)

@andrewtavis andrewtavis marked this pull request as ready for review June 17, 2024 20:48
@@ -102,7 +100,7 @@ final class SettingsViewController: UIViewController {
parentTable.tableFooterView?.isHidden = false
}

footerButton.setTitle("Install keyboards", for: .normal)
footerButton.setTitle("Install keyboards", for: .normal) // is this ever used?
Copy link
Member

Choose a reason for hiding this comment

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

This button appears on the settings screen if the user doesn't have an installed keyboard, @Jag-Marcel :) I'll remove the comment 😊

Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

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

Thanks for this, @Jag-Marcel! Really awesome to have all of this set out for the next big step for the app 😊 Will Remove the comment as I mentioned :)

@andrewtavis andrewtavis merged commit 04b9702 into scribe-org:main Jun 17, 2024
1 check passed
@Jag-Marcel Jag-Marcel deleted the localization-overhaul branch June 18, 2024 12:16
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.

None yet

2 participants