Commit 615edca4 authored by David黄金龙's avatar David黄金龙

添加 多语言文件

parent 15b0052c
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
A5C5B2E62B4EC0BF00A7C5D1 /* YHDavidTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C5B2E52B4EC0BF00A7C5D1 /* YHDavidTestViewController.swift */; }; A5C5B2E62B4EC0BF00A7C5D1 /* YHDavidTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C5B2E52B4EC0BF00A7C5D1 /* YHDavidTestViewController.swift */; };
A5C5B2E82B4EC95600A7C5D1 /* YHDavidTestCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C5B2E72B4EC95600A7C5D1 /* YHDavidTestCollectionViewCell.swift */; }; A5C5B2E82B4EC95600A7C5D1 /* YHDavidTestCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C5B2E72B4EC95600A7C5D1 /* YHDavidTestCollectionViewCell.swift */; };
A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C5B2E92B4ECA4D00A7C5D1 /* YHDavidModel0.swift */; }; A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C5B2E92B4ECA4D00A7C5D1 /* YHDavidModel0.swift */; };
A5C5B2EE2B4F9B8800A7C5D1 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = A5C5B2ED2B4F9B8800A7C5D1 /* Localizable.xcstrings */; };
A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */; }; A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */; };
A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */; }; A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -190,6 +191,7 @@ ...@@ -190,6 +191,7 @@
A5C5B2E52B4EC0BF00A7C5D1 /* YHDavidTestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDavidTestViewController.swift; sourceTree = "<group>"; }; A5C5B2E52B4EC0BF00A7C5D1 /* YHDavidTestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDavidTestViewController.swift; sourceTree = "<group>"; };
A5C5B2E72B4EC95600A7C5D1 /* YHDavidTestCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDavidTestCollectionViewCell.swift; sourceTree = "<group>"; }; A5C5B2E72B4EC95600A7C5D1 /* YHDavidTestCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDavidTestCollectionViewCell.swift; sourceTree = "<group>"; };
A5C5B2E92B4ECA4D00A7C5D1 /* YHDavidModel0.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDavidModel0.swift; sourceTree = "<group>"; }; A5C5B2E92B4ECA4D00A7C5D1 /* YHDavidModel0.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDavidModel0.swift; sourceTree = "<group>"; };
A5C5B2ED2B4F9B8800A7C5D1 /* Localizable.xcstrings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeModel.swift; sourceTree = "<group>"; }; A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeModel.swift; sourceTree = "<group>"; };
A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomePageViewModel.swift; sourceTree = "<group>"; }; A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomePageViewModel.swift; sourceTree = "<group>"; };
B6BB01E4C5DB87B66F0ECE84 /* Pods-galaxy.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.release.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.release.xcconfig"; sourceTree = "<group>"; }; B6BB01E4C5DB87B66F0ECE84 /* Pods-galaxy.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.release.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.release.xcconfig"; sourceTree = "<group>"; };
...@@ -474,6 +476,7 @@ ...@@ -474,6 +476,7 @@
A5ACE9142B4564F7002C94D2 /* Res */ = { A5ACE9142B4564F7002C94D2 /* Res */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A5C5B2ED2B4F9B8800A7C5D1 /* Localizable.xcstrings */,
04808C022B4686510056D53C /* Frameworks */, 04808C022B4686510056D53C /* Frameworks */,
A5573EDA2B317C0000D98EC0 /* Assets.xcassets */, A5573EDA2B317C0000D98EC0 /* Assets.xcassets */,
A5573EDF2B317C0000D98EC0 /* Info.plist */, A5573EDF2B317C0000D98EC0 /* Info.plist */,
...@@ -694,6 +697,7 @@ ...@@ -694,6 +697,7 @@
knownRegions = ( knownRegions = (
en, en,
Base, Base,
"zh-Hans",
); );
mainGroup = A5573EC52B317BFF00D98EC0; mainGroup = A5573EC52B317BFF00D98EC0;
productRefGroup = A5573ECF2B317BFF00D98EC0 /* Products */; productRefGroup = A5573ECF2B317BFF00D98EC0 /* Products */;
...@@ -713,6 +717,7 @@ ...@@ -713,6 +717,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */, 04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */,
A5C5B2EE2B4F9B8800A7C5D1 /* Localizable.xcstrings in Resources */,
A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */, A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */,
A51044182B493675006B60BB /* README.md in Resources */, A51044182B493675006B60BB /* README.md in Resources */,
A5573EDB2B317C0000D98EC0 /* Assets.xcassets in Resources */, A5573EDB2B317C0000D98EC0 /* Assets.xcassets in Resources */,
......
...@@ -8,12 +8,14 @@ ...@@ -8,12 +8,14 @@
import UIKit import UIKit
import ESPullToRefresh
class YHDavidTestViewController: YHBaseViewController { class YHDavidTestViewController: YHBaseViewController {
lazy var items = { lazy var items = {
return [AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高")] return [AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高")]
}() }()
lazy var collectView = { lazy var myCollectView = {
// 设置布局方向 // 设置布局方向
let flowLayout = UICollectionViewFlowLayout() let flowLayout = UICollectionViewFlowLayout()
let margin = 20.0 let margin = 20.0
...@@ -31,6 +33,11 @@ class YHDavidTestViewController: YHBaseViewController { ...@@ -31,6 +33,11 @@ class YHDavidTestViewController: YHBaseViewController {
collectinoView.register(YHDavidTestCollectionViewCell.self, forCellWithReuseIdentifier:YHDavidTestCollectionViewCell.cellReuseIdentifier) collectinoView.register(YHDavidTestCollectionViewCell.self, forCellWithReuseIdentifier:YHDavidTestCollectionViewCell.cellReuseIdentifier)
collectinoView.delegate = self collectinoView.delegate = self
collectinoView.dataSource = self collectinoView.dataSource = self
collectinoView.translatesAutoresizingMaskIntoConstraints = false
collectinoView.alwaysBounceVertical = true
return collectinoView return collectinoView
}() }()
...@@ -38,17 +45,45 @@ class YHDavidTestViewController: YHBaseViewController { ...@@ -38,17 +45,45 @@ class YHDavidTestViewController: YHBaseViewController {
super.viewDidLoad() super.viewDidLoad()
setupUI() setupUI()
self.myCollectView.es.addPullToRefresh {
self.loadFirstItem()
}
self.myCollectView.es.startPullToRefresh()
self.myCollectView.es.addInfiniteScrolling {
self.loadFakeData()
}
} }
} }
extension YHDavidTestViewController { extension YHDavidTestViewController {
private func loadFirstItem() {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
self.items = [AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高")]
self.myCollectView.es.stopPullToRefresh(ignoreDate: true,ignoreFooter: false)
self.myCollectView.reloadData()
}
}
private func loadFakeData() {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
self.items.append(AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高"))
self.items.append(AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高"))
self.items.append(AboutAdvantageItem(iconName: "about_match", title: "精准匹配", detail: "大数据精准匹配,专属方案获批率更高"))
self.myCollectView.es.stopLoadingMore()
self.myCollectView.reloadData()
}
}
func setupUI() { func setupUI() {
gk_navTitle = "David的测试UI" gk_navTitle = "David的测试UI"
view.backgroundColor = .white view.backgroundColor = .white
view.addSubview(collectView) view.addSubview(myCollectView)
collectView.snp.makeConstraints { make in myCollectView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview() make.left.right.bottom.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar) make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
} }
...@@ -62,13 +97,13 @@ extension YHDavidTestViewController: UICollectionViewDelegateFlowLayout, UIColle ...@@ -62,13 +97,13 @@ extension YHDavidTestViewController: UICollectionViewDelegateFlowLayout, UIColle
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count return items.count
} }
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHDavidTestCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHDavidTestCollectionViewCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHDavidTestCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHDavidTestCollectionViewCell
return cell return cell
}
}
private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print("index is \(indexPath.row)") print("index is \(indexPath.row)")
} }
......
...@@ -42,7 +42,7 @@ class YHDavidTestCollectionViewCell: UICollectionViewCell { ...@@ -42,7 +42,7 @@ class YHDavidTestCollectionViewCell: UICollectionViewCell {
lazy var headImageView:UIImageView = { lazy var headImageView:UIImageView = {
let imageV = UIImageView(image: UIImage(named: "mine_manager")) let imageV = UIImageView(image: UIImage(named: "home_person_icon"))
imageV.contentMode = .scaleAspectFill imageV.contentMode = .scaleAspectFill
return imageV return imageV
}() }()
......
{
"images" : [
{
"filename" : "a1ee8b3bd2c4f4969fd48d8db3c66fd 93.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "a1ee8b3bd2c4f4969fd48d8db3c66fd 93@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "a1ee8b3bd2c4f4969fd48d8db3c66fd 93@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"sourceLanguage" : "en",
"strings" : {
"Loading more" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Loading more"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "加载更多"
}
}
}
},
"Loading..." : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Loading..."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "加载中..."
}
}
}
},
"No more data" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "No more data"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "无更多数据"
}
}
}
},
"Pull to refresh" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Pull to refresh"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "下拉更新"
}
}
}
},
"Release to refresh" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Release to refresh"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "松手开始请求"
}
}
}
}
},
"version" : "1.0"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment