Created
April 28, 2022 11:35
-
-
Save meyusufdemirci/3a6a94d9718bd4487835fde71e849555 to your computer and use it in GitHub Desktop.
Realtime Localization Article
This file contains 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
struct ContentView: View { | |
@EnvironmentObject var appEnvironment: AppEnvironment | |
var body: some View { | |
VStack { | |
Spacer() | |
Text(appEnvironment.localizationManager.localize("helloWorld")) | |
Spacer() | |
HStack { | |
Spacer() | |
Button("English") { | |
appEnvironment.localizationManager.language = .english | |
} | |
Spacer() | |
Button("Turkish") { | |
appEnvironment.localizationManager.language = .turkish | |
} | |
Spacer() | |
} | |
Spacer() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment