Repository navigation
Conversation
brokiliss
pushed a commit
to brokiliss/pesty
that referenced
this pull request
Nov 8, 2026
Squash-merged from henry-ji/pesty branch `translate` (PR momenbasel#111), built on 46031a5. Every user-facing string goes through a runtime lookup, English and Chinese tables hold the same 216 keys, and Settings gains a language picker that switches without relaunching. Co-authored-by: henry-ji <93390386+henry-ji@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pesty is literally an awesome software and I really enjoy it a lot. As a Chinese user, I'm glad to add Chinese Simplified to this software and it's my honor to promote this amazing project to more users in China. I'm also happy to help translate the README into Chinese after the pull request is approved. This PR also adds support for easy adding further translations and the detailed steps will be listed below.
About the PR
What is modified
Nothing except that all the texts written in the script are changed to dynamic ones to supprort multi-language feature, which includes:
.localizedare added after plain texts. For example:"This is a line of text"->"This is a line of text".localizedL()functions. For example"Paste to \(name)"is changed intoL("Paste to %@", name)What is deleted
Literally nothing
What is added
/Sources/LocaizationAppLanguage.swiftThis script records all the supported languages, which now only include English and Chinese Simplified.
LocalizationManager.swiftThis script is responsible for loading translations and provides the function of
.localizedandL(). The function when language is changed in the settings are also handled by this script./Sources/Resourcesxx.lproj'sThese are folders for different languages and the name of the folders should be the same with the language name defined in
/Sources/Locaization/AppLaguage/swift.The Localizable file contains each string used in the software and records its translation.
/Settings/SettingsView.swiftand/Settings/Settings.swiftSome codes are added to deal with the actions of language change and a selection is added on the top of general settings for the user to select language.
How to add more languages
/Sources/Locaization/AppLanguage.swiftvar displayName:andvar localeCode:/Resources/en.lprojand change the file name to the new language