mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Set language and rtl based on current system Locale
This commit is contained in:
parent
1a569f881d
commit
c9df320ddd
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user