firefox-multilocale-chrome.patch
changeset 880 349bcaa18df4
parent 879 3b986c9dbc5f
parent 875 2d6ccc01ea9e
child 881 1268ddc9dc16
equal deleted inserted replaced
879:3b986c9dbc5f 880:349bcaa18df4
     1 # HG changeset patch
       
     2 # Parent 16846914f968944f991c8b12fdc38ce8fc099d73
       
     3 # User Wolfgang Rosenauer <wr@rosenauer.org>
       
     4 # Parent  c0a406c7a6cc5edc8fb34549428866ff39ad878f
       
     5 Add searchplugins to chrome packaging for proper localization
       
     6 
       
     7 diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
       
     8 --- a/browser/app/profile/firefox.js
       
     9 +++ b/browser/app/profile/firefox.js
       
    10 @@ -378,16 +378,20 @@ pref("browser.helperApps.deleteTempFileO
       
    11  #endif
       
    12  
       
    13  // search engines URL
       
    14  pref("browser.search.searchEnginesURL",      "https://addons.mozilla.org/%LOCALE%/firefox/search-engines/");
       
    15  
       
    16  // pointer to the default engine name
       
    17  pref("browser.search.defaultenginename",      "chrome://browser-region/locale/region.properties");
       
    18  
       
    19 +// Tell the search service to load search plugins from the locale JAR
       
    20 +pref("browser.search.loadFromJars", true);
       
    21 +pref("browser.search.jarURIs", "chrome://browser/locale/searchplugins/");
       
    22 +
       
    23  // Ordering of Search Engines in the Engine list. 
       
    24  pref("browser.search.order.1",                "chrome://browser-region/locale/region.properties");
       
    25  pref("browser.search.order.2",                "chrome://browser-region/locale/region.properties");
       
    26  pref("browser.search.order.3",                "chrome://browser-region/locale/region.properties");
       
    27  
       
    28  // Market-specific search defaults (US market only)
       
    29  pref("browser.search.geoSpecificDefaults", true);
       
    30  pref("browser.search.defaultenginename.US",      "data:text/plain,browser.search.defaultenginename.US=Yahoo");
       
    31 diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
       
    32 --- a/browser/locales/Makefile.in
       
    33 +++ b/browser/locales/Makefile.in
       
    34 @@ -66,27 +66,30 @@ STUB_HOOK = $(NSINSTALL) -D '$(_ABS_DIST
       
    35      cp ../installer/windows/l10ngen/stub.exe '$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'; \
       
    36      chmod 0755 '$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'; \
       
    37      $(NULL)
       
    38  endif
       
    39  
       
    40  ifeq ($(MOZ_WIDGET_TOOLKIT) $(DIST_SUBDIR),windows metro)
       
    41  SEARCHPLUGINS_NAMES = $(shell cat $(call MERGE_FILE,/searchplugins/metrolist.txt))
       
    42  else
       
    43 -SEARCHPLUGINS_NAMES = $(shell cat $(call MERGE_FILE,/searchplugins/list.txt)) ddg
       
    44 +SEARCHPLUGINS_NAMES = $(shell cat \
       
    45 +    $(firstword $(wildcard $(LOCALE_SRCDIR)/searchplugins/list.txt) \
       
    46 +    @srcdir@/en-US/searchplugins/list.txt ) ) ddg
       
    47  endif
       
    48  SEARCHPLUGINS_PATH := $(FINAL_TARGET)/searchplugins
       
    49  # metro build call a searchplugins target for search engine plugins
       
    50  .PHONY: searchplugins
       
    51  SEARCHPLUGINS_TARGET := libs searchplugins
       
    52 -SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_NAMES)),$(or $(wildcard $(call EN_US_OR_L10N_FILE,searchplugins/$(plugin))),$(info Missing searchplugin: $(plugin))))
       
    53 +#SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_NAMES)),$(or $(wildcard $(call EN_US_OR_L10N_FILE,searchplugins/$(plugin))),$(info Missing searchplugin: $(plugin))))
       
    54 +SEARCHPLUGINS := $(addsuffix .xml,$(SEARCHPLUGINS_NAMES))
       
    55  # Some locale-specific search plugins may have preprocessor directives, but the
       
    56  # default en-US ones do not.
       
    57  SEARCHPLUGINS_FLAGS := --silence-missing-directive-warnings
       
    58 -PP_TARGETS += SEARCHPLUGINS
       
    59 +#PP_TARGETS += SEARCHPLUGINS
       
    60  
       
    61  # Required for l10n.mk - defines a list of app sub dirs that should
       
    62  # be included in langpack xpis.
       
    63  ifdef MOZ_METRO
       
    64  # metro build, include both app folders
       
    65  DIST_SUBDIRS = browser metro
       
    66  else
       
    67  DIST_SUBDIRS = $(DIST_SUBDIR)
       
    68 @@ -120,16 +123,39 @@ NO_JA_JP_MAC_AB_CD := $(if $(filter ja-J
       
    69  libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
       
    70  
       
    71  libs:: $(addprefix generic/profile/,$(PROFILE_FILES))
       
    72  	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile
       
    73  
       
    74  libs:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
       
    75  	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile/chrome
       
    76  
       
    77 +tmp-search.jar.mn::
       
    78 +	printf "$(AB_CD).jar:" > $@
       
    79 +	printf "$(foreach plugin,$(SEARCHPLUGINS), \n locale/browser/searchplugins/$(plugin) ($(plugin)))" >> $@
       
    80 +	@echo >> $@
       
    81 +
       
    82 +searchplugins-jar:: $(SEARCHPLUGINS)
       
    83 +	for SEARCHPLUGIN in $^; do \
       
    84 +	$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) \
       
    85 +	$$SEARCHPLUGIN > $$SEARCHPLUGIN-new) ; \
       
    86 +	mv $$SEARCHPLUGIN-new $$SEARCHPLUGIN ; \
       
    87 +	done
       
    88 +
       
    89 +searchplugins-jar:: tmp-search.jar.mn
       
    90 +	$(call py_action,jar_maker,\
       
    91 +	$(QUIET) -j $(FINAL_TARGET)/chrome \
       
    92 +	-s $(topsrcdir)/$(relativesrcdir)/en-US/searchplugins \
       
    93 +	-s $(LOCALE_SRCDIR)/searchplugins \
       
    94 +	$(MAKE_JARS_FLAGS) tmp-search.jar.mn)
       
    95 +
       
    96 +libs:: searchplugins-jar
       
    97 +
       
    98 +GARBAGE += tmp-search.jar.mn
       
    99 +
       
   100  libs-%:
       
   101  	$(NSINSTALL) -D $(DIST)/install
       
   102  	@$(MAKE) -C ../../toolkit/locales libs-$*
       
   103  	@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
       
   104  ifdef MOZ_WEBAPP_RUNTIME
       
   105  	@$(MAKE) -C ../../webapprt/locales AB_CD=$* XPI_NAME=locale-$*
       
   106  endif
       
   107  	@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
       
   108 diff --git a/browser/locales/jar.mn b/browser/locales/jar.mn
       
   109 --- a/browser/locales/jar.mn
       
   110 +++ b/browser/locales/jar.mn
       
   111 @@ -146,14 +146,15 @@
       
   112      locale/browser/syncQuota.properties         (%chrome/browser/syncQuota.properties)
       
   113  #endif
       
   114  % locale browser-region @AB_CD@ %locale/browser-region/
       
   115      locale/browser-region/region.properties        (%chrome/browser-region/region.properties)
       
   116  # the following files are browser-specific overrides
       
   117      locale/browser/netError.dtd                (%chrome/overrides/netError.dtd)
       
   118      locale/browser/appstrings.properties       (%chrome/overrides/appstrings.properties)
       
   119      locale/browser/downloads/settingsChange.dtd  (%chrome/overrides/settingsChange.dtd)
       
   120 +    locale/browser/searchplugins/list.txt      (%searchplugins/list.txt)
       
   121  % override chrome://global/locale/netError.dtd chrome://browser/locale/netError.dtd
       
   122  % override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties
       
   123  % override chrome://mozapps/locale/downloads/settingsChange.dtd chrome://browser/locale/downloads/settingsChange.dtd
       
   124  % locale pdf.js @AB_CD@ %locale/pdfviewer/
       
   125      locale/pdfviewer/viewer.properties             (%pdfviewer/viewer.properties)
       
   126      locale/pdfviewer/chrome.properties             (%pdfviewer/chrome.properties)