Set language and rtl based on current system Locale

This commit is contained in:
Angelo Stavrow 2020-09-16 13:44:52 -04:00
parent 1a569f881d
commit c9df320ddd
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -105,6 +105,10 @@ struct PostListView: View {
managedPost.title = ""
managedPost.body = ""
managedPost.status = PostStatus.local.rawValue
if let languageCode = Locale.current.languageCode {
managedPost.language = languageCode
managedPost.rtl = Locale.characterDirection(forLanguage: languageCode) == .rightToLeft
}
if let selectedCollectionAlias = selectedCollection?.alias {
managedPost.collectionAlias = selectedCollectionAlias
}