File: translate_event.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (200 lines) | stat: -rw-r--r-- 7,077 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;
option java_package = "org.chromium.components.metrics";

option java_outer_classname = "TranslateEventProtos";

package metrics;

// Stores information about a single interaction between a user and
// the Translate UI. Contains features used by Translate Ranker for
// inference, information about the ranker model and its decision, as
// well as user or automated feedback from the Translate UI.
// Next tag: 16
message TranslateEventProto {
  // Language strings are two or three letter codes, with sometimes an extra
  // suffix (for e.g. chinese zh-TW or zh-CN). See
  // https://cs.chromium.org/chromium/src/components/translate/core/browser/translate_language_list.cc
  // for a list of supported languages.
  // Source language of the translation.
  optional string source_language = 1;

  // Target language of the translation.
  optional string target_language = 2;

  // The country where the user is. 2-letter country code. This corresponds to
  // the stored permanent country in VariationsService.
  optional string country = 14;

  // The following counts are extracted from TranslatePrefs.
  // The number of times the user accepted a translation for the
  // source language.
  optional int32 accept_count = 3;

  // The number of times the user declined a translation for the
  // source language.
  optional int32 decline_count = 4;

  // The number of times the user ignored a translation for the source
  // language.
  optional int32 ignore_count = 5;

  // Language list from the language settings. These are languages the user
  // explicitly set in the language settings.
  repeated string language_list = 6;

  // The version of the translate ranker model.
  optional uint32 ranker_version = 7;

  // Timestamp of when the Ranker was queried, in seconds.
  // This value comes from Chromium's TimeTicks::Now(), which is an abstract
  // time value that is guaranteed to always be increasing (regardless of
  // Daylight Saving Time or any other changes to the system clock).
  // These numbers are only comparable within a session.  To sequence events
  // across sessions, order by the |session_id| from the
  // ChromeUserMetricsExtension message.
  optional int64 ranker_request_timestamp_sec = 8;

  // The decision of translate ranker whether we should show the UI or not.
  enum RankerResponse {
    SHOW = 0;
    DONT_SHOW = 1;
    NOT_QUERIED = 2;
  }

  optional RankerResponse ranker_response = 9 [default = NOT_QUERIED];

  // The action performed by the user in the translate UI.
  // Next tag: 28
  enum EventType {
    // The feedback event does not correspond to any of the enumerated
    // cases.
    UNKNOWN = 0;

    // User actions.
    // The user clicked 'Nope' in the UI.
    USER_DECLINE = 1;

    // The user clicked 'Translate' in the UI.
    USER_ACCEPT = 2;

    // The user explicitly closed the UI.
    USER_DISMISS = 3;

    // The user ignored the UI.
    USER_IGNORE = 4;

    // The user asked to never translate this source language.
    USER_NEVER_TRANSLATE_LANGUAGE = 5;

    // The user asked to never translate on this site.
    USER_NEVER_TRANSLATE_SITE = 6;

    // The user asked to always translate this source language.
    USER_ALWAYS_TRANSLATE_LANGUAGE = 7;

    // The user explicitly asked for a translation from the context menu.
    USER_CONTEXT_MENU_TRANSLATE = 8;

    // The user reverted the translation.
    USER_REVERT = 9;

    // Deprecated. Use AUTO_TRANSLATION_BY_PREF or AUTO_TRANSLATION_BY_LINK
    // instead.
    AUTOMATICALLY_TRANSLATED = 10;

    // Automated feedback.
    // An automatic translation was triggered.
    // User sets always translate in user settings.
    AUTO_TRANSLATION_BY_PREF = 25;

    // User navigated through a click from a translated page.
    AUTO_TRANSLATION_BY_LINK = 26;

    // The translation was not offered because translate is disabled
    // globally in the user preferences.
    DISABLED_BY_PREF = 11;

    // The translation was not offered because this language is
    // blacklisted in the user config.
    LANGUAGE_DISABLED_BY_USER_CONFIG = 12;

    // The translation was not offered because this language or URL is
    // blacklisted in the user config.
    URL_DISABLED_BY_USER_CONFIG = 13;

    // The translation was not offered because this language has been denied too
    // many times.
    LANGUAGE_DISABLED_BY_AUTO_BLACKLIST = 14;

    // The translation was not offered because Ranker dismissed it.
    DISABLED_BY_RANKER = 15;

    // The translation was not offered because the source or target
    // language is not supported.
    UNSUPPORTED_LANGUAGE = 16;

    // The translation was not offered because the URL is not
    // supported (e.g. New Tab Page).
    UNSUPPORTED_URL = 17;

    // The previous page was in the same language, so the translate UI was
    // suppressed.
    MATCHES_PREVIOUS_LANGUAGE = 18;

    // The translate UI was not shown because the browser window associated with
    // the translate event has gone away.
    BROWSER_WINDOW_IS_INVALID = 19;

    // The translate UI was not shown because the browser window for the
    // translate prompt is no longer active.
    BROWSER_WINDOW_NOT_ACTIVE = 20;

    // The translate UI was not shown because the browser window is minimized.
    BROWSER_WINDOW_IS_MINIMIZED = 21;

    // The translate UI was not shown because the web context for the translate
    // prompt is no longer active.
    WEB_CONTENTS_NOT_ACTIVE = 22;

    // The translate UI was not shown because the user is editing a form field.
    EDITABLE_FIELD_IS_ACTIVE = 23;

    // The translate UI was not shown because the language is in the user's User
    // Language Profile.
    LANGUAGE_IN_ULP = 24;

    // Failed to initialize the translate script, this can happen for iOS due
    // to CSPs.
    INITIALIZATION_ERROR = 27;
  }

  // Event received from translate UI.
  optional EventType event_type = 10;

  // Decisions that have been overridden by translate ranker (e.g.
  // LANGUAGE_DISABLED_BY_AUTO_BLACKLIST).
  repeated EventType decision_overrides = 15;

  // The timestamp for the event, in seconds.
  // This value comes from Chromium's TimeTicks::Now(), which is an abstract
  // time value that is guaranteed to always be increasing (regardless of
  // Daylight Saving Time or any other changes to the system clock).
  // These numbers are only comparable within a session.  To sequence events
  // across sessions, order by the |session_id| from the
  // ChromeUserMetricsExtension message.
  optional int64 event_timestamp_sec = 11;

  // Modified source language, if the user changed it. If changed more than
  // once, we only keep the last one.
  optional string modified_source_language = 12;

  // Modified target language, if the user changed it. If changed more than
  // once, we only keep the last one.
  optional string modified_target_language = 13;
}