diff options
-rw-r--r-- | remoting/resources/android/menu/chromoting_actionbar.xml | 7 | ||||
-rw-r--r-- | remoting/resources/android/menu/desktop_actionbar.xml | 7 | ||||
-rw-r--r-- | remoting/resources/remoting_strings.grd | 6 | ||||
-rwxr-xr-x | remoting/tools/verify_resources.py | 26 |
4 files changed, 39 insertions, 7 deletions
diff --git a/remoting/resources/android/menu/chromoting_actionbar.xml b/remoting/resources/android/menu/chromoting_actionbar.xml index 6f057d0..6831eb4 100644 --- a/remoting/resources/android/menu/chromoting_actionbar.xml +++ b/remoting/resources/android/menu/chromoting_actionbar.xml @@ -11,4 +11,11 @@ android:title="@string/actionbar_directoryrefresh" android:icon="@android:drawable/ic_popup_sync" android:showAsAction="ifRoom"/> + <!-- + The Help option must be the final menu item and it must only appear in + the action-bar overflow menu. + --> + <item android:id="@+id/actionbar_help" + android:title="@string/actionbar_help" + android:showAsAction="never"/> </menu> diff --git a/remoting/resources/android/menu/desktop_actionbar.xml b/remoting/resources/android/menu/desktop_actionbar.xml index 05f97ef..e67615e 100644 --- a/remoting/resources/android/menu/desktop_actionbar.xml +++ b/remoting/resources/android/menu/desktop_actionbar.xml @@ -21,4 +21,11 @@ <item android:id="@+id/actionbar_disconnect" android:title="@string/actionbar_disconnect" android:showAsAction="withText"/> + <!-- + The Help option must be the final menu item and it must only appear in + the action-bar overflow menu. + --> + <item android:id="@+id/actionbar_help" + android:title="@string/actionbar_help" + android:showAsAction="never"/> </menu> diff --git a/remoting/resources/remoting_strings.grd b/remoting/resources/remoting_strings.grd index 47ba473..48cd896 100644 --- a/remoting/resources/remoting_strings.grd +++ b/remoting/resources/remoting_strings.grd @@ -377,6 +377,12 @@ </message> </if> + <if expr="is_android"> + <message desc="Text displayed in the Android action-bar overflow menu for showing the Help and Feedback screen" name="IDS_ACTIONBAR_HELP" formatter_data="android_java"> + Help & feedback + </message> + </if> + <message desc="Label for the access code entry box. This is where the client user enters the code that permits access to the host." name="IDS_ACCESS_CODE"> Access code </message> diff --git a/remoting/tools/verify_resources.py b/remoting/tools/verify_resources.py index 1f5d8d4..1b082a5 100755 --- a/remoting/tools/verify_resources.py +++ b/remoting/tools/verify_resources.py @@ -40,15 +40,21 @@ prefix /*i18n-content*/ def LoadTagsFromGrd(filename): xml = minidom.parse(filename) - tags = [] + android_tags = [] + other_tags = [] msgs_and_structs = xml.getElementsByTagName("message") msgs_and_structs.extend(xml.getElementsByTagName("structure")) for res in msgs_and_structs: name = res.getAttribute("name") if not name or not name.startswith("IDS_"): raise Exception("Tag name doesn't start with IDS_: %s" % name) - tags.append(name[4:]) - return tags + name = name[4:] + if 'android_java' in res.getAttribute('formatter_data'): + android_tags.append(name) + else: + other_tags.append(name) + return android_tags, other_tags + def ExtractTagFromLine(file_type, line): """Extract a tag from a line of HTML, C++, JS or JSON.""" @@ -132,18 +138,24 @@ def main(): print 'At least one GRD file needs to be specified.' return 1 - resources = [] + all_resources = [] + non_android_resources = [] for f in options.grd: - resources.extend(LoadTagsFromGrd(f)) + android_tags, other_tags = LoadTagsFromGrd(f) + all_resources.extend(android_tags + other_tags) + non_android_resources.extend(other_tags) used_tags = set([]) exit_code = 0 for f in args: - if not VerifyFile(f, resources, used_tags): + if not VerifyFile(f, all_resources, used_tags): exit_code = 1 + # Determining if a resource is being used in the Android app is tricky + # because it requires annotating and parsing Android XML layout files. + # For now, exclude Android strings from this check. warnings = False - for tag in resources: + for tag in non_android_resources: if tag not in used_tags: print ('%s/%s:0: warning: %s is defined but not used') % \ (os.getcwd(), sys.argv[2], tag) |