-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Onboarding Flow #1050
base: main
Are you sure you want to change the base?
Onboarding Flow #1050
Conversation
#Conflicts: # Localizable.xcstrings # Meshtastic.xcodeproj/project.pbxproj # Meshtastic/Helpers/BLEManager.swift # Meshtastic/Views/Bluetooth/Connect.swift # protobufs
… without deleting the app
/// The Title View | ||
var title: some View { | ||
VStack { | ||
Text("Welcome to") |
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.
Just a note that the sentence Welcome to Meshtastic
may have different grammar rules when translated into other languages so separating the sentence into two localized blocks has the potential to cause invalid grammar.
Also, it is best for all localized strings to have comments in order to provide context to translators.
- the context of the view where a localized string is used may have impact on how the string should be translated as the context may affect grammar / or form of the translation (e.g. femine, masculine)
- plural rules should be used when dealing with numbers as different languages have different requirements (for example, Russian requires more cases when dealing with plurals).
Text("Welcome to") | |
Text("Welcome to", | |
comment: "Onboarding Title: Welcome title, will precede the 'Meshtastic' brand (example: 'Welcome to \"Meshtastic\"')") |
} | ||
|
||
@ViewBuilder | ||
func makeRow( |
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 makeRow
ViewBuilder takes strings, but these are not localized. To ensure this will be localized these should be changed to use LocalizedStringResource
.
func makeRow( | |
func makeRow( | |
iconSystemName: String, | |
title: LocalizedStringResource, | |
subtitle: LocalizedStringResource | |
) -> some View { .. } |
var mqttView: some View { | ||
VStack { | ||
VStack { | ||
Text("MQTT") |
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.
When strings don't need to be translated, you can use String(verbatim:)
:
Text("MQTT") | |
Text(verbatim: "MQTT") |
@@ -12,7 +12,6 @@ class LocalNotificationManager { | |||
// Step 1 Request Permissions for notifications | |||
private func requestAuthorization() { | |||
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in | |||
|
|||
if granted == true && error == nil { |
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.
if granted == true && error == nil { | |
if granted && error == nil { |
.font(.title2.bold()) | ||
.multilineTextAlignment(.center) | ||
.fixedSize(horizontal: false, vertical: true) | ||
Text("Meshtastic") |
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.
When strings don't need to be translated, you can use String(verbatim:)
:
Text("Meshtastic") | |
Text(verbatim: "Meshtastic") |
What changed?
Why did it change?
How is this tested?
Screenshots/Videos (when applicable)
Checklist