зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1057634 - Use localized string for default search engine identifier. r=bnicholson
This commit is contained in:
Родитель
f9d917d9aa
Коммит
0992863beb
|
@ -23,8 +23,4 @@ public class Constants {
|
|||
public static final int SUGGESTION_MAX = 5;
|
||||
|
||||
public static final String ABOUT_BLANK = "about:blank";
|
||||
|
||||
// The default search engine for new users. This should match one of
|
||||
// the SearchEngineFactory.Engine enum values.
|
||||
public static final String DEFAULT_SEARCH_ENGINE = "yahoo";
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ public class SearchPreferenceActivity extends PreferenceActivity
|
|||
searchEnginePref.setEntryValues(entryValues);
|
||||
|
||||
if (searchEnginePref.getValue() == null) {
|
||||
searchEnginePref.setValue(Constants.DEFAULT_SEARCH_ENGINE);
|
||||
searchEnginePref.setValue(getResources().getString(R.string.default_engine_identifier));
|
||||
}
|
||||
searchEnginePref.setSummary(searchEnginePref.getEntry());
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import android.util.Log;
|
|||
import org.mozilla.gecko.AppConstants;
|
||||
import org.mozilla.gecko.GeckoSharedPrefs;
|
||||
import org.mozilla.gecko.util.GeckoJarReader;
|
||||
import org.mozilla.search.Constants;
|
||||
import org.mozilla.search.R;
|
||||
import org.mozilla.search.SearchPreferenceActivity;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
|
@ -85,9 +85,10 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
|
|||
final AsyncTask<Void, Void, SearchEngine> task = new AsyncTask<Void, Void, SearchEngine>() {
|
||||
@Override
|
||||
protected SearchEngine doInBackground(Void... params) {
|
||||
final String identifier = GeckoSharedPrefs.forApp(context)
|
||||
.getString(SearchPreferenceActivity.PREF_SEARCH_ENGINE_KEY, Constants.DEFAULT_SEARCH_ENGINE)
|
||||
.toLowerCase();
|
||||
String identifier = GeckoSharedPrefs.forApp(context).getString(SearchPreferenceActivity.PREF_SEARCH_ENGINE_KEY, null);
|
||||
if (TextUtils.isEmpty(identifier)) {
|
||||
identifier = context.getResources().getString(R.string.default_engine_identifier);
|
||||
}
|
||||
return createEngine(identifier);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,3 +20,6 @@
|
|||
|
||||
<!ENTITY search_widget_button_label 'Search'>
|
||||
|
||||
<!-- Localization note (default_engine_identifier): Search engine identifier for the default
|
||||
engine. This should be one of the identifiers listed in /searchplugins/list.txt -->
|
||||
<!ENTITY default_engine_identifier 'yahoo'>
|
||||
|
|
|
@ -14,3 +14,5 @@
|
|||
|
||||
<string name="search_widget_name">&search_app_name;</string>
|
||||
<string name="search_widget_button_label">&search_widget_button_label;</string>
|
||||
|
||||
<string name="default_engine_identifier">&default_engine_identifier;</string>
|
||||
|
|
Загрузка…
Ссылка в новой задаче