Merge pull request #1823 from sixten/zh-localization

iOS Chinese localization
This commit is contained in:
Satindar Dhillon
2023-02-17 12:46:39 -08:00
committed by GitHub
2 changed files with 11 additions and 9 deletions

View File

@ -204,10 +204,6 @@
// "saveArticleSavingState" = "保存中...";
// "Confirm Your Profile" = "确认您的个人资料";
// Unit test Entry -- Do not remove this or add entries after this one.
// This allows us to check for syntax errors in this file with a unit test
"unitTestTrailingEntry" = "仅用于测试目的。";
// Views/Home/HomeFeedViewIOS.swift file
"Archive" = "存档";
"Unarchive" = "取消存档";
@ -277,11 +273,11 @@
// Views/Profile/RecommendationGroupView.swift
"Admins" = "管理员";
"Members"" = "成员";
"Members" = "成员";
"Invite link copied" = "已复制邀请链接";
// Views/Profile/RecommendationGroupsView.swift
"Error creating club"
"Error creating club" = "Error creating club";
"Club Rules" = "已复制邀请链接";
"Only admins can post" = "只有管理员可以发帖";
"Only admins can see members" = "只有管理员才能看到成员";
@ -324,3 +320,7 @@
"View Privacy Policy" = "查看隐私策略";
"Self-hosting options" = "自我管选项";
"View Details" = "查看详情";
// Unit test Entry -- Do not remove this or add entries after this one.
// This allows us to check for syntax errors in this file with a unit test
"unitTestTrailingEntry" = "仅用于测试目的。";

View File

@ -4,12 +4,14 @@ import XCTest
final class LocalTextTests: XCTestCase {
func testThatLocalTextFindsStrings() {
// Make sure that the same key is not returned when looking up a localized string by key
// Testing the first and last entry in teh strings file is adequate for finding syntax errors.
// Testing the first and last entry in the strings file is adequate for finding syntax errors.
// If any entry is not proper than the key will be returned and the test will fail.
for languageCode in LanguageCode.allCases {
XCTAssertNotEqual(languageCode.translation(key: "unitTestLeadingEntry"), "unitTestLeadingEntry")
XCTAssertNotEqual(languageCode.translation(key: "unitTestTrailingEntry"), "unitTestTrailingEntry")
// swiftlint:disable line_length
XCTAssertNotEqual(languageCode.translation(key: "unitTestLeadingEntry"), "unitTestLeadingEntry", "Got untranslated value for unitTestLeadingEntry in \(languageCode)")
XCTAssertNotEqual(languageCode.translation(key: "unitTestTrailingEntry"), "unitTestTrailingEntry", "Got untranslated value for unitTestTrailingEntry in \(languageCode)")
// swiftlint:enable line_length
}
}