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

Side by Side Diff: chrome/installer/util/l10n_string_util.h

Issue 2791593002: Allow installer::GetLocalizedString to return mode-specific strings. (Closed)
Patch Set: manzagop review part the deux Created 3 years, 8 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
« no previous file with comments | « chrome/installer/util/install_util.cc ('k') | chrome/installer/util/l10n_string_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file contains helper functions for getting strings that are included in 5 // This file contains helper functions for getting strings that are included in
6 // our DLL for all languages (i.e., does not come from our language DLL). 6 // our DLL for all languages (i.e., does not come from our language DLL).
7 // 7 //
8 // These resource strings are organized such that we can get a localized string 8 // These resource strings are organized such that we can get a localized string
9 // by taking the base resource ID and adding a language offset. For example, 9 // by taking the base resource ID and adding a language offset. For example,
10 // to get the resource id for the localized product name in en-US, we take 10 // to get the resource id for the localized product name in en-US, we take
(...skipping 13 matching lines...) Expand all
24 virtual ~TranslationDelegate(); 24 virtual ~TranslationDelegate();
25 virtual base::string16 GetLocalizedString(int installer_string_id) = 0; 25 virtual base::string16 GetLocalizedString(int installer_string_id) = 0;
26 }; 26 };
27 27
28 // If we're in Chrome, the installer strings aren't in the binary, but are in 28 // If we're in Chrome, the installer strings aren't in the binary, but are in
29 // the localized pak files. A TranslationDelegate must be provided so we can 29 // the localized pak files. A TranslationDelegate must be provided so we can
30 // load these strings. 30 // load these strings.
31 void SetTranslationDelegate(TranslationDelegate* delegate); 31 void SetTranslationDelegate(TranslationDelegate* delegate);
32 32
33 // Given a string base id, return the localized version of the string based on 33 // Given a string base id, return the localized version of the string based on
34 // the system language. This is used for shortcuts placed on the user's 34 // the system language. This is used for shortcuts placed on the user's desktop.
35 // desktop. The string is retrieved from the TranslationDelegate if one has 35 // The string is retrieved from the TranslationDelegate if one has been set.
36 // been set. Otherwise, the string is read from the binary's string table. 36 // Otherwise, the string is read from the binary's string table. Certain
37 // messages (see MODE_SPECIFIC_STRINGS in create_string_rc.py) are dynamically
38 // mapped to a variant that is specific to the current install mode (e.g.,
39 // IDS_INBOUND_MDNS_RULE_NAME is mapped to IDS_INBOUND_MDNS_RULE_NAME_CANARY for
40 // canary Chrome).
37 std::wstring GetLocalizedString(int base_message_id); 41 std::wstring GetLocalizedString(int base_message_id);
38 42
39 // Returns the localized version of a string (obtained from GetLocalizedString) 43 // Returns the localized version of a string (obtained from GetLocalizedString)
40 // with $1 replaced with |a|. Additionally, $$ is replaced by $. 44 // with $1 replaced with |a|. Additionally, $$ is replaced by $.
41 base::string16 GetLocalizedStringF(int base_message_id, 45 base::string16 GetLocalizedStringF(int base_message_id,
42 const base::string16& a); 46 const base::string16& a);
43 47
44 // Given the system language, return a url that points to the localized eula. 48 // Given the system language, return a url that points to the localized eula.
45 // The empty string is returned on failure. 49 // The empty string is returned on failure.
46 std::wstring GetLocalizedEulaResource(); 50 std::wstring GetLocalizedEulaResource();
47 51
48 // Returns the language identifier of the translation currently in use. 52 // Returns the language identifier of the translation currently in use.
49 std::wstring GetCurrentTranslation(); 53 std::wstring GetCurrentTranslation();
50 54
55 // Returns the mode-specific message id for |base_message_id| given the current
56 // install mode. Returns |base_message_id| itself if it does not have per-mode
57 // variants. See MODE_SPECIFIC_STRINGS in create_string_rc.py for details..
58 int GetBaseMessageIdForMode(int base_message_id);
59
51 } // namespace installer. 60 } // namespace installer.
52 61
53 #endif // CHROME_INSTALLER_UTIL_L10N_STRING_UTIL_H_ 62 #endif // CHROME_INSTALLER_UTIL_L10N_STRING_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/installer/util/install_util.cc ('k') | chrome/installer/util/l10n_string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698