Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Side by Side Diff: ios/web_view/public/cwv_language_detection_result.h

Issue 2839093002: Implemented new Translate API for purely Objective-C clients. (Closed)
Patch Set: Added some error handling. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_LANGUAGE_DETECTION_RESULT_H
6 #define IOS_WEB_VIEW_PUBLIC_CWV_LANGUAGE_DETECTION_RESULT_H
7
8 #import <ChromeWebView/cwv_export.h>
9 #import <Foundation/Foundation.h>
10
Eugene But (OOO till 7-30) 2017/04/26 20:15:30 Do you want to use nullability macro here?
jzw1 2017/04/27 04:54:01 Done.
11 @class CWVTranslationLanguage;
12
13 // Encapsulates the results of language detection in one class.
14 CWV_EXPORT
15 @interface CWVLanguageDetectionResult : NSObject
16
17 - (instancetype)initWithSourceLanguage:(CWVTranslationLanguage*)sourceLanguage
Eugene But (OOO till 7-30) 2017/04/26 20:15:30 Does this method needs to be public? Client don't
jzw1 2017/04/27 04:54:01 moved to internal header file.
18 targetLanguage:(CWVTranslationLanguage*)targetLanguage
19 supportedLanguages:
20 (NSArray<CWVTranslationLanguage*>*)supportedLanguages
21 NS_DESIGNATED_INITIALIZER;
22
23 - (instancetype)init NS_UNAVAILABLE;
24
25 // The detected page language.
26 @property(nonatomic, readonly) CWVTranslationLanguage* sourceLanguage;
27 // The assumed target language based on OS locale.
Eugene But (OOO till 7-30) 2017/04/26 20:15:30 Do you want to be more specific (f.e. say that thi
jzw1 2017/04/27 04:54:01 Done.
28 @property(nonatomic, readonly) CWVTranslationLanguage* targetLanguage;
Eugene But (OOO till 7-30) 2017/04/26 20:15:30 Should this be something like, suggestedTranslatio
Hiroshi Ichikawa 2017/04/27 02:41:54 I believe suggestedTranslationLanguage is also amb
jzw1 2017/04/27 04:54:01 I will rename sourceLanguage to pageLanguage and t
Eugene But (OOO till 7-30) 2017/04/27 13:08:08 is targetLanguage always the same as OS language?
jzw1 2017/04/28 02:34:53 Internally it returns the first non empty lang in
Eugene But (OOO till 7-30) 2017/04/28 03:07:28 So looks like the fact that result will be OS lang
jzw1 2017/04/28 05:43:35 renamed to suggestedTranslationLanguage and update
Hiroshi Ichikawa 2017/04/28 05:50:06 As I told in earlier comment, I feel suggestedTran
29 // The list of languages that can be used in translation.
Eugene But (OOO till 7-30) 2017/04/26 20:15:30 nit: "The list of supported languages that can be
jzw1 2017/04/27 04:54:01 Done.
30 @property(nonatomic, readonly)
31 NSArray<CWVTranslationLanguage*>* supportedLanguages;
32
33 @end
34
35 #endif // IOS_WEB_VIEW_PUBLIC_CWV_LANGUAGE_DETECTION_RESULT_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698